Documentation
¶
Overview ¶
Package mock provides a mock implementation of vectorstore.Store for testing.
Index ¶
- type Store
- func (s *Store) Close() error
- func (s *Store) Count(ctx context.Context, collectionName string) (int64, error)
- func (s *Store) DeleteCollection(ctx context.Context, name string) error
- func (s *Store) EnsureCollection(ctx context.Context, name string, dim int) error
- func (s *Store) GetPoints(collectionName string) ([]vectorstore.Point, error)
- func (s *Store) Search(ctx context.Context, collectionName string, vector []float32, topK int) ([]vectorstore.Result, error)
- func (s *Store) Upsert(ctx context.Context, collectionName string, points []vectorstore.Point) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// Hooks for testing behavior
EnsureCollectionFunc func(ctx context.Context, name string, dim int) error
UpsertFunc func(ctx context.Context, collection string, points []vectorstore.Point) error
SearchFunc func(ctx context.Context, collection string, vector []float32, topK int) ([]vectorstore.Result, error)
// contains filtered or unexported fields
}
Store is an in-memory mock implementation of vectorstore.Store. Useful for testing without a real vector database.
func (*Store) DeleteCollection ¶
DeleteCollection removes a collection and all its data.
func (*Store) EnsureCollection ¶
EnsureCollection creates a collection if it doesn't exist.
func (*Store) GetPoints ¶
func (s *Store) GetPoints(collectionName string) ([]vectorstore.Point, error)
GetPoints returns all points in a collection (for test assertions).
Click to show internal directories.
Click to hide internal directories.