Documentation ¶
Index ¶
- func GetBasePrefix() string
- type BaseModel
- type BaseRepo
- func (r BaseRepo) Acquire(ctx context.Context, m IModel, sessionID string) error
- func (r BaseRepo) Delete(ctx context.Context, m IModel) error
- func (r BaseRepo) DeleteTree(ctx context.Context, key string) error
- func (r BaseRepo) Exists(ctx context.Context, key string) (bool, error)
- func (r BaseRepo) Get(ctx context.Context, key string, m IModel) error
- func (r BaseRepo) ListKeys(ctx context.Context, prefix string) ([]string, error)
- func (r BaseRepo) Save(ctx context.Context, m IModel) error
- type IModel
- type IRepo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseModel ¶
type BaseModel struct {
// contains filtered or unexported fields
}
BaseModel implements basic model functionality
func (*BaseModel) GetVersion ¶
GetVersion Base implementation of get version. Default version is "0".
func (*BaseModel) SetVersion ¶
SetVersion Base implementation of set version
type BaseRepo ¶
BaseRepo implements base repo methods
func (BaseRepo) Acquire ¶
Acquire puts the model in the registry with a attempt to lock using sessionID
func (BaseRepo) DeleteTree ¶
DeleteTree deletes all keys under a prefix
type IModel ¶
type IModel interface { // Key returns the key to store the model against Key() string // Prefix returns the key prefix used by the module Prefix() string // Returns the version of the saved model in the registry. Version changes for every update. GetVersion() string //Sets the version of the saved model from the registry. Never to be used by business logic. SetVersion(version string) }
IModel interface which all models should implement
type IRepo ¶
type IRepo interface { Save(ctx context.Context, m IModel) error Acquire(ctx context.Context, m IModel, sessionID string) error Exists(ctx context.Context, key string) (bool, error) Delete(ctx context.Context, m IModel) error DeleteTree(ctx context.Context, key string) error Get(ctx context.Context, key string, m IModel) error ListKeys(ctx context.Context, prefix string) ([]string, error) }
IRepo is an interface over common repo functionality
Click to show internal directories.
Click to hide internal directories.