New storm artist repository, WIP

This commit is contained in:
Deluan
2020-01-10 15:08:23 -05:00
committed by Deluan Quintão
parent 40904b220e
commit aebb960831
11 changed files with 325 additions and 5 deletions
+31
View File
@@ -0,0 +1,31 @@
package storm
import (
"github.com/cloudsonic/sonic-server/domain"
)
const propertyBucket = "Property"
type propertyRepository struct {
}
func NewPropertyRepository() domain.PropertyRepository {
r := &propertyRepository{}
return r
}
func (r *propertyRepository) Put(id string, value string) error {
return Db().Set(propertyBucket, id, value)
}
func (r *propertyRepository) Get(id string) (string, error) {
var value string
err := Db().Get(propertyBucket, id, &value)
return value, err
}
func (r *propertyRepository) DefaultGet(id string, defaultValue string) (string, error) {
return defaultValue, nil
}
var _ domain.PropertyRepository = (*propertyRepository)(nil)