Documentation
¶
Index ¶
- type Builder
- func (b *Builder) BackedBy(backing ItemStorageBacking) *Builder
- func (b *Builder) Build() ItemStorage
- func (b *Builder) WithBacking(backingType string) *Builder
- func (b *Builder) WithDefaultBacking() *Builder
- func (b *Builder) WithEndpoint(endpoint string) *Builder
- func (b *Builder) WithNamespace(ns string) *Builder
- func (b *Builder) WithPK(keyFields *indexing.Key) *Builder
- func (b *Builder) WithRecord(recordTypePtr interface{}) *Builder
- type ItemStorage
- type ItemStorageBacking
- type KeyedStorage
- func (s *KeyedStorage) Add(item search.Record) error
- func (s *KeyedStorage) AddUniqueIndex(key *indexing.Key)
- func (s *KeyedStorage) Close()
- func (s *KeyedStorage) Find(query indexing.Query, output *search.ExternalResultItem) error
- func (s *KeyedStorage) ForEach(callback func(record interface{}))
- func (s *KeyedStorage) GetNewest(count int) []search.ExternalResultItem
- func (s *KeyedStorage) NewWithKey(key *indexing.Key) ItemStorage
- func (s *KeyedStorage) SetKey(index *indexing.Key) error
- func (s *KeyedStorage) Size() int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶ added in v0.3.0
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶ added in v0.3.0
func NewBuilder() *Builder
func (*Builder) BackedBy ¶ added in v0.3.0
func (b *Builder) BackedBy(backing ItemStorageBacking) *Builder
func (*Builder) Build ¶ added in v0.3.0
func (b *Builder) Build() ItemStorage
func (*Builder) WithBacking ¶ added in v0.3.0
func (*Builder) WithDefaultBacking ¶ added in v0.3.0
func (*Builder) WithEndpoint ¶ added in v0.3.0
func (*Builder) WithNamespace ¶ added in v0.3.0
func (*Builder) WithRecord ¶ added in v0.3.0
type ItemStorage ¶
type ItemStorage interface { Size() int64 Find(query indexing.Query, output *search.ExternalResultItem) error Add(item search.Record) error AddUniqueIndex(key *indexing.Key) NewWithKey(pk *indexing.Key) ItemStorage Close() SetKey(index *indexing.Key) error GetNewest(count int) []search.ExternalResultItem ForEach(callback func(record interface{})) }
type ItemStorageBacking ¶
type ItemStorageBacking interface { //Tries to find a single record matching the query. Find(query indexing.Query, result interface{}) error HasIndex(meta *indexing.IndexMetadata) bool Update(query indexing.Query, item interface{}) error //CreateWithId creates a new record using a custom key CreateWithId(parts *indexing.Key, item search.Record, uniqueIndexKeys *indexing.Key) error //Create a new record with the default key (UUIDValue) Create(item search.Record, additionalPK *indexing.Key) error //Size is the size of the storage, as in records count Size() int64 //GetNewest returns the latest `count` of records. GetNewest(count int) []search.ExternalResultItem Close() ForEach(callback func(record interface{})) }
type KeyedStorage ¶
type KeyedStorage struct {
// contains filtered or unexported fields
}
func (*KeyedStorage) Add ¶
func (s *KeyedStorage) Add(item search.Record) error
Add handles the discovery of the result, adding additional information like staleness state.
func (*KeyedStorage) AddUniqueIndex ¶ added in v0.2.2
func (s *KeyedStorage) AddUniqueIndex(key *indexing.Key)
AddUniqueIndex adds a new key set as unique for this storage.
func (*KeyedStorage) Close ¶ added in v0.2.2
func (s *KeyedStorage) Close()
func (*KeyedStorage) Find ¶ added in v0.2.2
func (s *KeyedStorage) Find(query indexing.Query, output *search.ExternalResultItem) error
func (*KeyedStorage) ForEach ¶ added in v0.3.0
func (s *KeyedStorage) ForEach(callback func(record interface{}))
func (*KeyedStorage) GetNewest ¶ added in v0.2.2
func (s *KeyedStorage) GetNewest(count int) []search.ExternalResultItem
func (*KeyedStorage) NewWithKey ¶
func (s *KeyedStorage) NewWithKey(key *indexing.Key) ItemStorage
NewWithKey gets a storage backed in the same way, with a different key.
func (*KeyedStorage) SetKey ¶ added in v0.2.2
func (s *KeyedStorage) SetKey(index *indexing.Key) error
func (*KeyedStorage) Size ¶ added in v0.2.2
func (s *KeyedStorage) Size() int64
Click to show internal directories.
Click to hide internal directories.