fake

package
v0.0.0-...-8f1971e Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient() database.Client

NewClient creates a new fake database client

Types

type InMemoryFakeClient

type InMemoryFakeClient struct {
	// contains filtered or unexported fields
}

InMemoryFakeClient is a fake implementation of database.Client for testing

func (*InMemoryFakeClient) AddTask

func (c *InMemoryFakeClient) AddTask(task *database.Task)

AddTask adds a task for testing purposes

func (*InMemoryFakeClient) AddTool

func (c *InMemoryFakeClient) AddTool(tool *database.Tool)

AddTool adds a tool for testing purposes

func (*InMemoryFakeClient) Clear

func (c *InMemoryFakeClient) Clear()

Clear clears all data for testing purposes

func (*InMemoryFakeClient) CreateTool

func (c *InMemoryFakeClient) CreateTool(_ context.Context, tool *database.Tool) error

CreateTool creates a new tool record

func (*InMemoryFakeClient) DeleteAgent

func (c *InMemoryFakeClient) DeleteAgent(_ context.Context, agentName string) error

DeleteAgent deletes an agent by name

func (*InMemoryFakeClient) DeleteAgentMemory

func (c *InMemoryFakeClient) DeleteAgentMemory(_ context.Context, agentName, userID string) error

DeleteAgentMemory deletes all agent memory for a given agent and user

func (*InMemoryFakeClient) DeleteCheckpoint

func (c *InMemoryFakeClient) DeleteCheckpoint(_ context.Context, userID, threadID string) error

DeleteCheckpoint deletes a checkpoint and its writes atomically

func (*InMemoryFakeClient) DeletePushNotification

func (c *InMemoryFakeClient) DeletePushNotification(_ context.Context, taskID string) error

func (*InMemoryFakeClient) DeleteSession

func (c *InMemoryFakeClient) DeleteSession(_ context.Context, sessionID string, userID string) error

DeleteSession deletes a session by ID and user ID

func (*InMemoryFakeClient) DeleteTask

func (c *InMemoryFakeClient) DeleteTask(_ context.Context, taskID string) error

func (*InMemoryFakeClient) DeleteToolServer

func (c *InMemoryFakeClient) DeleteToolServer(_ context.Context, serverName string, groupKind string) error

DeleteToolServer deletes a tool server by name

func (*InMemoryFakeClient) DeleteToolsForServer

func (c *InMemoryFakeClient) DeleteToolsForServer(_ context.Context, serverName string, groupKind string) error

DeleteToolsForServer deletes tools for a tool server by name

func (*InMemoryFakeClient) GetAgent

func (c *InMemoryFakeClient) GetAgent(_ context.Context, agentName string) (*database.Agent, error)

GetAgent retrieves an agent by name

func (*InMemoryFakeClient) GetCheckpoint

func (c *InMemoryFakeClient) GetCheckpoint(_ context.Context, userID, threadID, checkpointNS, checkpointID string) (*database.LangGraphCheckpoint, []*database.LangGraphCheckpointWrite, error)

GetCheckpoint retrieves a specific checkpoint by ID

func (*InMemoryFakeClient) GetCrewAIFlowState

func (c *InMemoryFakeClient) GetCrewAIFlowState(_ context.Context, userID, threadID string) (*database.CrewAIFlowState, error)

GetCrewAIFlowState retrieves CrewAI flow state

func (*InMemoryFakeClient) GetLatestCheckpoint

func (c *InMemoryFakeClient) GetLatestCheckpoint(_ context.Context, userID, threadID, checkpointNS string) (*database.LangGraphCheckpoint, []*database.LangGraphCheckpointWrite, error)

GetLatestCheckpoint retrieves the most recent checkpoint for a thread

func (*InMemoryFakeClient) GetPushNotification

func (c *InMemoryFakeClient) GetPushNotification(_ context.Context, taskID string, configID string) (*protocol.TaskPushNotificationConfig, error)

func (*InMemoryFakeClient) GetSession

func (c *InMemoryFakeClient) GetSession(_ context.Context, sessionID string, userID string) (*database.Session, error)

GetSession retrieves a session by ID and user ID

func (*InMemoryFakeClient) GetTask

func (c *InMemoryFakeClient) GetTask(_ context.Context, taskID string) (*protocol.Task, error)

func (*InMemoryFakeClient) GetTool

func (c *InMemoryFakeClient) GetTool(_ context.Context, toolName string) (*database.Tool, error)

GetTool retrieves a tool by name

func (*InMemoryFakeClient) GetToolServer

func (c *InMemoryFakeClient) GetToolServer(_ context.Context, serverName string) (*database.ToolServer, error)

GetToolServer retrieves a tool server by name

func (*InMemoryFakeClient) ListAgentMemories

func (c *InMemoryFakeClient) ListAgentMemories(_ context.Context, agentName, userID string) ([]database.Memory, error)

ListAgentMemories lists agent memories ordered by access count descending

func (*InMemoryFakeClient) ListAgents

func (c *InMemoryFakeClient) ListAgents(_ context.Context) ([]database.Agent, error)

ListAgents lists all agents

func (*InMemoryFakeClient) ListCheckpoints

func (c *InMemoryFakeClient) ListCheckpoints(_ context.Context, userID, threadID, checkpointNS string, checkpointID *string, limit int) ([]*database.LangGraphCheckpointTuple, error)

ListCheckpoints lists checkpoints for a thread, optionally filtered by checkpointID

func (*InMemoryFakeClient) ListEventsForSession

func (c *InMemoryFakeClient) ListEventsForSession(_ context.Context, sessionID, userID string, options database.QueryOptions) ([]*database.Event, error)

ListEventsForSession retrieves events for a specific session

func (*InMemoryFakeClient) ListFeedback

func (c *InMemoryFakeClient) ListFeedback(_ context.Context, userID string) ([]database.Feedback, error)

ListFeedback lists all feedback for a user

func (*InMemoryFakeClient) ListPushNotifications

func (c *InMemoryFakeClient) ListPushNotifications(_ context.Context, taskID string) ([]*protocol.TaskPushNotificationConfig, error)

func (*InMemoryFakeClient) ListSessions

func (c *InMemoryFakeClient) ListSessions(_ context.Context, userID string) ([]database.Session, error)

ListSessions lists all sessions for a user

func (*InMemoryFakeClient) ListSessionsForAgent

func (c *InMemoryFakeClient) ListSessionsForAgent(_ context.Context, agentID string, userID string) ([]database.Session, error)

ListSessionsForAgent lists all sessions for an agent, excluding agent-initiated sessions.

func (*InMemoryFakeClient) ListTasksForSession

func (c *InMemoryFakeClient) ListTasksForSession(_ context.Context, sessionID string) ([]*protocol.Task, error)

func (*InMemoryFakeClient) ListToolServers

func (c *InMemoryFakeClient) ListToolServers(_ context.Context) ([]database.ToolServer, error)

ListToolServers lists all tool servers

func (*InMemoryFakeClient) ListTools

func (c *InMemoryFakeClient) ListTools(_ context.Context) ([]database.Tool, error)

ListTools lists all tools for a user

func (*InMemoryFakeClient) ListToolsForServer

func (c *InMemoryFakeClient) ListToolsForServer(_ context.Context, serverName string, groupKind string) ([]database.Tool, error)

ListToolsForServer lists all tools for a specific server and toolserver type

func (*InMemoryFakeClient) ListWrites

func (c *InMemoryFakeClient) ListWrites(_ context.Context, userID, threadID, checkpointNS, checkpointID string, offset, limit int) ([]*database.LangGraphCheckpointWrite, error)

ListWrites retrieves writes for a specific checkpoint

func (*InMemoryFakeClient) PruneExpiredMemories

func (c *InMemoryFakeClient) PruneExpiredMemories(_ context.Context) error

PruneExpiredMemories removes all memories whose ExpiresAt is in the past

func (*InMemoryFakeClient) RefreshToolsForServer

func (c *InMemoryFakeClient) RefreshToolsForServer(_ context.Context, serverName string, groupKind string, tools ...*v1alpha2.MCPTool) error

RefreshToolsForServer refreshes a tool server

func (*InMemoryFakeClient) ResetCrewAIMemory

func (c *InMemoryFakeClient) ResetCrewAIMemory(_ context.Context, userID, threadID string) error

ResetCrewAIMemory deletes all CrewAI agent memory for a session

func (*InMemoryFakeClient) SearchAgentMemory

func (c *InMemoryFakeClient) SearchAgentMemory(_ context.Context, agentName, userID string, embedding pgvector.Vector, limit int) ([]database.AgentMemorySearchResult, error)

SearchAgentMemory searches agent memory by vector similarity

func (*InMemoryFakeClient) SearchCrewAIMemoryByTask

func (c *InMemoryFakeClient) SearchCrewAIMemoryByTask(_ context.Context, userID, threadID, taskDescription string, limit int) ([]*database.CrewAIAgentMemory, error)

SearchCrewAIMemoryByTask searches CrewAI agent memory by task description across all agents for a session

func (*InMemoryFakeClient) StoreAgent

func (c *InMemoryFakeClient) StoreAgent(_ context.Context, agent *database.Agent) error

StoreAgent creates a new agent record

func (*InMemoryFakeClient) StoreAgentMemories

func (c *InMemoryFakeClient) StoreAgentMemories(_ context.Context, memories []*database.Memory) error

StoreAgentMemories stores multiple agent memories

func (*InMemoryFakeClient) StoreAgentMemory

func (c *InMemoryFakeClient) StoreAgentMemory(_ context.Context, memory *database.Memory) error

StoreAgentMemory stores agent memory

func (*InMemoryFakeClient) StoreCheckpoint

func (c *InMemoryFakeClient) StoreCheckpoint(_ context.Context, checkpoint *database.LangGraphCheckpoint) error

StoreCheckpoint stores a LangGraph checkpoint

func (*InMemoryFakeClient) StoreCheckpointWrites

func (c *InMemoryFakeClient) StoreCheckpointWrites(_ context.Context, writes []*database.LangGraphCheckpointWrite) error

StoreCheckpointWrites stores checkpoint writes

func (*InMemoryFakeClient) StoreCrewAIFlowState

func (c *InMemoryFakeClient) StoreCrewAIFlowState(_ context.Context, state *database.CrewAIFlowState) error

StoreCrewAIFlowState stores CrewAI flow state

func (*InMemoryFakeClient) StoreCrewAIMemory

func (c *InMemoryFakeClient) StoreCrewAIMemory(_ context.Context, memory *database.CrewAIAgentMemory) error

StoreCrewAIMemory stores CrewAI agent memory

func (*InMemoryFakeClient) StoreEvents

func (c *InMemoryFakeClient) StoreEvents(_ context.Context, events ...*database.Event) error

StoreEvents creates a new event record

func (*InMemoryFakeClient) StoreFeedback

func (c *InMemoryFakeClient) StoreFeedback(_ context.Context, feedback *database.Feedback) error

StoreFeedback creates a new feedback record

func (*InMemoryFakeClient) StorePushNotification

func (c *InMemoryFakeClient) StorePushNotification(_ context.Context, config *protocol.TaskPushNotificationConfig) error

StorePushNotification creates a new push notification record

func (*InMemoryFakeClient) StoreSession

func (c *InMemoryFakeClient) StoreSession(_ context.Context, session *database.Session) error

StoreSession creates a new session record

func (*InMemoryFakeClient) StoreTask

func (c *InMemoryFakeClient) StoreTask(_ context.Context, task *protocol.Task) error

StoreTask creates a new task record

func (*InMemoryFakeClient) StoreToolServer

func (c *InMemoryFakeClient) StoreToolServer(_ context.Context, toolServer *database.ToolServer) (*database.ToolServer, error)

StoreToolServer creates a new tool server record

func (*InMemoryFakeClient) UpdateAgent

func (c *InMemoryFakeClient) UpdateAgent(_ context.Context, agent *database.Agent) error

UpdateAgent updates an agent record

func (*InMemoryFakeClient) UpdateSession

func (c *InMemoryFakeClient) UpdateSession(_ context.Context, session *database.Session) error

UpdateSession updates a session

func (*InMemoryFakeClient) UpdateTask

func (c *InMemoryFakeClient) UpdateTask(_ context.Context, task *database.Task) error

UpdateTask updates a task record

func (*InMemoryFakeClient) UpdateToolServer

func (c *InMemoryFakeClient) UpdateToolServer(_ context.Context, server *database.ToolServer) error

UpdateToolServer updates a tool server

func (*InMemoryFakeClient) UpsertAgent

func (c *InMemoryFakeClient) UpsertAgent(_ context.Context, agent *database.Agent) error

UpsertAgent upserts an agent record

Jump to

Keyboard shortcuts

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