Versions in this module Expand all Collapse all v0 v0.7.0 Dec 7, 2022 Changes in this version + const Disk + const FastSync + const InMemory + const RAM + var ErrFieldUnknown = errors.New("field not part of the index") + var ErrIndexExists = errors.New("index already exists") + var ErrIndexNotSet = errors.New("index must be set before lookup") + var ErrIndexUnknown = errors.New("index is unknown") + var ErrInternalDBError = errors.New("internal database returned an error") + var ErrLookupEmpty = errors.New("no results for lookup") + var ErrLookupFailure = errors.New("could not complete lookup") + var ErrMarshallingFailed = errors.New("marshalling failed") + var ErrPrimaryKeyMissing = errors.New("index is missing a primary key") + var ErrSegmentMissing = errors.New("segment was not available for lookup") + var ErrSegmentNotFound = errors.New("segment does not exist") + var ErrUnknownDataType = errors.New("data type not supported") + type Action interface + type ClientConfig struct + Durability DurabilityProfile + Path string + type DB struct + func NewDB(ctx context.Context) (*DB, error) + func NewDBWithConfig(ctx context.Context, config *ClientConfig) (*DB, error) + func (db *DB) CreateIndex(indexDefinition *api.IndexDefinition) (*Index, error) + func (db *DB) DeleteIndex(name string) (*Index, error) + func (db *DB) DeleteSegment(indexName string, segmentKey string) (*Segment, error) + func (db *DB) GetAllSegments(indexName string, iter func(segment *api.Segment) bool) error + func (db *DB) GetIndexByName(name string) (*Index, error) + func (db *DB) GetSegmentByKey(indexName string, segmentKey string) (*Segment, error) + func (db *DB) InsertSegment(indexName string, segment *api.Segment) (*Segment, error) + func (db *DB) ListIndexes() []*api.IndexDefinition + func (db *DB) Lookup(indexName string, lookup *api.Lookup) (*Iterator, error) + func (db *DB) LookupSegments(indexName string, lookup *api.Lookup) (*Iterator, error) + func (db *DB) NewSegment(indexName string, segment *api.Segment) (*Segment, error) + func (db *DB) ReplaceSegment(indexName string, segmentKey string, newSegment *api.Segment) (*Segment, error) + func (db *DB) TruncateIndex(name string) error + type DurabilityProfile int + type Index struct + func (i *Index) Create() error + func (i *Index) Definition() *api.IndexDefinition + func (i *Index) Delete() error + func (i *Index) DeleteSegment(key string) (*Segment, error) + func (i *Index) Exists() (bool, error) + func (i *Index) GetAllSegments(iter func(segment *api.Segment) bool) error + func (i *Index) GetSegmentByKey(key string) (*Segment, error) + func (i *Index) InsertSegment(segment *api.Segment) (*Segment, error) + func (i *Index) Lookup(lookup *api.Lookup) (*Iterator, error) + func (i *Index) LookupSegments(lookup *api.Lookup) (*Iterator, error) + func (i *Index) NewSegment(segment *api.Segment) (*Segment, error) + func (i *Index) Proto() *api.IndexDefinition + func (i *Index) ReplaceSegment(key string, newSegment *api.Segment) (*Segment, error) + func (i *Index) Truncate() error + func (i *Index) UnmarshallPrimaryValue(value string) (*api.SegmentField, error) + type Iterator struct + func (t *Iterator) Next(dst *api.Segment) (key string, err error) + type Key struct + func (k *Key) FieldNameAtIndex(fieldIndex int) (string, bool) + func (k *Key) FieldValueIndex() (string, bool) + func (k *Key) IndexId() (string, bool) + func (k *Key) SegmentKey() (string, bool) + func (k *Key) String() string + type Lookup struct + func (l *Lookup) Run() *Iterator + func (l *Lookup) RunOnIndex(indexName string) *Iterator + type Segment struct + func (s *Segment) Delete() error + func (s *Segment) Insert() error + func (s *Segment) Proto() *api.Segment + func (s *Segment) Replace(new *api.Segment) (*Segment, error) + type Stringer struct + func NewFieldDefinitionStringer(fieldDefinition *api.FieldDefinition) *Stringer + func NewLookupStringer(field *api.LookupField, iter func(key, value string) bool) *Stringer + func NewSegmentStringer(field *api.SegmentField, iter func(key, value string) bool) *Stringer + func (s *Stringer) MarshallText() error + func (s *Stringer) UnmarshallText(value string) (*api.SegmentField, error) + type Txn struct + func NewTxn(db *DB, safe bool) *Txn + func (t *Txn) AddAction(action Action) + func (t *Txn) Reset() + func (t *Txn) Settle() error