Documentation ¶
Index ¶
- Variables
- func StorePolicies(policies models.TreePolicies, path string) error
- type Configuration
- type Constructor
- type DryStorage
- type FileNameProvider
- type MultiStorage
- type MultiStorageConfiguration
- type ReadFileOpt
- type ReadFileOpts
- type ServerStorage
- type Storage
- type TenantStorage
- type WithID
- type Writer
- type WriterFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Configuration{
DirPath: "data",
}
View Source
var DefaultMultiStorageConfig = func() *MultiStorageConfiguration { return &MultiStorageConfiguration{ DirPath: []string{"data"}, } }
Functions ¶
func StorePolicies ¶
func StorePolicies(policies models.TreePolicies, path string) error
Types ¶
type Configuration ¶
type Configuration struct {
DirPath string `json:"dir_path"`
}
type Constructor ¶ added in v1.3.0
type Constructor func(config *Configuration) Storage
type DryStorage ¶ added in v1.3.0
type DryStorage struct {
DelegatedWriter WriterFunc
}
func InitDryStorage ¶ added in v1.3.0
func InitDryStorage(out string, constr Constructor) (*DryStorage, error)
func (*DryStorage) Read ¶ added in v1.3.0
func (d *DryStorage) Read(ctx context.Context, opts ...api.SourceOpt) (models.Rfc7396PatchOperation, error)
func (*DryStorage) Write ¶ added in v1.3.0
func (d *DryStorage) Write(ctx context.Context, data models.Rfc7396PatchOperation, opts ...api.SourceOpt) error
type FileNameProvider ¶
type MultiStorage ¶
type MultiStorage struct { Storages []Storage Config *MultiStorageConfiguration }
func InitMultiStorage ¶
func InitMultiStorage(config *MultiStorageConfiguration, constr Constructor) (*MultiStorage, error)
func (*MultiStorage) Read ¶
func (m *MultiStorage) Read(ctx context.Context, opts ...api.SourceOpt) (models.Rfc7396PatchOperation, error)
Read data from all storages and merge them
func (*MultiStorage) String ¶ added in v1.1.0
func (m *MultiStorage) String() string
func (*MultiStorage) Write ¶ added in v1.1.0
func (m *MultiStorage) Write(ctx context.Context, data models.Rfc7396PatchOperation, opts ...api.SourceOpt) error
Write for simplicity stores data in first storage only, it is responsibility of the user to move entities to other storages
type MultiStorageConfiguration ¶
type MultiStorageConfiguration struct {
DirPath []string `json:"dir_path"`
}
type ReadFileOpt ¶
type ReadFileOpt func(opts *ReadFileOpts)
type ReadFileOpts ¶
type ReadFileOpts struct { }
type ServerStorage ¶ added in v1.3.0
type ServerStorage struct {
Config *Configuration
}
func (*ServerStorage) Read ¶ added in v1.3.0
func (s *ServerStorage) Read(ctx context.Context, opts ...api.SourceOpt) (models.Rfc7396PatchOperation, error)
func (*ServerStorage) String ¶ added in v1.3.0
func (s *ServerStorage) String() string
func (*ServerStorage) Write ¶ added in v1.3.0
func (s *ServerStorage) Write(ctx context.Context, input models.Rfc7396PatchOperation, opts ...api.SourceOpt) error
type Storage ¶
type Storage interface { Write(ctx context.Context, data models.Rfc7396PatchOperation, opts ...api.SourceOpt) error Read(ctx context.Context, opts ...api.SourceOpt) (models.Rfc7396PatchOperation, error) }
func InitServerStorage ¶ added in v1.3.0
func InitServerStorage(config *Configuration) Storage
func InitTenantStorage ¶ added in v1.3.0
func InitTenantStorage(config *Configuration) Storage
type TenantStorage ¶ added in v1.3.0
type TenantStorage struct { Config *Configuration ServerStorage Storage }
func (*TenantStorage) Read ¶ added in v1.3.0
func (t *TenantStorage) Read(ctx context.Context, opts ...api.SourceOpt) (models.Rfc7396PatchOperation, error)
func (*TenantStorage) Write ¶ added in v1.3.0
func (t *TenantStorage) Write(ctx context.Context, data models.Rfc7396PatchOperation, opts ...api.SourceOpt) error
type WriterFunc ¶ added in v1.3.0
Click to show internal directories.
Click to hide internal directories.