aboutsummaryrefslogtreecommitdiffstats
path: root/lib/pama/store
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pama/store')
-rw-r--r--lib/pama/store/store.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/pama/store/store.go b/lib/pama/store/store.go
index 8f93873d..aaee5412 100644
--- a/lib/pama/store/store.go
+++ b/lib/pama/store/store.go
@@ -221,6 +221,23 @@ func (instance) Names() ([]string, error) {
return names, nil
}
+func (instance) Project(name string) (models.Project, error) {
+ db, err := openStorage()
+ if err != nil {
+ return models.Project{}, err
+ }
+ defer db.Close()
+ raw, err := db.Get(createKey(name), nil)
+ if err != nil {
+ return models.Project{}, err
+ }
+ p, err := decode(raw)
+ if err != nil {
+ return models.Project{}, err
+ }
+ return p, nil
+}
+
func (instance) Projects() ([]models.Project, error) {
var projects []models.Project
db, err := openStorage()