Documentation ¶
Index ¶
- func DeleteIndexes(ctx context.Context, store IndexedStore, key interface{}) error
- func MakeEndpoints(host string, registry Registry, logger log.Logger)
- func UpdateIndexes(ctx context.Context, store IndexedStore, key, val interface{}) error
- type Builder
- type Cache
- func (c *Cache) Backend() backend.Cache
- func (c *Cache) Close() error
- func (c *Cache) Delete(ctx context.Context, key interface{}) error
- func (c *Cache) Flush() error
- func (c *Cache) Get(ctx context.Context, key interface{}) (value interface{}, err error)
- func (c *Cache) Iterator(ctx context.Context) (Iterator, error)
- func (c *Cache) PrefixedIterator(ctx context.Context, keyPrefix interface{}, prefixEncoder encoding.Encoder) (Iterator, error)
- func (c *Cache) Reset()
- func (c *Cache) Set(ctx context.Context, key, value interface{}, expiry time.Duration) error
- type Closable
- type Err
- type IdxBuilder
- type Index
- type IndexBuilder
- type IndexedStore
- type IndexedStoreBuilder
- type Iterator
- type KeyMapper
- type Meta
- type Option
- func Buffered(size int) Option
- func Compacated() Option
- func WithBackend(backend backend.Backend) Option
- func WithBackendBuilder(builder backend.Builder) Option
- func WithCachingEnabled() Option
- func WithVersionExtractor(etc RecordVersionExtractor) Option
- func WithVersionWriter(wr RecordVersionWriter) Option
- type ReadOnlyStore
- type RecordVersionExtractor
- type RecordVersionWriter
- type Registry
- type RegistryConfig
- type StateStoresLister
- type Store
- type StoreBuilder
- type StoreCache
- type StoreOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteIndexes ¶
func DeleteIndexes(ctx context.Context, store IndexedStore, key interface{}) error
func UpdateIndexes ¶
func UpdateIndexes(ctx context.Context, store IndexedStore, key, val interface{}) error
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) PrefixedIterator ¶
type IdxBuilder ¶
type IdxBuilder struct {
// contains filtered or unexported fields
}
func NewIndex ¶
func NewIndex(name string, mapper KeyMapper) *IdxBuilder
func (*IdxBuilder) Build ¶
func (idb *IdxBuilder) Build(store ReadOnlyStore, backend backend.Builder, keyEncoder encoding.Encoder) (Index, error)
func (*IdxBuilder) Name ¶ added in v2.0.1
func (idb *IdxBuilder) Name() string
type Index ¶
type Index interface { sync.Locker String() string Write(key, value interface{}) error KeyPrefixer(key, value interface{}) (hash string) Delete(key, value interface{}) error Read(index string) (backend.Iterator, error) Values(key string) ([]string, error) Keys() ([]string, error) Compare(key interface{}, valBefore, valAfter interface{}) (bool, error) KeyIndexed(index string, key interface{}) (bool, error) Backend() backend.Backend Close() error }
type IndexBuilder ¶
type IndexedStore ¶
type IndexedStore interface { Store GetIndex(ctx context.Context, name string) (Index, error) Indexes() []Index GetIndexedRecords(ctx context.Context, indexName, key string) (Iterator, error) RebuildIndexes() error }
func NewIndexedStore ¶
func NewIndexedStore(name string, keyEncoder, valEncoder encoding.Encoder, indexes []IndexBuilder, options ...Option) (IndexedStore, error)
type IndexedStoreBuilder ¶
type IndexedStoreBuilder func(name string, keyEncoder, valEncoder encoding.Encoder, indexes []IndexBuilder, options ...Option) (IndexedStore, error)
type Iterator ¶
type Option ¶
type Option func(config *StoreOptions)
func Compacated ¶
func Compacated() Option
func WithBackend ¶
func WithBackendBuilder ¶
func WithCachingEnabled ¶
func WithCachingEnabled() Option
func WithVersionExtractor ¶
func WithVersionExtractor(etc RecordVersionExtractor) Option
func WithVersionWriter ¶
func WithVersionWriter(wr RecordVersionWriter) Option
type ReadOnlyStore ¶
type ReadOnlyStore interface { Name() string KeyEncoder() encoding.Encoder ValEncoder() encoding.Encoder Get(ctx context.Context, key interface{}) (value interface{}, err error) Iterator(ctx context.Context) (Iterator, error) PrefixedIterator(ctx context.Context, keyPrefix interface{}, prefixEncoder encoding.Encoder) (Iterator, error) String() string Close() error }
type RecordVersionExtractor ¶
type RecordVersionWriter ¶
type Registry ¶
type Registry interface { Register(store ReadOnlyStore) error RegisterDynamic(name string, lister StateStoresLister) error Create(name string, keyEncoder, valEncoder encoding.Encoder, options ...Option) (Store, error) CreateOrReturn(name string, keyEncoder encoding.Encoder, valEncoder encoding.Encoder, options ...Option) (Store, error) NewIndexedStore(name string, keyEncoder, valEncoder encoding.Encoder, indexes []IndexBuilder, options ...Option) IndexedStore NewBuilder(name string, keyEncoder, valEncoder encoding.Encoder, options ...Option) StoreBuilder Store(name string) (ReadOnlyStore, error) Builder(name string) (StoreBuilder, error) Index(name string) (Index, error) Stores() []ReadOnlyStore StartWebServer() Builders() []StoreBuilder Indexes() []Index }
func NewRegistry ¶
func NewRegistry(config *RegistryConfig) Registry
type RegistryConfig ¶
type StateStoresLister ¶
type StateStoresLister func() []ReadOnlyStore
type Store ¶
type StoreBuilder ¶
func NewDefaultStoreBuilder ¶
type StoreCache ¶
type StoreCache interface { Get(ctx context.Context, key interface{}) (value interface{}, err error) Iterator(ctx context.Context) (Iterator, error) PrefixedIterator(ctx context.Context, keyPrefix interface{}, prefixEncoder encoding.Encoder) (Iterator, error) Set(ctx context.Context, key, value interface{}, expiry time.Duration) error Delete(ctx context.Context, key interface{}) error Flush() error Close() error Reset() Backend() backend.Cache }
type StoreOptions ¶
type StoreOptions struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.