Documentation
¶
Index ¶
- type LRUCache
- type MemoryStorage
- func (s *MemoryStorage) BatchDelete(ids []string) error
- func (s *MemoryStorage) BatchGet(ids []string) ([]*types.Vector, error)
- func (s *MemoryStorage) BatchPut(vectors []*types.Vector) error
- func (s *MemoryStorage) Close() error
- func (s *MemoryStorage) Count() (int, error)
- func (s *MemoryStorage) Delete(id string) error
- func (s *MemoryStorage) Get(id string) (*types.Vector, error)
- func (s *MemoryStorage) Iterate(fn func(*types.Vector) bool) error
- func (s *MemoryStorage) Load(path string) error
- func (s *MemoryStorage) Put(vec *types.Vector) error
- func (s *MemoryStorage) Save(path string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LRUCache ¶
type LRUCache[K comparable, V any] struct { // contains filtered or unexported fields }
LRUCache LRU 缓存
func NewLRUCache ¶
func NewLRUCache[K comparable, V any](capacity int) *LRUCache[K, V]
NewLRUCache 创建 LRU 缓存
type MemoryStorage ¶
type MemoryStorage struct {
// contains filtered or unexported fields
}
MemoryStorage 内存存储引擎
func (*MemoryStorage) BatchDelete ¶
func (s *MemoryStorage) BatchDelete(ids []string) error
BatchDelete 批量删除向量
func (*MemoryStorage) BatchGet ¶
func (s *MemoryStorage) BatchGet(ids []string) ([]*types.Vector, error)
BatchGet 批量获取向量
func (*MemoryStorage) BatchPut ¶
func (s *MemoryStorage) BatchPut(vectors []*types.Vector) error
BatchPut 批量存储向量
func (*MemoryStorage) Get ¶
func (s *MemoryStorage) Get(id string) (*types.Vector, error)
Get 获取单个向量
Click to show internal directories.
Click to hide internal directories.