Documentation ¶
Index ¶
- type Autoincrement
- func (idx *Autoincrement) Add(id, v string) (string, error)
- func (idx *Autoincrement) CaseInsensitive() bool
- func (idx *Autoincrement) Delete() error
- func (idx *Autoincrement) FilesDir() string
- func (idx *Autoincrement) IndexBy() option.IndexBy
- func (idx *Autoincrement) Init() error
- func (idx *Autoincrement) Lookup(v string) ([]string, error)
- func (idx *Autoincrement) LookupCtx(ctx context.Context, values ...string) ([]string, error)
- func (idx *Autoincrement) Remove(_ string, v string) error
- func (idx *Autoincrement) Search(pattern string) ([]string, error)
- func (idx *Autoincrement) TypeName() string
- func (idx *Autoincrement) Update(id, oldV, newV string) error
- type Index
- type NonUnique
- func (idx *NonUnique) Add(id, v string) (string, error)
- func (idx *NonUnique) CaseInsensitive() bool
- func (idx *NonUnique) Delete() error
- func (idx *NonUnique) FilesDir() string
- func (idx *NonUnique) IndexBy() option.IndexBy
- func (idx *NonUnique) Init() error
- func (idx *NonUnique) Lookup(v string) ([]string, error)
- func (idx *NonUnique) LookupCtx(ctx context.Context, values ...string) ([]string, error)
- func (idx *NonUnique) Remove(id string, v string) error
- func (idx *NonUnique) Search(pattern string) ([]string, error)
- func (idx *NonUnique) TypeName() string
- func (idx *NonUnique) Update(id, oldV, newV string) error
- type Unique
- func (idx *Unique) Add(id, v string) (string, error)
- func (idx *Unique) CaseInsensitive() bool
- func (idx *Unique) Delete() error
- func (idx *Unique) FilesDir() string
- func (idx *Unique) IndexBy() option.IndexBy
- func (idx *Unique) Init() error
- func (idx *Unique) Lookup(v string) ([]string, error)
- func (idx *Unique) LookupCtx(ctx context.Context, values ...string) ([]string, error)
- func (idx *Unique) Remove(_ string, v string) error
- func (idx *Unique) Search(pattern string) ([]string, error)
- func (idx *Unique) TypeName() string
- func (idx *Unique) Update(id, oldV, newV string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Autoincrement ¶
type Autoincrement struct {
// contains filtered or unexported fields
}
Autoincrement are fields for an index of type autoincrement.
func (*Autoincrement) Add ¶
func (idx *Autoincrement) Add(id, v string) (string, error)
Add a new value to the index.
func (*Autoincrement) CaseInsensitive ¶
func (idx *Autoincrement) CaseInsensitive() bool
CaseInsensitive undocumented.
func (*Autoincrement) Delete ¶
func (idx *Autoincrement) Delete() error
Delete deletes the index folder from its storage.
func (*Autoincrement) IndexBy ¶
func (idx *Autoincrement) IndexBy() option.IndexBy
IndexBy undocumented.
func (*Autoincrement) Init ¶
func (idx *Autoincrement) Init() error
Init initializes an autoincrement index.
func (*Autoincrement) Lookup ¶
func (idx *Autoincrement) Lookup(v string) ([]string, error)
Lookup exact lookup by value.
func (*Autoincrement) LookupCtx ¶ added in v2.7.0
LookupCtx retieves multiple exact values and allows passing in a context
func (*Autoincrement) Remove ¶
func (idx *Autoincrement) Remove(_ string, v string) error
Remove a value v from an index.
func (*Autoincrement) Search ¶
func (idx *Autoincrement) Search(pattern string) ([]string, error)
Search allows for glob search on the index.
func (*Autoincrement) Update ¶
func (idx *Autoincrement) Update(id, oldV, newV string) error
Update index from <oldV> to <newV>.
type Index ¶
type Index interface { Init() error Lookup(v string) ([]string, error) LookupCtx(ctx context.Context, v ...string) ([]string, error) Add(id, v string) (string, error) Remove(id string, v string) error Update(id, oldV, newV string) error Search(pattern string) ([]string, error) CaseInsensitive() bool IndexBy() option.IndexBy TypeName() string FilesDir() string Delete() error // Delete deletes the index folder from its storage. }
Index can be implemented to create new indexer-strategies. See Unique for example. Each indexer implementation is bound to one data-column (IndexBy) and a data-type (TypeName)
func NewAutoincrementIndex ¶
NewAutoincrementIndex instantiates a new AutoincrementIndex instance.
func NewNonUniqueIndexWithOptions ¶
NewNonUniqueIndexWithOptions instantiates a new NonUniqueIndex instance. /tmp/ocis/accounts/index.cs3/Pets/Bro* ├── Brown/ │ └── rebef-123 -> /tmp/testfiles-395764020/pets/rebef-123 ├── Green/ │ ├── goefe-789 -> /tmp/testfiles-395764020/pets/goefe-789 │ └── xadaf-189 -> /tmp/testfiles-395764020/pets/xadaf-189 └── White/ | └── wefwe-456 -> /tmp/testfiles-395764020/pets/wefwe-456
type NonUnique ¶
type NonUnique struct {
// contains filtered or unexported fields
}
NonUnique are fields for an index of type non_unique.
func (*NonUnique) CaseInsensitive ¶
CaseInsensitive undocumented.
func (*NonUnique) LookupCtx ¶ added in v2.7.0
LookupCtx retieves multiple exact values and allows passing in a context
type Unique ¶
type Unique struct {
// contains filtered or unexported fields
}
Unique are fields for an index of type unique.
func (*Unique) CaseInsensitive ¶
CaseInsensitive undocumented.
func (*Unique) LookupCtx ¶ added in v2.7.0
LookupCtx retieves multiple exact values and allows passing in a context