Documentation ¶
Overview ¶
Package service manages the main logic of server.
Package service manages the main logic of server.
Index ¶
- type NGT
- type Option
- func WithAutoIndexCheckDuration(dur string) Option
- func WithAutoIndexDurationLimit(dur string) Option
- func WithAutoIndexLength(l int) Option
- func WithAutoSaveIndexDuration(dur string) Option
- func WithCopyOnWrite(enabled bool) Option
- func WithDefaultEpsilon(epsilon float32) Option
- func WithDefaultPoolSize(ps uint32) Option
- func WithDefaultRadius(rad float32) Option
- func WithEnableInMemoryMode(enabled bool) Option
- func WithErrGroup(eg errgroup.Group) Option
- func WithIndexPath(path string) Option
- func WithInitialDelayMaxDuration(dur string) Option
- func WithLoadIndexTimeoutFactor(dur string) Option
- func WithMaxLoadIndexTimeout(dur string) Option
- func WithMinLoadIndexTimeout(dur string) Option
- func WithProactiveGC(enabled bool) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NGT ¶
type NGT interface { Start(ctx context.Context) <-chan error Search(vec []float32, size uint32, epsilon, radius float32) ([]model.Distance, error) SearchByID(uuid string, size uint32, epsilon, radius float32) ([]float32, []model.Distance, error) LinearSearch(vec []float32, size uint32) ([]model.Distance, error) LinearSearchByID(uuid string, size uint32) ([]float32, []model.Distance, error) Insert(uuid string, vec []float32) (err error) InsertWithTime(uuid string, vec []float32, t int64) (err error) InsertMultiple(vecs map[string][]float32) (err error) InsertMultipleWithTime(vecs map[string][]float32, t int64) (err error) Update(uuid string, vec []float32) (err error) UpdateWithTime(uuid string, vec []float32, t int64) (err error) UpdateMultiple(vecs map[string][]float32) (err error) UpdateMultipleWithTime(vecs map[string][]float32, t int64) (err error) Delete(uuid string) (err error) DeleteWithTime(uuid string, t int64) (err error) DeleteMultiple(uuids ...string) (err error) DeleteMultipleWithTime(uuids []string, t int64) (err error) GetObject(uuid string) (vec []float32, err error) CreateIndex(ctx context.Context, poolSize uint32) (err error) SaveIndex(ctx context.Context) (err error) Exists(string) (uint32, bool) CreateAndSaveIndex(ctx context.Context, poolSize uint32) (err error) IsIndexing() bool IsSaving() bool Len() uint64 NumberOfCreateIndexExecution() uint64 NumberOfProactiveGCExecution() uint64 UUIDs(context.Context) (uuids []string) DeleteVQueueBufferLen() uint64 InsertVQueueBufferLen() uint64 GetDimensionSize() int Close(ctx context.Context) error }
type Option ¶ added in v0.0.47
type Option func(n *ngt) error
Option represent the functional option for ngt
func WithAutoIndexCheckDuration ¶ added in v0.0.47
WithAutoIndexCheckDuration returns the functional option to set the index check duration.
func WithAutoIndexDurationLimit ¶ added in v0.0.47
WithAutoIndexDurationLimit returns the functional option to set the auto index duration limit.
func WithAutoIndexLength ¶ added in v0.0.47
WithAutoIndexLength returns the functional option to set the auto index length.
func WithAutoSaveIndexDuration ¶ added in v0.0.47
WithAutoSaveIndexDuration returns the functional option to set the auto save index duration.
func WithCopyOnWrite ¶ added in v1.5.0
WithCopyOnWrite returns the functional option to set the CoW enable flag.
func WithDefaultEpsilon ¶ added in v0.0.47
WithDefaultEpsilon returns the functional option to set the default epsilon for NGT.
func WithDefaultPoolSize ¶ added in v0.0.47
WithDefaultPoolSize returns the functional option to set the default pool size for NGT.
func WithDefaultRadius ¶ added in v0.0.47
WithDefaultRadius returns the functional option to set the default radius for NGT.
func WithEnableInMemoryMode ¶ added in v0.0.47
WithEnableInMemoryMode returns the functional option to set the in memory mode flag.
func WithErrGroup ¶ added in v0.0.47
WithErrGroup returns the functional option to set the error group.
func WithIndexPath ¶ added in v0.0.47
WithIndexPath returns the functional option to set the index path of the NGT.
func WithInitialDelayMaxDuration ¶ added in v0.0.47
WithInitialDelayMaxDuration returns the functional option to set the initial delay duration.
func WithLoadIndexTimeoutFactor ¶ added in v0.0.47
WithLoadIndexTimeoutFactor returns the functional option to set the factor of load index timeout.
func WithMaxLoadIndexTimeout ¶ added in v0.0.47
WithMaxLoadIndexTimeout returns the functional option to set the maximum load index timeout.
func WithMinLoadIndexTimeout ¶ added in v0.0.47
WithMinLoadIndexTimeout returns the functional option to set the minimal load index timeout.
func WithProactiveGC ¶ added in v0.0.56
WithProactiveGC returns the functional option to set the proactive GC enable flag.