testutil

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockDSUPersistence

type MockDSUPersistence struct {
	LoadFunc func() (*disjoint_set.DSU, error)
	SaveFunc func(dsu *disjoint_set.DSU) error

	SaveCount int
	LastDSU   *disjoint_set.DSU
	// contains filtered or unexported fields
}

MockDSUPersistence is a mock implementation of DisjointSetPersistence for testing

func (*MockDSUPersistence) Load

func (m *MockDSUPersistence) Load() (*disjoint_set.DSU, error)

func (*MockDSUPersistence) Save

func (m *MockDSUPersistence) Save(dsu *disjoint_set.DSU) error

type MockEmbeddingClient

type MockEmbeddingClient struct {
	GenerateEmbeddingFunc func(ctx context.Context, text string) ([]float32, error)

	CallCount int
	LastText  string
	// contains filtered or unexported fields
}

MockEmbeddingClient is a mock implementation of EmbeddingClient for testing

func (*MockEmbeddingClient) GenerateEmbedding

func (m *MockEmbeddingClient) GenerateEmbedding(ctx context.Context, text string) ([]float32, error)

type MockLLMClient

type MockLLMClient struct {
	ClassifyFunc func(ctx context.Context, text string) (string, error)

	CallCount int
	LastText  string
	// contains filtered or unexported fields
}

MockLLMClient is a mock implementation of LLMClient for testing

func (*MockLLMClient) Classify

func (m *MockLLMClient) Classify(ctx context.Context, text string) (string, error)

type MockVectorClient

type MockVectorClient struct {
	SearchFunc func(ctx context.Context, vector []float32, topK int) ([]types.VectorMatch, error)
	UpsertFunc func(ctx context.Context, id string, vector []float32, metadata map[string]any) error

	CallCount   int
	UpsertCount int
	Storage     map[string]struct {
		Vector   []float32
		Metadata map[string]any
	}
	// contains filtered or unexported fields
}

MockVectorClient is a mock implementation of VectorClient for testing

func NewMockVectorClient

func NewMockVectorClient() *MockVectorClient

func (*MockVectorClient) Search

func (m *MockVectorClient) Search(ctx context.Context, vector []float32, topK int) ([]types.VectorMatch, error)

func (*MockVectorClient) Upsert

func (m *MockVectorClient) Upsert(ctx context.Context, id string, vector []float32, metadata map[string]any) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL