Documentation ¶
Index ¶
- Variables
- func MakeEndpoints(host string, registry Registry, logger log.Logger)
- type Builder
- type Err
- type Index
- type IndexedStore
- type Iterator
- type KeyMapper
- type Meta
- type MockRecord
- type MockStore
- func (s *MockStore) Backend() backend.Backend
- func (s *MockStore) Delete(ctx context.Context, key interface{}) error
- func (s *MockStore) Get(ctx context.Context, key interface{}) (value interface{}, err error)
- func (*MockStore) GetAll(ctx context.Context) (Iterator, error)
- func (*MockStore) GetRange(ctx context.Context, fromKey interface{}, toKey interface{}) (map[interface{}]interface{}, error)
- func (s *MockStore) KeyEncoder() encoding.Encoder
- func (s *MockStore) Name() string
- func (s *MockStore) Set(ctx context.Context, key interface{}, value interface{}, expiry time.Duration) error
- func (s *MockStore) String() string
- func (s *MockStore) ValEncoder() encoding.Encoder
- type Options
- func Buffered(size int) Options
- func ChangelogEnabled() Options
- func Compacated() Options
- func Expire(d time.Duration) Options
- func WithBackend(backend backend.Backend) Options
- func WithBackendBuilder(builder backend.Builder) Options
- func WithChangelog(changelog changelog.Changelog) Options
- func WithLogger(logger log.Logger) Options
- type RecoverableStore
- type Registry
- type RegistryConfig
- type StateStore
- type StateStoreBuilder
- type Store
Constants ¶
This section is empty.
Variables ¶
View Source
var UnknownIndex = errors.New(`index does not exist`)
Functions ¶
func MakeEndpoints ¶
Types ¶
type Index ¶
type Index interface { Name() string Write(key, value interface{}) error Delete(val, value interface{}) error Read(index interface{}) ([]interface{}, error) }
func NewStringHashIndex ¶
type IndexedStore ¶
type IndexedStore interface { Store GetIndex(ctx context.Context, name string) (Index, error) GetIndexedRecords(ctx context.Context, index string, key interface{}) ([]interface{}, error) }
func NewIndexedStore ¶
type MockRecord ¶
type MockRecord struct {
// contains filtered or unexported fields
}
type MockStore ¶
type MockStore struct {
// contains filtered or unexported fields
}
func (*MockStore) KeyEncoder ¶
func (*MockStore) ValEncoder ¶
type Options ¶
type Options func(config *storeOptions)
func ChangelogEnabled ¶
func ChangelogEnabled() Options
func Compacated ¶
func Compacated() Options
func WithBackend ¶
func WithBackendBuilder ¶
func WithChangelog ¶
func WithLogger ¶
func WithLogger(logger log.Logger) Options
type RecoverableStore ¶
type Registry ¶
type Registry interface { Register(store Store) New(name string, keyEncoder encoding.Builder, valEncoder encoding.Builder, options ...Options) Store Store(name string) Store List() []string }
func NewRegistry ¶
func NewRegistry(config *RegistryConfig) Registry
type RegistryConfig ¶
type RegistryConfig struct { Host string HttpEnabled bool StoreBuilder Builder StateStoreBuilder StateStoreBuilder Logger log.Logger MetricsReporter metrics.Reporter // contains filtered or unexported fields }
type StateStore ¶
type StateStore interface { Name() string Set(key interface{}, value interface{}) error Get(key interface{}) (value interface{}, err error) GetAll() ([]*data.Record, error) }
func NewStateStore ¶
type StateStoreBuilder ¶
type Store ¶
type Store interface { Name() string Backend() backend.Backend KeyEncoder() encoding.Encoder ValEncoder() encoding.Encoder Set(ctx context.Context, key interface{}, value interface{}, expiry time.Duration) error Get(ctx context.Context, key interface{}) (value interface{}, err error) GetRange(ctx context.Context, fromKey interface{}, toKey interface{}) (map[interface{}]interface{}, error) GetAll(ctx context.Context) (Iterator, error) Delete(ctx context.Context, key interface{}) error String() string }
func NewMockStore ¶
Click to show internal directories.
Click to hide internal directories.