Basic service boilerplate for settings bundles
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package settings
|
||||
|
||||
import (
|
||||
"github.com/owncloud/ocis-settings/pkg/config"
|
||||
"github.com/owncloud/ocis-settings/pkg/proto/v0"
|
||||
)
|
||||
|
||||
var (
|
||||
// Registry uses the strategy pattern as a registry
|
||||
Registry = map[string]RegisterFunc{}
|
||||
)
|
||||
|
||||
// RegisterFunc stores store constructors
|
||||
type RegisterFunc func(*config.Config) Manager
|
||||
|
||||
// Manager
|
||||
type Manager interface {
|
||||
Read(extension string, key string) (*proto.SettingsBundle, error)
|
||||
Write(bundle *proto.SettingsBundle) (*proto.SettingsBundle, error)
|
||||
List() ([]*proto.SettingsBundle, error)
|
||||
ListByExtension(extension string) ([]*proto.SettingsBundle, error)
|
||||
}
|
||||
Reference in New Issue
Block a user