Documentation
¶
Overview ¶
Package testutil provides centralized test mocks, fixtures, and helpers. All test files should import mocks from here instead of defining their own.
Index ¶
- Constants
- func AssertFactContains(t *testing.T, store *storage.SQLiteStore, userID int64, content string)
- func AssertFactCount(t *testing.T, store *storage.SQLiteStore, userID int64, expected int)
- func AssertFactExists(t *testing.T, store *storage.SQLiteStore, userID int64, substr string) storage.Fact
- func AssertLogContains(t *testing.T, logs []LogEntry, level string, msg string)
- func AssertLogHasField(t *testing.T, logs []LogEntry, key string, value interface{})
- func AssertMessageCount(t *testing.T, store *storage.SQLiteStore, userID int64, expected int)
- func AssertMessageExists(t *testing.T, store *storage.SQLiteStore, userID int64, substr string) storage.Message
- func AssertMetricExists(t *testing.T, metrics, metricName string)
- func AssertMetricGreaterThan(t *testing.T, metrics, metricName string, threshold float64)
- func AssertMetricIncremented(t *testing.T, before, after, metricName string)
- func AssertMetricValue(t *testing.T, metrics, metricName, expectedValue string, ...)
- func AssertNoErrorLogs(t *testing.T, logs []LogEntry)
- func AssertPersonCount(t *testing.T, store *storage.SQLiteStore, userID int64, expected int)
- func AssertPersonExists(t *testing.T, store *storage.SQLiteStore, userID int64, name string) storage.Person
- func AssertPersonHasAlias(t *testing.T, store *storage.SQLiteStore, userID int64, personName string, ...)
- func AssertTopicCount(t *testing.T, store *storage.SQLiteStore, userID int64, expected int)
- func AssertTopicExists(t *testing.T, store *storage.SQLiteStore, userID int64, substr string) storage.Topic
- func MockEmbeddingResponse() *openrouter.EmbeddingResponse
- func ParseMetricValue(metrics, metricName string) (string, map[string]string, error)
- func ProcessSessionForTest(t *testing.T, ctx context.Context, userID int64, store *storage.SQLiteStore) int64
- func Ptr[T any](v T) *T
- func SetupDefaultMocks(s *MockStorage)
- func TestAgentLog() storage.AgentLog
- func TestConfig() *config.Config
- func TestConfigWithRAGDisabled() *config.Config
- func TestDashboardStats() *storage.DashboardStats
- func TestEmbedding() []float32
- func TestFacts() []storage.Fact
- func TestFileProcessor(t *testing.T, downloader *MockFileDownloader, translator *i18n.Translator) *files.Processor
- func TestLogger() *slog.Logger
- func TestMessage() storage.Message
- func TestMessages() []storage.Message
- func TestPeople() []storage.Person
- func TestProfileFacts() []storage.Fact
- func TestStat() storage.Stat
- func TestTopic() storage.Topic
- func TestTopics() []storage.Topic
- func TestTranslator(t *testing.T) *i18n.Translator
- func TestUser() storage.User
- func TestUsers() []storage.User
- type LogCapture
- func (lc *LogCapture) Clear()
- func (lc *LogCapture) Entries() []LogEntry
- func (lc *LogCapture) Find(level string, msgSubstring string) []LogEntry
- func (lc *LogCapture) FindByField(key string, value interface{}) []LogEntry
- func (lc *LogCapture) Handler() *slog.JSONHandler
- func (lc *LogCapture) HasError() bool
- func (lc *LogCapture) Logger() *slog.Logger
- func (lc *LogCapture) MultiWriter(w io.Writer) io.Writer
- func (lc *LogCapture) ParseJSON(p []byte) LogEntry
- func (lc *LogCapture) Sync() error
- func (lc *LogCapture) Write(p []byte) (n int, err error)
- type LogEntry
- type MetricsHelper
- type MockBotAPI
- func (m *MockBotAPI) GetFile(ctx context.Context, req telegram.GetFileRequest) (*telegram.File, error)
- func (m *MockBotAPI) GetToken() string
- func (m *MockBotAPI) GetUpdates(ctx context.Context, req telegram.GetUpdatesRequest) ([]telegram.Update, error)
- func (m *MockBotAPI) SendChatAction(ctx context.Context, req telegram.SendChatActionRequest) error
- func (m *MockBotAPI) SendMessage(ctx context.Context, req telegram.SendMessageRequest) (*telegram.Message, error)
- func (m *MockBotAPI) SetMessageReaction(ctx context.Context, req telegram.SetMessageReactionRequest) error
- func (m *MockBotAPI) SetMyCommands(ctx context.Context, req telegram.SetMyCommandsRequest) error
- func (m *MockBotAPI) SetWebhook(ctx context.Context, req telegram.SetWebhookRequest) error
- type MockFileDownloader
- type MockOpenRouterClient
- type MockStorage
- func (m *MockStorage) AddAgentLog(log storage.AgentLog) error
- func (m *MockStorage) AddFact(fact storage.Fact) (int64, error)
- func (m *MockStorage) AddFactHistory(history storage.FactHistory) error
- func (m *MockStorage) AddMessageToHistory(userID int64, message storage.Message) error
- func (m *MockStorage) AddPerson(person storage.Person) (int64, error)
- func (m *MockStorage) AddStat(stat storage.Stat) error
- func (m *MockStorage) AddTopic(topic storage.Topic) (int64, error)
- func (m *MockStorage) AddTopicWithoutMessageUpdate(topic storage.Topic) (int64, error)
- func (m *MockStorage) Checkpoint() error
- func (m *MockStorage) CleanupAgentLogs(keepPerUserPerAgent int) (int64, error)
- func (m *MockStorage) CleanupFactHistory(keepPerUser int) (int64, error)
- func (m *MockStorage) ClearHistory(userID int64) error
- func (m *MockStorage) CountAgentLogs() (int64, error)
- func (m *MockStorage) CountContaminatedTopics(userID int64) (int, error)
- func (m *MockStorage) CountFactHistory() (int64, error)
- func (m *MockStorage) CountFactsOnOrphanedTopics(userID int64) (int, error)
- func (m *MockStorage) CountOrphanedTopics(userID int64) (int, error)
- func (m *MockStorage) CountOverlappingTopics(userID int64) (int, error)
- func (m *MockStorage) CountPeopleWithoutEmbedding(userID int64) (int, error)
- func (m *MockStorage) CreateTopic(topic storage.Topic) (int64, error)
- func (m *MockStorage) DeleteFact(userID, id int64) error
- func (m *MockStorage) DeletePerson(userID, personID int64) error
- func (m *MockStorage) DeleteTopic(id int64) error
- func (m *MockStorage) DeleteTopicCascade(id int64) error
- func (m *MockStorage) FindPersonByAlias(userID int64, alias string) ([]storage.Person, error)
- func (m *MockStorage) FindPersonByName(userID int64, name string) (*storage.Person, error)
- func (m *MockStorage) FindPersonByTelegramID(userID, telegramID int64) (*storage.Person, error)
- func (m *MockStorage) FindPersonByUsername(userID int64, username string) (*storage.Person, error)
- func (m *MockStorage) FixContaminatedTopics(userID int64) (int64, error)
- func (m *MockStorage) GetAgentLogs(agentType string, userID int64, limit int) ([]storage.AgentLog, error)
- func (m *MockStorage) GetAgentLogsExtended(filter storage.AgentLogFilter, limit, offset int) (storage.AgentLogResult, error)
- func (m *MockStorage) GetAllFacts() ([]storage.Fact, error)
- func (m *MockStorage) GetAllPeople() ([]storage.Person, error)
- func (m *MockStorage) GetAllTopics() ([]storage.Topic, error)
- func (m *MockStorage) GetAllUsers() ([]storage.User, error)
- func (m *MockStorage) GetContaminatedTopics(userID int64) ([]storage.ContaminatedTopic, error)
- func (m *MockStorage) GetDBSize() (int64, error)
- func (m *MockStorage) GetDashboardStats(userID int64) (*storage.DashboardStats, error)
- func (m *MockStorage) GetFactHistory(userID int64, limit int) ([]storage.FactHistory, error)
- func (m *MockStorage) GetFactHistoryExtended(filter storage.FactHistoryFilter, limit, offset int, sortBy, sortDir string) (storage.FactHistoryResult, error)
- func (m *MockStorage) GetFactStats() (storage.FactStats, error)
- func (m *MockStorage) GetFactStatsByUser(userID int64) (storage.FactStats, error)
- func (m *MockStorage) GetFacts(userID int64) ([]storage.Fact, error)
- func (m *MockStorage) GetFactsAfterID(minID int64) ([]storage.Fact, error)
- func (m *MockStorage) GetFactsByIDs(ids []int64) ([]storage.Fact, error)
- func (m *MockStorage) GetFactsByTopicID(topicID int64) ([]storage.Fact, error)
- func (m *MockStorage) GetLastTopicEndMessageID(userID int64) (int64, error)
- func (m *MockStorage) GetMemoryBank(userID int64) (string, error)
- func (m *MockStorage) GetMergeCandidates(userID int64) ([]storage.MergeCandidate, error)
- func (m *MockStorage) GetMessagesByIDs(ids []int64) ([]storage.Message, error)
- func (m *MockStorage) GetMessagesByTopicID(ctx context.Context, topicID int64) ([]storage.Message, error)
- func (m *MockStorage) GetMessagesInRange(ctx context.Context, userID int64, startID, endID int64) ([]storage.Message, error)
- func (m *MockStorage) GetOrphanedTopicIDs(userID int64) ([]int64, error)
- func (m *MockStorage) GetOverlappingTopics(userID int64) ([]storage.OverlappingPair, error)
- func (m *MockStorage) GetPeople(userID int64) ([]storage.Person, error)
- func (m *MockStorage) GetPeopleAfterID(minID int64) ([]storage.Person, error)
- func (m *MockStorage) GetPeopleByIDs(ids []int64) ([]storage.Person, error)
- func (m *MockStorage) GetPeopleExtended(filter storage.PersonFilter, limit, offset int, sortBy, sortDir string) (storage.PersonResult, error)
- func (m *MockStorage) GetPeopleWithoutEmbedding(userID int64) ([]storage.Person, error)
- func (m *MockStorage) GetPerson(userID, personID int64) (*storage.Person, error)
- func (m *MockStorage) GetRecentHistory(userID int64, limit int) ([]storage.Message, error)
- func (m *MockStorage) GetStats() (map[int64]storage.Stat, error)
- func (m *MockStorage) GetTableSizes() ([]storage.TableSize, error)
- func (m *MockStorage) GetTopics(userID int64) ([]storage.Topic, error)
- func (m *MockStorage) GetTopicsAfterID(minID int64) ([]storage.Topic, error)
- func (m *MockStorage) GetTopicsByIDs(ids []int64) ([]storage.Topic, error)
- func (m *MockStorage) GetTopicsExtended(filter storage.TopicFilter, limit, offset int, sortBy, sortDir string) (storage.TopicResult, error)
- func (m *MockStorage) GetTopicsPendingFacts(userID int64) ([]storage.Topic, error)
- func (m *MockStorage) GetUnprocessedMessages(userID int64) ([]storage.Message, error)
- func (m *MockStorage) ImportMessage(userID int64, message storage.Message) error
- func (m *MockStorage) MergePeople(userID, targetID, sourceID int64, newBio string, newAliases []string) error
- func (m *MockStorage) RecalculateTopicRanges(userID int64) (int, error)
- func (m *MockStorage) RecalculateTopicSizes(userID int64) (int, error)
- func (m *MockStorage) ResetUserData(userID int64) error
- func (m *MockStorage) SetTopicConsolidationChecked(topicID int64, checked bool) error
- func (m *MockStorage) SetTopicFactsExtracted(topicID int64, extracted bool) error
- func (m *MockStorage) UpdateFact(fact storage.Fact) error
- func (m *MockStorage) UpdateFactHistoryTopic(oldTopicID, newTopicID int64) error
- func (m *MockStorage) UpdateFactTopic(oldTopicID, newTopicID int64) error
- func (m *MockStorage) UpdateMemoryBank(userID int64, content string) error
- func (m *MockStorage) UpdateMessageTopic(messageID, topicID int64) error
- func (m *MockStorage) UpdateMessagesTopicInRange(ctx context.Context, userID, startMsgID, endMsgID, topicID int64) error
- func (m *MockStorage) UpdatePerson(person storage.Person) error
- func (m *MockStorage) UpsertUser(user storage.User) error
- type MockVectorSearcher
- type MockYandexClient
Constants ¶
const TestUserID int64 = 123
TestUserID is the default user ID for tests.
Variables ¶
This section is empty.
Functions ¶
func AssertFactContains ¶ added in v0.5.3
AssertFactContains asserts that a fact containing the given content exists.
func AssertFactCount ¶ added in v0.5.3
AssertFactCount asserts the number of facts for a user.
func AssertFactExists ¶ added in v0.5.3
func AssertFactExists(t *testing.T, store *storage.SQLiteStore, userID int64, substr string) storage.Fact
AssertFactExists asserts that a fact containing the substring exists for the user. Returns the matching fact for further inspection.
func AssertLogContains ¶ added in v0.5.3
AssertLogContains asserts that the log contains an entry with the given level and message.
func AssertLogHasField ¶ added in v0.5.3
AssertLogHasField asserts that a log entry exists with the given field value.
func AssertMessageCount ¶ added in v0.5.3
AssertMessageCount asserts the number of messages for a user.
func AssertMessageExists ¶ added in v0.5.3
func AssertMessageExists(t *testing.T, store *storage.SQLiteStore, userID int64, substr string) storage.Message
AssertMessageExists asserts that a message containing the substring exists for the user.
func AssertMetricExists ¶ added in v0.5.3
AssertMetricExists asserts that a metric exists in the metrics output.
func AssertMetricGreaterThan ¶ added in v0.5.3
AssertMetricGreaterThan asserts that a metric value is greater than a threshold.
func AssertMetricIncremented ¶ added in v0.5.3
AssertMetricIncremented asserts that a metric value increased between two scrapes. Useful for testing that a metric is incremented during an operation.
func AssertMetricValue ¶ added in v0.5.3
func AssertMetricValue(t *testing.T, metrics, metricName, expectedValue string, expectedLabels map[string]string)
AssertMetricValue asserts that a metric has a specific value (with optional label matching).
func AssertNoErrorLogs ¶ added in v0.5.3
AssertNoErrorLogs asserts that no ERROR level logs were captured.
func AssertPersonCount ¶ added in v0.5.3
AssertPersonCount asserts the number of people for a user.
func AssertPersonExists ¶ added in v0.5.3
func AssertPersonExists(t *testing.T, store *storage.SQLiteStore, userID int64, name string) storage.Person
AssertPersonExists asserts that a person with the given name exists for the user. Returns the matching person for further inspection.
func AssertPersonHasAlias ¶ added in v0.5.3
func AssertPersonHasAlias(t *testing.T, store *storage.SQLiteStore, userID int64, personName string, alias string)
AssertPersonHasAlias asserts that a person has a specific alias.
func AssertTopicCount ¶ added in v0.5.3
AssertTopicCount asserts the number of topics for a user.
func AssertTopicExists ¶ added in v0.5.3
func AssertTopicExists(t *testing.T, store *storage.SQLiteStore, userID int64, substr string) storage.Topic
AssertTopicExists asserts that a topic containing the substring exists for the user. Returns the matching topic for further inspection.
func MockEmbeddingResponse ¶ added in v0.5.2
func MockEmbeddingResponse() *openrouter.EmbeddingResponse
MockEmbeddingResponse returns a mock embedding response for tests.
func ParseMetricValue ¶ added in v0.5.3
ParseMetricValue parses a single metric value from the metrics output. Returns the value and labels (if any) for the first matching metric.
func ProcessSessionForTest ¶ added in v0.5.3
func ProcessSessionForTest(t *testing.T, ctx context.Context, userID int64, store *storage.SQLiteStore) int64
ProcessSessionForTest processes the active session for testing purposes. This forces topic creation without waiting for timeout, but does NOT extract facts. For fact extraction, use the memory service or testbot with --process-session flag.
func Ptr ¶
func Ptr[T any](v T) *T
Ptr returns a pointer to the given value. Useful for optional fields.
func SetupDefaultMocks ¶
func SetupDefaultMocks(s *MockStorage)
SetupDefaultMocks configures mocks with safe defaults for background operations. Call this when testing code that may trigger background loops.
func TestAgentLog ¶
TestAgentLog returns a sample agent log for testing.
func TestConfig ¶
TestConfig returns a config with sensible test defaults.
func TestConfigWithRAGDisabled ¶
TestConfigWithRAGDisabled returns a test config with RAG disabled.
func TestDashboardStats ¶
func TestDashboardStats() *storage.DashboardStats
TestDashboardStats returns sample dashboard stats for testing.
func TestEmbedding ¶
func TestEmbedding() []float32
TestEmbedding returns a sample embedding vector for testing.
func TestFileProcessor ¶
func TestFileProcessor(t *testing.T, downloader *MockFileDownloader, translator *i18n.Translator) *files.Processor
TestFileProcessor creates a file processor for tests.
func TestMessage ¶
TestMessage returns a sample message for testing.
func TestMessages ¶
TestMessages returns a conversation history for testing.
func TestPeople ¶ added in v0.5.3
TestPeople returns sample people for testing.
func TestProfileFacts ¶
TestProfileFacts returns facts that would be included in a user profile.
func TestTopics ¶
TestTopics returns multiple sample topics for testing.
func TestTranslator ¶
func TestTranslator(t *testing.T) *i18n.Translator
TestTranslator creates a translator with minimal translations for tests. Use t.TempDir() automatically cleaned up after test.
Types ¶
type LogCapture ¶ added in v0.5.3
type LogCapture struct {
// contains filtered or unexported fields
}
LogCapture captures slog JSON output for testing.
func NewLogCapture ¶ added in v0.5.3
func NewLogCapture() *LogCapture
NewLogCapture creates a new log capture.
func (*LogCapture) Clear ¶ added in v0.5.3
func (lc *LogCapture) Clear()
Clear removes all captured entries.
func (*LogCapture) Entries ¶ added in v0.5.3
func (lc *LogCapture) Entries() []LogEntry
Entries returns all captured log entries.
func (*LogCapture) Find ¶ added in v0.5.3
func (lc *LogCapture) Find(level string, msgSubstring string) []LogEntry
Find returns entries matching the specified level and message substring.
func (*LogCapture) FindByField ¶ added in v0.5.3
func (lc *LogCapture) FindByField(key string, value interface{}) []LogEntry
FindByField returns entries containing the specified field value.
func (*LogCapture) Handler ¶ added in v0.5.3
func (lc *LogCapture) Handler() *slog.JSONHandler
Handler returns the slog.Handler for this capture.
func (*LogCapture) HasError ¶ added in v0.5.3
func (lc *LogCapture) HasError() bool
HasError returns true if any ERROR level entries were captured.
func (*LogCapture) Logger ¶ added in v0.5.3
func (lc *LogCapture) Logger() *slog.Logger
Logger returns the slog.Logger that writes to this capture.
func (*LogCapture) MultiWriter ¶ added in v0.5.3
func (lc *LogCapture) MultiWriter(w io.Writer) io.Writer
MultiWriter creates an io.Writer that writes to both LogCapture and another writer. Useful for writing logs to both a capture and stdout/stderr.
func (*LogCapture) ParseJSON ¶ added in v0.5.3
func (lc *LogCapture) ParseJSON(p []byte) LogEntry
ParseJSON parses a JSON log line into a LogEntry.
func (*LogCapture) Sync ¶ added in v0.5.3
func (lc *LogCapture) Sync() error
Sync is a no-op for compatibility.
type LogEntry ¶ added in v0.5.3
type LogEntry struct {
Level string `json:"level"`
Message string `json:"msg"`
Time time.Time `json:"time"`
Fields map[string]interface{} `json:"-"`
}
LogEntry represents a parsed log entry.
type MetricsHelper ¶ added in v0.5.3
type MetricsHelper struct {
// contains filtered or unexported fields
}
MetricsHelper provides helper functions for testing Prometheus metrics.
func NewMetricsHelper ¶ added in v0.5.3
func NewMetricsHelper(host string, port int) *MetricsHelper
NewMetricsHelper creates a new metrics helper.
func (*MetricsHelper) GetMetricValue ¶ added in v0.5.3
GetMetricValue is a convenience function that scrapes and parses a metric value.
func (*MetricsHelper) ScrapeMetrics ¶ added in v0.5.3
func (mh *MetricsHelper) ScrapeMetrics() (string, error)
ScrapeMetrics scrapes metrics from the metrics endpoint.
type MockBotAPI ¶
MockBotAPI implements telegram.BotAPI for tests.
func (*MockBotAPI) GetFile ¶
func (m *MockBotAPI) GetFile(ctx context.Context, req telegram.GetFileRequest) (*telegram.File, error)
func (*MockBotAPI) GetToken ¶
func (m *MockBotAPI) GetToken() string
func (*MockBotAPI) GetUpdates ¶
func (m *MockBotAPI) GetUpdates(ctx context.Context, req telegram.GetUpdatesRequest) ([]telegram.Update, error)
func (*MockBotAPI) SendChatAction ¶
func (m *MockBotAPI) SendChatAction(ctx context.Context, req telegram.SendChatActionRequest) error
func (*MockBotAPI) SendMessage ¶
func (m *MockBotAPI) SendMessage(ctx context.Context, req telegram.SendMessageRequest) (*telegram.Message, error)
func (*MockBotAPI) SetMessageReaction ¶
func (m *MockBotAPI) SetMessageReaction(ctx context.Context, req telegram.SetMessageReactionRequest) error
func (*MockBotAPI) SetMyCommands ¶
func (m *MockBotAPI) SetMyCommands(ctx context.Context, req telegram.SetMyCommandsRequest) error
func (*MockBotAPI) SetWebhook ¶
func (m *MockBotAPI) SetWebhook(ctx context.Context, req telegram.SetWebhookRequest) error
type MockFileDownloader ¶
MockFileDownloader implements telegram.FileDownloader for tests.
func (*MockFileDownloader) DownloadFile ¶
func (*MockFileDownloader) DownloadFileAsBase64 ¶
type MockOpenRouterClient ¶
MockOpenRouterClient implements openrouter.Client for tests.
func (*MockOpenRouterClient) CreateChatCompletion ¶
func (m *MockOpenRouterClient) CreateChatCompletion(ctx context.Context, req openrouter.ChatCompletionRequest) (openrouter.ChatCompletionResponse, error)
func (*MockOpenRouterClient) CreateEmbeddings ¶
func (m *MockOpenRouterClient) CreateEmbeddings(ctx context.Context, req openrouter.EmbeddingRequest) (openrouter.EmbeddingResponse, error)
type MockStorage ¶
MockStorage implements all storage repository interfaces for tests. This is a composite mock that covers MessageRepository, UserRepository, TopicRepository, FactRepository, FactHistoryRepository, StatsRepository, MemoryBankRepository, MaintenanceRepository, and AgentLogRepository.
func (*MockStorage) AddAgentLog ¶
func (m *MockStorage) AddAgentLog(log storage.AgentLog) error
func (*MockStorage) AddFactHistory ¶
func (m *MockStorage) AddFactHistory(history storage.FactHistory) error
func (*MockStorage) AddMessageToHistory ¶
func (m *MockStorage) AddMessageToHistory(userID int64, message storage.Message) error
func (*MockStorage) AddPerson ¶ added in v0.5.1
func (m *MockStorage) AddPerson(person storage.Person) (int64, error)
func (*MockStorage) AddTopicWithoutMessageUpdate ¶
func (m *MockStorage) AddTopicWithoutMessageUpdate(topic storage.Topic) (int64, error)
func (*MockStorage) Checkpoint ¶
func (m *MockStorage) Checkpoint() error
func (*MockStorage) CleanupAgentLogs ¶
func (m *MockStorage) CleanupAgentLogs(keepPerUserPerAgent int) (int64, error)
func (*MockStorage) CleanupFactHistory ¶
func (m *MockStorage) CleanupFactHistory(keepPerUser int) (int64, error)
func (*MockStorage) ClearHistory ¶
func (m *MockStorage) ClearHistory(userID int64) error
func (*MockStorage) CountAgentLogs ¶
func (m *MockStorage) CountAgentLogs() (int64, error)
func (*MockStorage) CountContaminatedTopics ¶
func (m *MockStorage) CountContaminatedTopics(userID int64) (int, error)
func (*MockStorage) CountFactHistory ¶
func (m *MockStorage) CountFactHistory() (int64, error)
func (*MockStorage) CountFactsOnOrphanedTopics ¶
func (m *MockStorage) CountFactsOnOrphanedTopics(userID int64) (int, error)
func (*MockStorage) CountOrphanedTopics ¶
func (m *MockStorage) CountOrphanedTopics(userID int64) (int, error)
func (*MockStorage) CountOverlappingTopics ¶
func (m *MockStorage) CountOverlappingTopics(userID int64) (int, error)
func (*MockStorage) CountPeopleWithoutEmbedding ¶ added in v0.5.1
func (m *MockStorage) CountPeopleWithoutEmbedding(userID int64) (int, error)
func (*MockStorage) CreateTopic ¶
func (m *MockStorage) CreateTopic(topic storage.Topic) (int64, error)
func (*MockStorage) DeleteFact ¶
func (m *MockStorage) DeleteFact(userID, id int64) error
func (*MockStorage) DeletePerson ¶ added in v0.5.1
func (m *MockStorage) DeletePerson(userID, personID int64) error
func (*MockStorage) DeleteTopic ¶
func (m *MockStorage) DeleteTopic(id int64) error
func (*MockStorage) DeleteTopicCascade ¶
func (m *MockStorage) DeleteTopicCascade(id int64) error
func (*MockStorage) FindPersonByAlias ¶ added in v0.5.1
func (*MockStorage) FindPersonByName ¶ added in v0.5.1
func (*MockStorage) FindPersonByTelegramID ¶ added in v0.5.1
func (m *MockStorage) FindPersonByTelegramID(userID, telegramID int64) (*storage.Person, error)
func (*MockStorage) FindPersonByUsername ¶ added in v0.5.1
func (*MockStorage) FixContaminatedTopics ¶
func (m *MockStorage) FixContaminatedTopics(userID int64) (int64, error)
func (*MockStorage) GetAgentLogs ¶
func (*MockStorage) GetAgentLogsExtended ¶
func (m *MockStorage) GetAgentLogsExtended(filter storage.AgentLogFilter, limit, offset int) (storage.AgentLogResult, error)
func (*MockStorage) GetAllFacts ¶
func (m *MockStorage) GetAllFacts() ([]storage.Fact, error)
func (*MockStorage) GetAllPeople ¶ added in v0.5.1
func (m *MockStorage) GetAllPeople() ([]storage.Person, error)
func (*MockStorage) GetAllTopics ¶
func (m *MockStorage) GetAllTopics() ([]storage.Topic, error)
func (*MockStorage) GetAllUsers ¶
func (m *MockStorage) GetAllUsers() ([]storage.User, error)
func (*MockStorage) GetContaminatedTopics ¶
func (m *MockStorage) GetContaminatedTopics(userID int64) ([]storage.ContaminatedTopic, error)
func (*MockStorage) GetDBSize ¶
func (m *MockStorage) GetDBSize() (int64, error)
func (*MockStorage) GetDashboardStats ¶
func (m *MockStorage) GetDashboardStats(userID int64) (*storage.DashboardStats, error)
func (*MockStorage) GetFactHistory ¶
func (m *MockStorage) GetFactHistory(userID int64, limit int) ([]storage.FactHistory, error)
func (*MockStorage) GetFactHistoryExtended ¶
func (m *MockStorage) GetFactHistoryExtended(filter storage.FactHistoryFilter, limit, offset int, sortBy, sortDir string) (storage.FactHistoryResult, error)
func (*MockStorage) GetFactStats ¶
func (m *MockStorage) GetFactStats() (storage.FactStats, error)
func (*MockStorage) GetFactStatsByUser ¶
func (m *MockStorage) GetFactStatsByUser(userID int64) (storage.FactStats, error)
func (*MockStorage) GetFactsAfterID ¶
func (m *MockStorage) GetFactsAfterID(minID int64) ([]storage.Fact, error)
func (*MockStorage) GetFactsByIDs ¶
func (m *MockStorage) GetFactsByIDs(ids []int64) ([]storage.Fact, error)
func (*MockStorage) GetFactsByTopicID ¶
func (m *MockStorage) GetFactsByTopicID(topicID int64) ([]storage.Fact, error)
func (*MockStorage) GetLastTopicEndMessageID ¶
func (m *MockStorage) GetLastTopicEndMessageID(userID int64) (int64, error)
func (*MockStorage) GetMemoryBank ¶
func (m *MockStorage) GetMemoryBank(userID int64) (string, error)
func (*MockStorage) GetMergeCandidates ¶
func (m *MockStorage) GetMergeCandidates(userID int64) ([]storage.MergeCandidate, error)
func (*MockStorage) GetMessagesByIDs ¶
func (m *MockStorage) GetMessagesByIDs(ids []int64) ([]storage.Message, error)
func (*MockStorage) GetMessagesByTopicID ¶
func (*MockStorage) GetMessagesInRange ¶
func (*MockStorage) GetOrphanedTopicIDs ¶
func (m *MockStorage) GetOrphanedTopicIDs(userID int64) ([]int64, error)
func (*MockStorage) GetOverlappingTopics ¶
func (m *MockStorage) GetOverlappingTopics(userID int64) ([]storage.OverlappingPair, error)
func (*MockStorage) GetPeople ¶ added in v0.5.1
func (m *MockStorage) GetPeople(userID int64) ([]storage.Person, error)
func (*MockStorage) GetPeopleAfterID ¶ added in v0.5.1
func (m *MockStorage) GetPeopleAfterID(minID int64) ([]storage.Person, error)
func (*MockStorage) GetPeopleByIDs ¶ added in v0.5.1
func (m *MockStorage) GetPeopleByIDs(ids []int64) ([]storage.Person, error)
func (*MockStorage) GetPeopleExtended ¶ added in v0.5.1
func (m *MockStorage) GetPeopleExtended(filter storage.PersonFilter, limit, offset int, sortBy, sortDir string) (storage.PersonResult, error)
func (*MockStorage) GetPeopleWithoutEmbedding ¶ added in v0.5.1
func (m *MockStorage) GetPeopleWithoutEmbedding(userID int64) ([]storage.Person, error)
func (*MockStorage) GetPerson ¶ added in v0.5.1
func (m *MockStorage) GetPerson(userID, personID int64) (*storage.Person, error)
func (*MockStorage) GetRecentHistory ¶
func (*MockStorage) GetTableSizes ¶
func (m *MockStorage) GetTableSizes() ([]storage.TableSize, error)
func (*MockStorage) GetTopics ¶
func (m *MockStorage) GetTopics(userID int64) ([]storage.Topic, error)
func (*MockStorage) GetTopicsAfterID ¶
func (m *MockStorage) GetTopicsAfterID(minID int64) ([]storage.Topic, error)
func (*MockStorage) GetTopicsByIDs ¶
func (m *MockStorage) GetTopicsByIDs(ids []int64) ([]storage.Topic, error)
func (*MockStorage) GetTopicsExtended ¶
func (m *MockStorage) GetTopicsExtended(filter storage.TopicFilter, limit, offset int, sortBy, sortDir string) (storage.TopicResult, error)
func (*MockStorage) GetTopicsPendingFacts ¶
func (m *MockStorage) GetTopicsPendingFacts(userID int64) ([]storage.Topic, error)
func (*MockStorage) GetUnprocessedMessages ¶
func (m *MockStorage) GetUnprocessedMessages(userID int64) ([]storage.Message, error)
func (*MockStorage) ImportMessage ¶
func (m *MockStorage) ImportMessage(userID int64, message storage.Message) error
func (*MockStorage) MergePeople ¶ added in v0.5.1
func (m *MockStorage) MergePeople(userID, targetID, sourceID int64, newBio string, newAliases []string) error
func (*MockStorage) RecalculateTopicRanges ¶
func (m *MockStorage) RecalculateTopicRanges(userID int64) (int, error)
func (*MockStorage) RecalculateTopicSizes ¶
func (m *MockStorage) RecalculateTopicSizes(userID int64) (int, error)
func (*MockStorage) ResetUserData ¶
func (m *MockStorage) ResetUserData(userID int64) error
func (*MockStorage) SetTopicConsolidationChecked ¶
func (m *MockStorage) SetTopicConsolidationChecked(topicID int64, checked bool) error
func (*MockStorage) SetTopicFactsExtracted ¶
func (m *MockStorage) SetTopicFactsExtracted(topicID int64, extracted bool) error
func (*MockStorage) UpdateFact ¶
func (m *MockStorage) UpdateFact(fact storage.Fact) error
func (*MockStorage) UpdateFactHistoryTopic ¶
func (m *MockStorage) UpdateFactHistoryTopic(oldTopicID, newTopicID int64) error
func (*MockStorage) UpdateFactTopic ¶
func (m *MockStorage) UpdateFactTopic(oldTopicID, newTopicID int64) error
func (*MockStorage) UpdateMemoryBank ¶
func (m *MockStorage) UpdateMemoryBank(userID int64, content string) error
func (*MockStorage) UpdateMessageTopic ¶
func (m *MockStorage) UpdateMessageTopic(messageID, topicID int64) error
func (*MockStorage) UpdateMessagesTopicInRange ¶
func (m *MockStorage) UpdateMessagesTopicInRange(ctx context.Context, userID, startMsgID, endMsgID, topicID int64) error
func (*MockStorage) UpdatePerson ¶ added in v0.5.1
func (m *MockStorage) UpdatePerson(person storage.Person) error
func (*MockStorage) UpsertUser ¶
func (m *MockStorage) UpsertUser(user storage.User) error
type MockVectorSearcher ¶
MockVectorSearcher implements rag.VectorSearcher for tests.