mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-26 06:50:36 -05:00
35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
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 combines service interfaces for abstraction of storage implementations
|
|
type Manager interface {
|
|
BundleManager
|
|
ValueManager
|
|
}
|
|
|
|
// BundleManager is a bundle service interface for abstraction of storage implementations
|
|
type BundleManager interface {
|
|
ReadBundle(identifier *proto.Identifier) (*proto.SettingsBundle, error)
|
|
WriteBundle(bundle *proto.SettingsBundle) (*proto.SettingsBundle, error)
|
|
ListBundles(identifier *proto.Identifier) ([]*proto.SettingsBundle, error)
|
|
}
|
|
|
|
// ValueManager is a value service interface for abstraction of storage implementations
|
|
type ValueManager interface {
|
|
ReadValue(identifier *proto.Identifier) (*proto.SettingsValue, error)
|
|
WriteValue(value *proto.SettingsValue) (*proto.SettingsValue, error)
|
|
ListValues(identifier *proto.Identifier) ([]*proto.SettingsValue, error)
|
|
}
|