Documentation
¶
Overview ¶
Package mock provides test-only in-memory implementations for unit tests. It must not be imported by production code.
Index ¶
- type DenyQuotaTeamStore
- func (d *DenyQuotaTeamStore) AddTeamMember(_ context.Context, _, _, _ string) (*coreteam.Member, error)
- func (d *DenyQuotaTeamStore) CountTeamMembers(_ context.Context, _ []string) (map[string]int, error)
- func (d *DenyQuotaTeamStore) CreateTeam(_ context.Context, _, _, _ string) (*coreteam.Team, error)
- func (d *DenyQuotaTeamStore) GetPersonalTeamByUser(_ context.Context, _ string) (*coreteam.Team, error)
- func (d *DenyQuotaTeamStore) GetTeam(_ context.Context, _ string) (*coreteam.Team, error)
- func (d *DenyQuotaTeamStore) ListAllTeams(_ context.Context, _ string, _, _ int) ([]coreteam.Team, int, error)
- func (d *DenyQuotaTeamStore) ListTeamMembers(_ context.Context, _ string) ([]coreteam.Member, error)
- func (d *DenyQuotaTeamStore) ListTeamsByUser(_ context.Context, _ string) ([]coreteam.Team, error)
- func (d *DenyQuotaTeamStore) RemoveTeamMember(_ context.Context, _, _ string) error
- func (d *DenyQuotaTeamStore) SetTeamPluginCuration(_ context.Context, _ string, _ coreplugin.Curation) error
- type DenyQuotaTierStore
- type DenyQuotaUsageReader
- type MockAgentStore
- func (m *MockAgentStore) CreateAgentInTeam(_ context.Context, in agentdef.CreateInput) (*agentdef.Agent, error)
- func (m *MockAgentStore) DeleteAgent(_ context.Context, agentID, userID string) error
- func (m *MockAgentStore) DeleteAgentInTeam(_ context.Context, agentID, teamID string) error
- func (m *MockAgentStore) GetAgent(_ context.Context, agentID string) (*agentdef.Agent, error)
- func (m *MockAgentStore) GetAgentIncludingDeleted(_ context.Context, agentID string) (*agentdef.Agent, error)
- func (m *MockAgentStore) GetAgentRevision(_ context.Context, agentID string, revision int) (*agentdef.Revision, error)
- func (m *MockAgentStore) ListAgentRevisions(_ context.Context, agentID string, limit, offset int) ([]agentdef.Revision, int, error)
- func (m *MockAgentStore) ListAgentsByTeam(_ context.Context, teamID string) ([]agentdef.Agent, error)
- func (m *MockAgentStore) ListAgentsByUser(_ context.Context, userID string) ([]agentdef.Agent, error)
- func (m *MockAgentStore) UpdateAgentInTeam(_ context.Context, in agentdef.UpdateInput) (*agentdef.Agent, error)
- type MockArtifactStorage
- func (m *MockArtifactStorage) ObjectCount() int
- func (m *MockArtifactStorage) OpenArtifact(_ context.Context, ref coreartifact.Ref) (io.ReadCloser, error)
- func (m *MockArtifactStorage) PutArtifact(_ context.Context, ref coreartifact.Ref, r io.Reader) (string, error)
- func (m *MockArtifactStorage) RemoveArtifact(_ context.Context, ref coreartifact.Ref) error
- type MockArtifactStore
- func (m *MockArtifactStore) Count() int
- func (m *MockArtifactStore) CreateArtifact(_ context.Context, in coreartifact.CreateInput) (*coreartifact.Artifact, error)
- func (m *MockArtifactStore) GetArtifact(_ context.Context, artifactID string) (*coreartifact.Artifact, error)
- func (m *MockArtifactStore) ListArtifactsBySource(_ context.Context, sourceIDs []string) (map[string][]coreartifact.Artifact, error)
- func (m *MockArtifactStore) ListArtifactsByTeam(_ context.Context, teamID string, limit, offset int) ([]coreartifact.Artifact, int, error)
- func (m *MockArtifactStore) SoftDeleteArtifact(_ context.Context, artifactID string, deletedAt time.Time) (bool, error)
- type MockAuditStore
- func (m *MockAuditStore) ExportAuditEvents(_ context.Context, filter coreaudit.Filter, after coreaudit.Cursor, limit int) ([]coreaudit.Event, error)
- func (m *MockAuditStore) ExportTeamAuditEvents(_ context.Context, teamID string, after coreaudit.Cursor, limit int) ([]coreaudit.Event, error)
- func (m *MockAuditStore) ListAuditEvents(_ context.Context, teamID string, limit, offset int) ([]coreaudit.Event, int, error)
- func (m *MockAuditStore) OldestAuditEventAt(_ context.Context) (time.Time, error)
- func (m *MockAuditStore) PruneAuditEvents(_ context.Context, before time.Time, limit int) (int64, error)
- func (m *MockAuditStore) RecordAuditEvent(_ context.Context, in coreaudit.Event) error
- func (m *MockAuditStore) SearchAuditEvents(_ context.Context, filter coreaudit.Filter, limit, offset int) ([]coreaudit.Event, int, error)
- type MockConversationMessageStore
- func (m *MockConversationMessageStore) AppendMessage(_ context.Context, in coreconv.AppendInput) (*coreconv.Message, error)
- func (m *MockConversationMessageStore) GetMessage(_ context.Context, messageID string) (*coreconv.Message, error)
- func (m *MockConversationMessageStore) ListMessages(_ context.Context, conversationID string) ([]coreconv.Message, error)
- type MockConversationStore
- func (m *MockConversationStore) CreateConversation(_ context.Context, userID, channel, createdBy string) (*coreconv.Conversation, error)
- func (m *MockConversationStore) CreateConversationInTeam(_ context.Context, teamID, userID, channel, createdBy string) (*coreconv.Conversation, error)
- func (m *MockConversationStore) GetConversation(_ context.Context, conversationID string) (*coreconv.Conversation, error)
- func (m *MockConversationStore) ListConversationsByTeam(_ context.Context, teamID string, limit, offset int) ([]coreconv.Conversation, int, error)
- func (m *MockConversationStore) ListConversationsByUser(_ context.Context, userID string, limit, offset int) ([]coreconv.Conversation, int, error)
- func (m *MockConversationStore) UpdateConversationTitle(_ context.Context, conversationID, title string) error
- type MockIssueCommentStore
- func (m *MockIssueCommentStore) CountIssueComments(_ context.Context, issueIDs []string) (map[string]int, error)
- func (m *MockIssueCommentStore) CreateIssueComment(_ context.Context, in coreissue.CreateCommentInput) (*coreissue.Comment, error)
- func (m *MockIssueCommentStore) DeleteIssueComment(_ context.Context, commentID string) error
- func (m *MockIssueCommentStore) GetIssueComment(_ context.Context, commentID string) (*coreissue.Comment, error)
- func (m *MockIssueCommentStore) ListIssueComments(_ context.Context, issueID string, limit, offset int) ([]coreissue.Comment, int, error)
- func (m *MockIssueCommentStore) UpdateIssueComment(_ context.Context, commentID, body string) (*coreissue.Comment, error)
- type MockIssueStore
- func (m *MockIssueStore) ChildStatsForIssues(_ context.Context, issueIDs []string) (map[string]coreissue.ChildStats, error)
- func (m *MockIssueStore) CreateIssue(_ context.Context, userID string, in coreissue.CreateInput) (*coreissue.Issue, error)
- func (m *MockIssueStore) CreateIssueInTeam(_ context.Context, teamID, createdBy string, in coreissue.CreateInput) (*coreissue.Issue, error)
- func (m *MockIssueStore) GetIssue(_ context.Context, issueID string) (*coreissue.Issue, error)
- func (m *MockIssueStore) ListIssueChildren(_ context.Context, parentIssueID string) ([]coreissue.Issue, error)
- func (m *MockIssueStore) ListIssuesByTeam(_ context.Context, teamID string, filter coreissue.ListFilter, ...) ([]coreissue.Issue, int, error)
- func (m *MockIssueStore) ListIssuesByUser(_ context.Context, userID string, limit, offset int) ([]coreissue.Issue, int, error)
- func (m *MockIssueStore) UpdateIssue(_ context.Context, issueID, userID string, in coreissue.UpdateInput) (*coreissue.Issue, error)
- func (m *MockIssueStore) UpdateIssueInTeam(_ context.Context, issueID, teamID string, in coreissue.UpdateInput) (*coreissue.Issue, error)
- type MockLLMModelStore
- func (m *MockLLMModelStore) CreateLLMModel(_ context.Context, in coregw.CreateModelInput) (*coregw.Model, error)
- func (m *MockLLMModelStore) GetLLMModel(_ context.Context, llmModelID string) (*coregw.Model, error)
- func (m *MockLLMModelStore) GetLLMModelByName(_ context.Context, name string) (*coregw.Model, error)
- func (m *MockLLMModelStore) LLMModelCredential(_ context.Context, llmModelID string) (string, error)
- func (m *MockLLMModelStore) ListLLMModels(_ context.Context) ([]coregw.Model, error)
- func (m *MockLLMModelStore) SetLLMModelEnabled(_ context.Context, llmModelID string, enabled bool) error
- type MockLoginCode
- type MockLoginCodeStore
- type MockPasswordStore
- type MockPersistStorage
- func (m *MockPersistStorage) Get(_ context.Context, _ string, _ string) ([]byte, error)
- func (m *MockPersistStorage) GetRunArtifacts(_ context.Context, ref blob.RunObjectRef) ([]byte, error)
- func (m *MockPersistStorage) GetRunGlobal(_ context.Context, ref blob.RunObjectRef) ([]byte, error)
- func (m *MockPersistStorage) ListFiles(_ context.Context, _ string) ([]string, error)
- func (m *MockPersistStorage) MaterializeToDir(_ context.Context, _ string, _ string) error
- func (m *MockPersistStorage) Put(_ context.Context, _ string, _ string, _ io.Reader) error
- func (m *MockPersistStorage) PutRunArtifacts(_ context.Context, ref blob.RunObjectRef, r io.Reader) error
- func (m *MockPersistStorage) PutRunGlobal(_ context.Context, ref blob.RunObjectRef, r io.Reader) error
- type MockPluginActivationStore
- func (m *MockPluginActivationStore) ActivatePlugin(_ context.Context, in coreplugin.ActivateInput) (*coreplugin.Activation, error)
- func (m *MockPluginActivationStore) GetPluginActivation(_ context.Context, teamID, pluginName string) (*coreplugin.Activation, error)
- func (m *MockPluginActivationStore) ListPluginActivations(_ context.Context, teamID string) ([]coreplugin.Activation, error)
- func (m *MockPluginActivationStore) MovePluginActivationPin(_ context.Context, in coreplugin.MovePinInput) (*coreplugin.Activation, error)
- func (m *MockPluginActivationStore) SetPluginActivationEnabled(_ context.Context, teamID, pluginName string, enabled bool, actorID string) (*coreplugin.Activation, error)
- type MockPluginPackageStorage
- func (f *MockPluginPackageStorage) Exists(_ context.Context, key string) (bool, error)
- func (f *MockPluginPackageStorage) Open(_ context.Context, key string) (io.ReadCloser, int64, error)
- func (f *MockPluginPackageStorage) PackageKey(prefix, pluginName, digest string) (string, error)
- func (f *MockPluginPackageStorage) Put(_ context.Context, key string, r io.Reader) error
- type MockPluginStore
- func (f *MockPluginStore) CreatePlugin(_ context.Context, in coreplugin.CreateInput) (*coreplugin.Plugin, error)
- func (f *MockPluginStore) CreatePluginRelease(_ context.Context, in coreplugin.CreateReleaseInput) (*coreplugin.Release, error)
- func (f *MockPluginStore) GetPlugin(_ context.Context, name string) (*coreplugin.Plugin, error)
- func (f *MockPluginStore) GetPluginRelease(_ context.Context, name, version string) (*coreplugin.Release, error)
- func (f *MockPluginStore) ListPluginReleases(_ context.Context, name string) ([]coreplugin.Release, error)
- func (f *MockPluginStore) ListPlugins(_ context.Context, includeArchived bool) ([]coreplugin.Plugin, error)
- func (f *MockPluginStore) SetPluginArchived(_ context.Context, name string, archived bool) error
- func (f *MockPluginStore) UpdatePlugin(_ context.Context, name string, in coreplugin.UpdateInput) (*coreplugin.Plugin, error)
- func (f *MockPluginStore) YankPluginRelease(_ context.Context, name, version, actor, reason string) error
- type MockRefreshToken
- type MockRefreshTokenStore
- func (m *MockRefreshTokenStore) Backdate(plaintext string, by time.Duration) bool
- func (m *MockRefreshTokenStore) CountUserSessions(_ context.Context, userID string, now time.Time) (int, error)
- func (m *MockRefreshTokenStore) CreateRefreshToken(_ context.Context, in coreidentity.NewRefreshToken) (string, time.Time, error)
- func (m *MockRefreshTokenStore) DeleteExpiredRefreshTokens(_ context.Context, before time.Time) (int64, error)
- func (m *MockRefreshTokenStore) RevokeRefreshTokenSession(_ context.Context, plaintext string, now time.Time) (string, string, error)
- func (m *MockRefreshTokenStore) RevokeSession(_ context.Context, sessionID string, now time.Time) (int64, error)
- func (m *MockRefreshTokenStore) RevokeUserSessions(_ context.Context, userID string, now time.Time) (int64, error)
- func (m *MockRefreshTokenStore) RotateRefreshToken(_ context.Context, plaintext string, now time.Time, ttl, grace time.Duration) (coreidentity.RotatedRefreshToken, error)
- type MockRunOutputLister
- type MockRunOutputStorage
- func (m *MockRunOutputStorage) GetResult(_ context.Context, ref blob.RunRef) ([]byte, error)
- func (m *MockRunOutputStorage) GetRunOutputFile(_ context.Context, ref blob.RunObjectRef) ([]byte, error)
- func (m *MockRunOutputStorage) PutResult(_ context.Context, ref blob.RunRef, data []byte) error
- func (m *MockRunOutputStorage) PutRunOutputFile(_ context.Context, ref blob.RunObjectRef, r io.Reader) error
- type MockSystemGrantStore
- func (m *MockSystemGrantStore) ActiveSystemRoles(_ context.Context, userID string) ([]string, error)
- func (m *MockSystemGrantStore) CountActiveSystemGrants(_ context.Context, role string) (int, error)
- func (m *MockSystemGrantStore) GrantForTest(userID, role string)
- func (m *MockSystemGrantStore) GrantSystemRole(_ context.Context, userID, role, grantedBy string, now time.Time) (*coreidentity.SystemGrant, error)
- func (m *MockSystemGrantStore) ListSystemGrants(_ context.Context, includeRevoked bool) ([]coreidentity.SystemGrant, error)
- func (m *MockSystemGrantStore) RevokeSystemRole(_ context.Context, userID, role string, now time.Time) (bool, error)
- type MockTaskResultDeliveryStore
- func (m *MockTaskResultDeliveryStore) ClaimTaskResultDelivery(_ context.Context, taskRunID string, now, nextAttemptAt time.Time) (*coretask.ResultDelivery, error)
- func (m *MockTaskResultDeliveryStore) EnqueueTaskResultDelivery(_ context.Context, taskRunID, conversationID string, now time.Time) error
- func (m *MockTaskResultDeliveryStore) FinishTaskResultDelivery(_ context.Context, taskRunID, status string, lastError *string) error
- func (m *MockTaskResultDeliveryStore) Get(taskRunID string) *coretask.ResultDelivery
- func (m *MockTaskResultDeliveryStore) ListDueTaskResultDeliveries(_ context.Context, now time.Time, limit int) ([]coretask.ResultDelivery, error)
- func (m *MockTaskResultDeliveryStore) RecordTaskResultDeliveryFailure(_ context.Context, taskRunID, lastError string, nextAttemptAt time.Time) error
- type MockTaskRunStore
- func (m *MockTaskRunStore) CountTaskRunsByStatus(_ context.Context) (map[string]int, error)
- func (m *MockTaskRunStore) CreateTaskRun(_ context.Context, in coretask.CreateRunInput) (*coretask.Run, error)
- func (m *MockTaskRunStore) GetActiveTaskRunByTask(_ context.Context, taskID string) (*coretask.Run, error)
- func (m *MockTaskRunStore) GetNextPendingTaskRun(_ context.Context) (*coretask.Run, error)
- func (m *MockTaskRunStore) GetTaskRun(_ context.Context, taskRunID string) (*coretask.Run, error)
- func (m *MockTaskRunStore) GetTaskRunWithTask(_ context.Context, taskRunID string) (*coretask.Run, *coretask.Task, error)
- func (m *MockTaskRunStore) ListTaskRunIDsByTasks(_ context.Context, taskIDs []string) (map[string][]string, error)
- func (m *MockTaskRunStore) RecordTaskRunAgentRevision(_ context.Context, taskRunID string, revision int) error
- func (m *MockTaskRunStore) RecordTaskRunPluginPins(_ context.Context, taskRunID string, pins []coreplugin.Pin) error
- func (m *MockTaskRunStore) RequestTaskRunCancel(_ context.Context, taskRunID, requestedBy string, requestedAt time.Time) (bool, error)
- func (m *MockTaskRunStore) TransitionTaskRun(ctx context.Context, in coretask.TransitionRunInput) (bool, error)
- func (m *MockTaskRunStore) UpdateTaskRunWorkerInfo(_ context.Context, taskRunID, workerType string, k8sJobName *string, ...) error
- type MockTaskStore
- func (m *MockTaskStore) ClaimTask(_ context.Context, in coretask.ClaimInput) (bool, error)
- func (m *MockTaskStore) CreateTask(_ context.Context, in *coretask.CreateInput) (*coretask.Task, error)
- func (m *MockTaskStore) GetTask(_ context.Context, taskID string) (*coretask.Task, error)
- func (m *MockTaskStore) GetTaskBySessionID(_ context.Context, sessionID string) (*coretask.Task, error)
- func (m *MockTaskStore) ListTasksByConversation(_ context.Context, conversationID string, order string) ([]coretask.Task, error)
- func (m *MockTaskStore) ListTasksByConversationPaginated(_ context.Context, conversationID string, executedOnly bool, limit, offset int) ([]coretask.Task, int, error)
- func (m *MockTaskStore) ListTasksByIssue(_ context.Context, issueID string, limit, offset int) ([]coretask.Task, int, error)
- func (m *MockTaskStore) UpdateTask(_ context.Context, in coretask.UpdateInput) error
- type MockTeamStore
- func (m *MockTeamStore) AddTeamMember(_ context.Context, teamID, userID, role string) (*coreteam.Member, error)
- func (m *MockTeamStore) CountTeamMembers(_ context.Context, teamIDs []string) (map[string]int, error)
- func (m *MockTeamStore) CreateTeam(_ context.Context, name, createdBy, quotaTier string) (*coreteam.Team, error)
- func (m *MockTeamStore) GetPersonalTeamByUser(_ context.Context, userID string) (*coreteam.Team, error)
- func (m *MockTeamStore) GetTeam(_ context.Context, teamID string) (*coreteam.Team, error)
- func (m *MockTeamStore) ListAllTeams(_ context.Context, query string, limit, offset int) ([]coreteam.Team, int, error)
- func (m *MockTeamStore) ListTeamMembers(_ context.Context, teamID string) ([]coreteam.Member, error)
- func (m *MockTeamStore) ListTeamsByUser(_ context.Context, userID string) ([]coreteam.Team, error)
- func (m *MockTeamStore) RemoveTeamMember(_ context.Context, teamID, userID string) error
- func (m *MockTeamStore) SetTeamPluginCuration(_ context.Context, teamID string, mode coreplugin.Curation) error
- type MockTierStore
- type MockUsageReader
- type MockUserStore
- func (m *MockUserStore) CreateUser(_ context.Context, email string, defaultQuotaTier string) (*coreidentity.User, error)
- func (m *MockUserStore) DisableForTest(userID string, at time.Time)
- func (m *MockUserStore) GetUser(_ context.Context, userID string) (*coreidentity.User, error)
- func (m *MockUserStore) ListUsers(_ context.Context, query string, limit, offset int) ([]coreidentity.User, int, error)
- func (m *MockUserStore) SetUserDisabled(_ context.Context, userID string, disabledAt *time.Time) error
- func (m *MockUserStore) UpdateLoginMeta(_ context.Context, userID string, loginAt time.Time, platform string) error
- func (m *MockUserStore) UserByEmail(_ context.Context, email string) (*coreidentity.User, error)
- type MockUserWebhookKeyStore
- func (m *MockUserWebhookKeyStore) CreateKey(_ context.Context, userID, name string) (string, string, error)
- func (m *MockUserWebhookKeyStore) GetUserIDByKey(_ context.Context, plaintextKey string) (string, error)
- func (m *MockUserWebhookKeyStore) ListKeys(_ context.Context, userID string) ([]coreidentity.WebhookKeyMeta, error)
- func (m *MockUserWebhookKeyStore) RevokeKey(_ context.Context, userID, keyID string) error
- type MockWorkflowStore
- func (m *MockWorkflowStore) CreateWorkflow(_ context.Context, teamID, createdBy, name, description, definition string) (*coreworkflow.Workflow, error)
- func (m *MockWorkflowStore) CreateWorkflowRun(_ context.Context, in coreworkflow.CreateRunInput) (*coreworkflow.Run, error)
- func (m *MockWorkflowStore) CreateWorkflowStepRuns(_ context.Context, workflowRunID string, ...) ([]coreworkflow.StepRun, error)
- func (m *MockWorkflowStore) GetWorkflow(_ context.Context, workflowID string) (*coreworkflow.Workflow, error)
- func (m *MockWorkflowStore) GetWorkflowRevision(_ context.Context, workflowID string, revision int) (*coreworkflow.Revision, error)
- func (m *MockWorkflowStore) GetWorkflowRun(_ context.Context, workflowRunID string) (*coreworkflow.Run, error)
- func (m *MockWorkflowStore) GetWorkflowStepRunByTaskID(_ context.Context, taskID string) (*coreworkflow.StepRun, error)
- func (m *MockWorkflowStore) GetWorkflowStepRunByTaskRunID(_ context.Context, taskRunID string) (*coreworkflow.StepRun, error)
- func (m *MockWorkflowStore) ListWorkflowRevisions(_ context.Context, workflowID string, limit, offset int) ([]coreworkflow.Revision, int, error)
- func (m *MockWorkflowStore) ListWorkflowRunsByIssue(_ context.Context, issueID string, limit, offset int) ([]coreworkflow.Run, int, error)
- func (m *MockWorkflowStore) ListWorkflowRunsByWorkflow(_ context.Context, workflowID string, limit, offset int) ([]coreworkflow.Run, int, error)
- func (m *MockWorkflowStore) ListWorkflowStepRuns(_ context.Context, workflowRunID string) ([]coreworkflow.StepRun, error)
- func (m *MockWorkflowStore) ListWorkflowsByTeam(_ context.Context, teamID string) ([]coreworkflow.Workflow, error)
- func (m *MockWorkflowStore) UpdateWorkflow(_ context.Context, workflowID, teamID string, in coreworkflow.UpdateInput) (*coreworkflow.Workflow, error)
- func (m *MockWorkflowStore) UpdateWorkflowRun(_ context.Context, workflowRunID string, in coreworkflow.UpdateRunInput) (*coreworkflow.Run, error)
- func (m *MockWorkflowStore) UpdateWorkflowStepRun(_ context.Context, stepRunID string, in coreworkflow.UpdateStepRunInput) (*coreworkflow.StepRun, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DenyQuotaTeamStore ¶
DenyQuotaTeamStore is used by quota 429 tests to supply a team with tier.
func (*DenyQuotaTeamStore) AddTeamMember ¶
func (*DenyQuotaTeamStore) CountTeamMembers ¶
func (*DenyQuotaTeamStore) CreateTeam ¶
func (*DenyQuotaTeamStore) GetPersonalTeamByUser ¶
func (*DenyQuotaTeamStore) ListAllTeams ¶
func (*DenyQuotaTeamStore) ListTeamMembers ¶
func (*DenyQuotaTeamStore) ListTeamsByUser ¶
func (*DenyQuotaTeamStore) RemoveTeamMember ¶
func (d *DenyQuotaTeamStore) RemoveTeamMember(_ context.Context, _, _ string) error
func (*DenyQuotaTeamStore) SetTeamPluginCuration ¶
func (d *DenyQuotaTeamStore) SetTeamPluginCuration(_ context.Context, _ string, _ coreplugin.Curation) error
type DenyQuotaTierStore ¶
DenyQuotaTierStore is used by quota 429 tests.
func (*DenyQuotaTierStore) GetQuotaTier ¶
type DenyQuotaUsageReader ¶
DenyQuotaUsageReader is used by quota 429 tests.
type MockAgentStore ¶
MockAgentStore is an in-memory AgentStore for tests. It records revisions the way the database store does, so a test can assert on history.
func (*MockAgentStore) CreateAgentInTeam ¶
func (m *MockAgentStore) CreateAgentInTeam(_ context.Context, in agentdef.CreateInput) (*agentdef.Agent, error)
func (*MockAgentStore) DeleteAgent ¶
func (m *MockAgentStore) DeleteAgent(_ context.Context, agentID, userID string) error
func (*MockAgentStore) DeleteAgentInTeam ¶
func (m *MockAgentStore) DeleteAgentInTeam(_ context.Context, agentID, teamID string) error
func (*MockAgentStore) GetAgentIncludingDeleted ¶
func (*MockAgentStore) GetAgentRevision ¶
func (*MockAgentStore) ListAgentRevisions ¶
func (*MockAgentStore) ListAgentsByTeam ¶
func (*MockAgentStore) ListAgentsByUser ¶
func (*MockAgentStore) UpdateAgentInTeam ¶
func (m *MockAgentStore) UpdateAgentInTeam(_ context.Context, in agentdef.UpdateInput) (*agentdef.Agent, error)
type MockArtifactStorage ¶
type MockArtifactStorage struct {
// PutErr, when set, fails every write.
PutErr error
// contains filtered or unexported fields
}
MockArtifactStorage is an in-memory artifact.ContentStore for tests.
func NewMockArtifactStorage ¶
func NewMockArtifactStorage() *MockArtifactStorage
NewMockArtifactStorage returns a MockArtifactStorage ready for use.
func (*MockArtifactStorage) ObjectCount ¶
func (m *MockArtifactStorage) ObjectCount() int
ObjectCount reports how many objects are stored, so a test can prove that a failed create left nothing behind.
func (*MockArtifactStorage) OpenArtifact ¶
func (m *MockArtifactStorage) OpenArtifact(_ context.Context, ref coreartifact.Ref) (io.ReadCloser, error)
func (*MockArtifactStorage) PutArtifact ¶
func (m *MockArtifactStorage) PutArtifact(_ context.Context, ref coreartifact.Ref, r io.Reader) (string, error)
func (*MockArtifactStorage) RemoveArtifact ¶
func (m *MockArtifactStorage) RemoveArtifact(_ context.Context, ref coreartifact.Ref) error
type MockArtifactStore ¶
type MockArtifactStore struct {
// CreateErr, when set, fails every create — the case where content is
// already durable and the record is not.
CreateErr error
// contains filtered or unexported fields
}
MockArtifactStore is an in-memory coreartifact.Store for tests.
func (*MockArtifactStore) Count ¶
func (m *MockArtifactStore) Count() int
Count reports how many records exist, tombstoned ones included. Tests use it to prove that a failed create left none.
func (*MockArtifactStore) CreateArtifact ¶
func (m *MockArtifactStore) CreateArtifact(_ context.Context, in coreartifact.CreateInput) (*coreartifact.Artifact, error)
func (*MockArtifactStore) GetArtifact ¶
func (m *MockArtifactStore) GetArtifact(_ context.Context, artifactID string) (*coreartifact.Artifact, error)
func (*MockArtifactStore) ListArtifactsBySource ¶
func (m *MockArtifactStore) ListArtifactsBySource(_ context.Context, sourceIDs []string) (map[string][]coreartifact.Artifact, error)
func (*MockArtifactStore) ListArtifactsByTeam ¶
func (m *MockArtifactStore) ListArtifactsByTeam(_ context.Context, teamID string, limit, offset int) ([]coreartifact.Artifact, int, error)
func (*MockArtifactStore) SoftDeleteArtifact ¶
type MockAuditStore ¶
type MockAuditStore struct {
Events []coreaudit.Event
// Err, when set, is returned by RecordAuditEvent so a caller's behaviour
// on a failed write can be exercised.
Err error
}
MockAuditStore is an in-memory coreaudit.Store for tests.
func (*MockAuditStore) ExportAuditEvents ¶
func (m *MockAuditStore) ExportAuditEvents(_ context.Context, filter coreaudit.Filter, after coreaudit.Cursor, limit int) ([]coreaudit.Event, error)
ExportAuditEvents walks every team's events newest-first from after.
func (*MockAuditStore) ExportTeamAuditEvents ¶
func (m *MockAuditStore) ExportTeamAuditEvents(_ context.Context, teamID string, after coreaudit.Cursor, limit int) ([]coreaudit.Event, error)
ExportTeamAuditEvents walks a team's events newest-first from after.
func (*MockAuditStore) ListAuditEvents ¶
func (*MockAuditStore) OldestAuditEventAt ¶
OldestAuditEventAt returns the earliest recorded timestamp, or zero.
func (*MockAuditStore) PruneAuditEvents ¶
func (m *MockAuditStore) PruneAuditEvents(_ context.Context, before time.Time, limit int) (int64, error)
PruneAuditEvents removes events older than the cutoff, at most limit of them.
func (*MockAuditStore) RecordAuditEvent ¶
type MockConversationMessageStore ¶
type MockConversationMessageStore struct {
Messages []coreconv.Message
// contains filtered or unexported fields
}
MockConversationMessageStore is an in-memory ConversationMessageStore.
Every appended message gets its own handle. That matters more than it looks: a run records the message that asked for it, and a store handing out one shared ID would let that assertion pass on any message at all.
func (*MockConversationMessageStore) AppendMessage ¶
func (m *MockConversationMessageStore) AppendMessage(_ context.Context, in coreconv.AppendInput) (*coreconv.Message, error)
func (*MockConversationMessageStore) GetMessage ¶
func (*MockConversationMessageStore) ListMessages ¶
type MockConversationStore ¶
type MockConversationStore struct {
Conversations []coreconv.Conversation
}
MockConversationStore is an in-memory ConversationStore for tests.
func (*MockConversationStore) CreateConversation ¶
func (m *MockConversationStore) CreateConversation(_ context.Context, userID, channel, createdBy string) (*coreconv.Conversation, error)
func (*MockConversationStore) CreateConversationInTeam ¶
func (m *MockConversationStore) CreateConversationInTeam(_ context.Context, teamID, userID, channel, createdBy string) (*coreconv.Conversation, error)
func (*MockConversationStore) GetConversation ¶
func (m *MockConversationStore) GetConversation(_ context.Context, conversationID string) (*coreconv.Conversation, error)
func (*MockConversationStore) ListConversationsByTeam ¶
func (m *MockConversationStore) ListConversationsByTeam(_ context.Context, teamID string, limit, offset int) ([]coreconv.Conversation, int, error)
func (*MockConversationStore) ListConversationsByUser ¶
func (m *MockConversationStore) ListConversationsByUser(_ context.Context, userID string, limit, offset int) ([]coreconv.Conversation, int, error)
func (*MockConversationStore) UpdateConversationTitle ¶
func (m *MockConversationStore) UpdateConversationTitle(_ context.Context, conversationID, title string) error
type MockIssueCommentStore ¶
type MockIssueCommentStore struct {
Comments []coreissue.Comment
// CreateErr, when set, is returned by CreateIssueComment. It exists so a
// test can prove a failed comment write does not fail the run that
// triggered it.
CreateErr error
}
MockIssueCommentStore is an in-memory IssueCommentStore for tests.
func (*MockIssueCommentStore) CountIssueComments ¶
func (*MockIssueCommentStore) CreateIssueComment ¶
func (m *MockIssueCommentStore) CreateIssueComment(_ context.Context, in coreissue.CreateCommentInput) (*coreissue.Comment, error)
func (*MockIssueCommentStore) DeleteIssueComment ¶
func (m *MockIssueCommentStore) DeleteIssueComment(_ context.Context, commentID string) error
func (*MockIssueCommentStore) GetIssueComment ¶
func (*MockIssueCommentStore) ListIssueComments ¶
func (*MockIssueCommentStore) UpdateIssueComment ¶
type MockIssueStore ¶
MockIssueStore is an in-memory IssueStore for tests.
func (*MockIssueStore) ChildStatsForIssues ¶
func (m *MockIssueStore) ChildStatsForIssues(_ context.Context, issueIDs []string) (map[string]coreissue.ChildStats, error)
func (*MockIssueStore) CreateIssue ¶
func (m *MockIssueStore) CreateIssue(_ context.Context, userID string, in coreissue.CreateInput) (*coreissue.Issue, error)
func (*MockIssueStore) CreateIssueInTeam ¶
func (m *MockIssueStore) CreateIssueInTeam(_ context.Context, teamID, createdBy string, in coreissue.CreateInput) (*coreissue.Issue, error)
func (*MockIssueStore) ListIssueChildren ¶
func (*MockIssueStore) ListIssuesByTeam ¶
func (*MockIssueStore) ListIssuesByUser ¶
func (*MockIssueStore) UpdateIssue ¶
func (m *MockIssueStore) UpdateIssue(_ context.Context, issueID, userID string, in coreissue.UpdateInput) (*coreissue.Issue, error)
func (*MockIssueStore) UpdateIssueInTeam ¶
func (m *MockIssueStore) UpdateIssueInTeam(_ context.Context, issueID, teamID string, in coreissue.UpdateInput) (*coreissue.Issue, error)
type MockLLMModelStore ¶
type MockLLMModelStore struct {
Models []coregw.Model
Credentials map[string]string
Err error
// contains filtered or unexported fields
}
MockLLMModelStore is an in-memory LLMModelStore for tests.
Credentials are kept in a separate map, mirroring the real store: reading a model and reading its key are different operations, and a mock that stapled the key onto the record would let a handler test pass while the endpoint serialized it.
func (*MockLLMModelStore) CreateLLMModel ¶
func (m *MockLLMModelStore) CreateLLMModel(_ context.Context, in coregw.CreateModelInput) (*coregw.Model, error)
func (*MockLLMModelStore) GetLLMModel ¶
func (*MockLLMModelStore) GetLLMModelByName ¶
func (*MockLLMModelStore) LLMModelCredential ¶
func (*MockLLMModelStore) ListLLMModels ¶
func (*MockLLMModelStore) SetLLMModelEnabled ¶
type MockLoginCode ¶
MockLoginCode is one issued code in MockLoginCodeStore.
type MockLoginCodeStore ¶
type MockLoginCodeStore struct {
Codes map[string]*MockLoginCode
ConsumeErr error
Issued []string
}
MockLoginCodeStore is an in-memory LoginCodeStore for tests. Seed Codes with the plaintext a test will submit; ConsumeErr forces a store failure.
func (*MockLoginCodeStore) ConsumeLoginCode ¶
func (m *MockLoginCodeStore) ConsumeLoginCode(_ context.Context, plaintext, userID string, now time.Time) (bool, error)
ConsumeLoginCode mirrors the real store: unknown, spent, expired, and somebody else's codes are all reported the same way, as not redeemed rather than as an error, and only a match is marked used.
type MockPasswordStore ¶
MockPasswordStore is an in-memory PasswordStore for tests. Seed Hashes with the encoded hash a test expects to verify against.
func (*MockPasswordStore) PasswordHash ¶
func (*MockPasswordStore) SetPassword ¶
type MockPersistStorage ¶
type MockPersistStorage struct {
// RunGlobal is keyed by createdBy/conversationID/taskID/taskRunID/relPath.
RunGlobal map[string][]byte
// RunArtifacts uses the same key shape.
RunArtifacts map[string][]byte
}
MockPersistStorage is an in-memory blob.PersistStorage for tests. Only the run-global half is backed by a map; the home-file methods satisfy the interface and are inert, because the handlers that need this mock read run state, not team files.
func NewMockPersistStorage ¶
func NewMockPersistStorage() *MockPersistStorage
NewMockPersistStorage returns a MockPersistStorage ready for use.
func (*MockPersistStorage) GetRunArtifacts ¶
func (m *MockPersistStorage) GetRunArtifacts(_ context.Context, ref blob.RunObjectRef) ([]byte, error)
func (*MockPersistStorage) GetRunGlobal ¶
func (m *MockPersistStorage) GetRunGlobal(_ context.Context, ref blob.RunObjectRef) ([]byte, error)
func (*MockPersistStorage) MaterializeToDir ¶
func (*MockPersistStorage) PutRunArtifacts ¶
func (m *MockPersistStorage) PutRunArtifacts(_ context.Context, ref blob.RunObjectRef, r io.Reader) error
func (*MockPersistStorage) PutRunGlobal ¶
func (m *MockPersistStorage) PutRunGlobal(_ context.Context, ref blob.RunObjectRef, r io.Reader) error
type MockPluginActivationStore ¶
type MockPluginActivationStore struct {
// contains filtered or unexported fields
}
MockPluginActivationStore is an in-memory team activation store for tests.
func NewMockPluginActivationStore ¶
func NewMockPluginActivationStore() *MockPluginActivationStore
func (*MockPluginActivationStore) ActivatePlugin ¶
func (m *MockPluginActivationStore) ActivatePlugin(_ context.Context, in coreplugin.ActivateInput) (*coreplugin.Activation, error)
func (*MockPluginActivationStore) GetPluginActivation ¶
func (m *MockPluginActivationStore) GetPluginActivation(_ context.Context, teamID, pluginName string) (*coreplugin.Activation, error)
func (*MockPluginActivationStore) ListPluginActivations ¶
func (m *MockPluginActivationStore) ListPluginActivations(_ context.Context, teamID string) ([]coreplugin.Activation, error)
func (*MockPluginActivationStore) MovePluginActivationPin ¶
func (m *MockPluginActivationStore) MovePluginActivationPin(_ context.Context, in coreplugin.MovePinInput) (*coreplugin.Activation, error)
func (*MockPluginActivationStore) SetPluginActivationEnabled ¶
func (m *MockPluginActivationStore) SetPluginActivationEnabled(_ context.Context, teamID, pluginName string, enabled bool, actorID string) (*coreplugin.Activation, error)
type MockPluginPackageStorage ¶
MockPluginPackageStorage is an in-memory plugin.PackageStore.
func NewMockPluginPackageStorage ¶
func NewMockPluginPackageStorage() *MockPluginPackageStorage
NewMockPluginPackageStorage returns empty storage.
func (*MockPluginPackageStorage) Open ¶
func (f *MockPluginPackageStorage) Open(_ context.Context, key string) (io.ReadCloser, int64, error)
func (*MockPluginPackageStorage) PackageKey ¶
func (f *MockPluginPackageStorage) PackageKey(prefix, pluginName, digest string) (string, error)
PackageKey delegates to the real layout, so a key a test stores under is the key production would have used.
type MockPluginStore ¶
type MockPluginStore struct {
// contains filtered or unexported fields
}
MockPluginStore is an in-memory Marketplace catalog for tests.
func NewMockPluginStore ¶
func NewMockPluginStore() *MockPluginStore
func (*MockPluginStore) CreatePlugin ¶
func (f *MockPluginStore) CreatePlugin(_ context.Context, in coreplugin.CreateInput) (*coreplugin.Plugin, error)
func (*MockPluginStore) CreatePluginRelease ¶
func (f *MockPluginStore) CreatePluginRelease(_ context.Context, in coreplugin.CreateReleaseInput) (*coreplugin.Release, error)
func (*MockPluginStore) GetPlugin ¶
func (f *MockPluginStore) GetPlugin(_ context.Context, name string) (*coreplugin.Plugin, error)
func (*MockPluginStore) GetPluginRelease ¶
func (f *MockPluginStore) GetPluginRelease(_ context.Context, name, version string) (*coreplugin.Release, error)
func (*MockPluginStore) ListPluginReleases ¶
func (f *MockPluginStore) ListPluginReleases(_ context.Context, name string) ([]coreplugin.Release, error)
func (*MockPluginStore) ListPlugins ¶
func (f *MockPluginStore) ListPlugins(_ context.Context, includeArchived bool) ([]coreplugin.Plugin, error)
func (*MockPluginStore) SetPluginArchived ¶
func (*MockPluginStore) UpdatePlugin ¶
func (f *MockPluginStore) UpdatePlugin(_ context.Context, name string, in coreplugin.UpdateInput) (*coreplugin.Plugin, error)
func (*MockPluginStore) YankPluginRelease ¶
func (f *MockPluginStore) YankPluginRelease(_ context.Context, name, version, actor, reason string) error
type MockRefreshToken ¶
type MockRefreshToken struct {
UserID string
SessionID string
Platform string
ExpiresAt time.Time
UsedAt *time.Time
RevokedAt *time.Time
}
MockRefreshToken is one issued token in MockRefreshTokenStore.
type MockRefreshTokenStore ¶
type MockRefreshTokenStore struct {
Tokens map[string]*MockRefreshToken
// CreateErr and RotateErr force a store failure.
CreateErr error
RotateErr error
// contains filtered or unexported fields
}
MockRefreshTokenStore is an in-memory RefreshTokenStore for tests.
It reproduces the rotation rules the real store enforces — spend on exchange, a grace window for concurrent callers, revoke the session on reuse — because those rules are what the handlers branch on. A mock that always succeeded would let a handler test pass while the endpoint handed a replayed credential a fresh session.
func (*MockRefreshTokenStore) Backdate ¶
func (m *MockRefreshTokenStore) Backdate(plaintext string, by time.Duration) bool
Backdate moves a spent token's used_at further into the past, so a test can put a token outside the rotation grace window without waiting for the clock. It reports whether the token was there to move.
func (*MockRefreshTokenStore) CountUserSessions ¶
func (*MockRefreshTokenStore) CreateRefreshToken ¶
func (m *MockRefreshTokenStore) CreateRefreshToken(_ context.Context, in coreidentity.NewRefreshToken) (string, time.Time, error)
func (*MockRefreshTokenStore) DeleteExpiredRefreshTokens ¶
func (*MockRefreshTokenStore) RevokeRefreshTokenSession ¶
func (*MockRefreshTokenStore) RevokeSession ¶
func (*MockRefreshTokenStore) RevokeUserSessions ¶
func (*MockRefreshTokenStore) RotateRefreshToken ¶
func (m *MockRefreshTokenStore) RotateRefreshToken(_ context.Context, plaintext string, now time.Time, ttl, grace time.Duration) (coreidentity.RotatedRefreshToken, error)
type MockRunOutputLister ¶
type MockRunOutputLister struct {
List []coretask.RunOutputListing
ListErr error
OutputFiles map[string][]coretask.RunOutputFile
}
MockRunOutputLister is an in-memory RunOutputLister for tests.
func (*MockRunOutputLister) GetTaskRunOutputFiles ¶
func (m *MockRunOutputLister) GetTaskRunOutputFiles(_ context.Context, taskRunID string) ([]coretask.RunOutputFile, error)
func (*MockRunOutputLister) ListRunOutputsByConversation ¶
func (m *MockRunOutputLister) ListRunOutputsByConversation(_ context.Context, conversationID string, taskID *string) ([]coretask.RunOutputListing, error)
type MockRunOutputStorage ¶
MockRunOutputStorage is an in-memory blob.RunOutputStorage for tests.
func NewMockRunOutputStorage ¶
func NewMockRunOutputStorage() *MockRunOutputStorage
NewMockRunOutputStorage returns a MockRunOutputStorage ready for use.
func (*MockRunOutputStorage) GetRunOutputFile ¶
func (m *MockRunOutputStorage) GetRunOutputFile(_ context.Context, ref blob.RunObjectRef) ([]byte, error)
func (*MockRunOutputStorage) PutRunOutputFile ¶
func (m *MockRunOutputStorage) PutRunOutputFile(_ context.Context, ref blob.RunObjectRef, r io.Reader) error
type MockSystemGrantStore ¶
type MockSystemGrantStore struct {
Grants []coreidentity.SystemGrant
// Err, when set, is returned by every read so a caller's behaviour on a
// store failure can be exercised. An authorization check that fails open
// on a database error is the bug worth having a test for.
Err error
}
MockSystemGrantStore is an in-memory coreidentity.SystemGrantStore for tests.
func (*MockSystemGrantStore) ActiveSystemRoles ¶
func (*MockSystemGrantStore) CountActiveSystemGrants ¶
func (*MockSystemGrantStore) GrantForTest ¶
func (m *MockSystemGrantStore) GrantForTest(userID, role string)
GrantForTest adds an active grant without going through the validation GrantSystemRole applies. Test setup, not a store method.
func (*MockSystemGrantStore) GrantSystemRole ¶
func (m *MockSystemGrantStore) GrantSystemRole(_ context.Context, userID, role, grantedBy string, now time.Time) (*coreidentity.SystemGrant, error)
func (*MockSystemGrantStore) ListSystemGrants ¶
func (m *MockSystemGrantStore) ListSystemGrants(_ context.Context, includeRevoked bool) ([]coreidentity.SystemGrant, error)
func (*MockSystemGrantStore) RevokeSystemRole ¶
type MockTaskResultDeliveryStore ¶
type MockTaskResultDeliveryStore struct {
Deliveries map[string]*coretask.ResultDelivery
// EnqueueErr, when set, is returned by every enqueue.
EnqueueErr error
// contains filtered or unexported fields
}
MockTaskResultDeliveryStore is an in-memory TaskResultDeliveryStore.
The claim is a real compare-and-set, not a stub that always succeeds: what it exists to prevent is one run being reported twice, and a double that cannot refuse a second claim would let that pass.
func (*MockTaskResultDeliveryStore) ClaimTaskResultDelivery ¶
func (m *MockTaskResultDeliveryStore) ClaimTaskResultDelivery(_ context.Context, taskRunID string, now, nextAttemptAt time.Time) (*coretask.ResultDelivery, error)
func (*MockTaskResultDeliveryStore) EnqueueTaskResultDelivery ¶
func (*MockTaskResultDeliveryStore) FinishTaskResultDelivery ¶
func (*MockTaskResultDeliveryStore) Get ¶
func (m *MockTaskResultDeliveryStore) Get(taskRunID string) *coretask.ResultDelivery
Get returns a copy of one delivery, or nil.
func (*MockTaskResultDeliveryStore) ListDueTaskResultDeliveries ¶
func (m *MockTaskResultDeliveryStore) ListDueTaskResultDeliveries(_ context.Context, now time.Time, limit int) ([]coretask.ResultDelivery, error)
func (*MockTaskResultDeliveryStore) RecordTaskResultDeliveryFailure ¶
type MockTaskRunStore ¶
type MockTaskRunStore struct {
Runs []coretask.Run
TaskList []coretask.Task
// Artifacts holds the relative paths registered per run, so a test can
// check that a run's files were kept.
Artifacts map[string][]string
}
MockTaskRunStore is an in-memory TaskRunStore for tests.
func (*MockTaskRunStore) CountTaskRunsByStatus ¶
func (*MockTaskRunStore) CreateTaskRun ¶
func (m *MockTaskRunStore) CreateTaskRun(_ context.Context, in coretask.CreateRunInput) (*coretask.Run, error)
func (*MockTaskRunStore) GetActiveTaskRunByTask ¶
func (*MockTaskRunStore) GetNextPendingTaskRun ¶
func (*MockTaskRunStore) GetTaskRun ¶
func (*MockTaskRunStore) GetTaskRunWithTask ¶
func (*MockTaskRunStore) ListTaskRunIDsByTasks ¶
func (*MockTaskRunStore) RecordTaskRunAgentRevision ¶
func (*MockTaskRunStore) RecordTaskRunPluginPins ¶
func (m *MockTaskRunStore) RecordTaskRunPluginPins(_ context.Context, taskRunID string, pins []coreplugin.Pin) error
func (*MockTaskRunStore) RequestTaskRunCancel ¶
func (*MockTaskRunStore) TransitionTaskRun ¶
func (m *MockTaskRunStore) TransitionTaskRun(ctx context.Context, in coretask.TransitionRunInput) (bool, error)
func (*MockTaskRunStore) UpdateTaskRunWorkerInfo ¶
type MockTaskStore ¶
type MockTaskStore struct {
List []coretask.Task
ListErr error
Create *coretask.Task
CreateErr error
// Created records what each CreateTask was asked for. The returned Task
// drops most of it, so provenance a caller set can only be asserted here.
Created []coretask.CreateInput
}
MockTaskStore is an in-memory TaskStore for tests.
func (*MockTaskStore) ClaimTask ¶
func (m *MockTaskStore) ClaimTask(_ context.Context, in coretask.ClaimInput) (bool, error)
func (*MockTaskStore) CreateTask ¶
func (m *MockTaskStore) CreateTask(_ context.Context, in *coretask.CreateInput) (*coretask.Task, error)
func (*MockTaskStore) GetTaskBySessionID ¶
func (*MockTaskStore) ListTasksByConversation ¶
func (*MockTaskStore) ListTasksByConversationPaginated ¶
func (*MockTaskStore) ListTasksByIssue ¶
func (*MockTaskStore) UpdateTask ¶
func (m *MockTaskStore) UpdateTask(_ context.Context, in coretask.UpdateInput) error
type MockTeamStore ¶
MockTeamStore is an in-memory TeamStore for tests.
func (*MockTeamStore) AddTeamMember ¶
func (*MockTeamStore) CountTeamMembers ¶
func (*MockTeamStore) CreateTeam ¶
func (*MockTeamStore) GetPersonalTeamByUser ¶
func (*MockTeamStore) ListAllTeams ¶
func (*MockTeamStore) ListTeamMembers ¶
func (*MockTeamStore) ListTeamsByUser ¶
func (*MockTeamStore) RemoveTeamMember ¶
func (m *MockTeamStore) RemoveTeamMember(_ context.Context, teamID, userID string) error
func (*MockTeamStore) SetTeamPluginCuration ¶
func (m *MockTeamStore) SetTeamPluginCuration(_ context.Context, teamID string, mode coreplugin.Curation) error
type MockTierStore ¶
MockTierStore returns a fixed tier for GetQuotaTier.
func (*MockTierStore) GetQuotaTier ¶
type MockUsageReader ¶
MockUsageReader returns fixed run count and token total for TeamUsageInWindow.
type MockUserStore ¶
type MockUserStore struct {
ByEmail map[string]*coreidentity.User
ByID map[string]*coreidentity.User
CreateErr error
NextUserID int
}
MockUserStore is an in-memory UserStore for tests. Use ByEmail and ByID to pre-seed users; CreateErr and NextUserID for behavior.
func (*MockUserStore) CreateUser ¶
func (m *MockUserStore) CreateUser(_ context.Context, email string, defaultQuotaTier string) (*coreidentity.User, error)
func (*MockUserStore) DisableForTest ¶
func (m *MockUserStore) DisableForTest(userID string, at time.Time)
DisableForTest disables a seeded account. Test setup, not a store method.
func (*MockUserStore) GetUser ¶
func (m *MockUserStore) GetUser(_ context.Context, userID string) (*coreidentity.User, error)
func (*MockUserStore) ListUsers ¶
func (m *MockUserStore) ListUsers(_ context.Context, query string, limit, offset int) ([]coreidentity.User, int, error)
func (*MockUserStore) SetUserDisabled ¶
func (*MockUserStore) UpdateLoginMeta ¶
func (*MockUserStore) UserByEmail ¶
func (m *MockUserStore) UserByEmail(_ context.Context, email string) (*coreidentity.User, error)
UserByEmail matches without regard to case, the way the real store's utf8mb4_0900_ai_ci email column does. Login resolves the account by address and nothing compares the two strings afterwards, so a case-sensitive mock would let a regression in that lookup pass here.
type MockUserWebhookKeyStore ¶
type MockUserWebhookKeyStore struct {
Keys map[string]string
Metas map[string][]coreidentity.WebhookKeyMeta
// contains filtered or unexported fields
}
MockUserWebhookKeyStore is an in-memory UserWebhookKeyStore for tests. Keys maps a plaintext key to the user that owns it.
func (*MockUserWebhookKeyStore) GetUserIDByKey ¶
func (*MockUserWebhookKeyStore) ListKeys ¶
func (m *MockUserWebhookKeyStore) ListKeys(_ context.Context, userID string) ([]coreidentity.WebhookKeyMeta, error)
type MockWorkflowStore ¶
type MockWorkflowStore struct {
Workflows []coreworkflow.Workflow
Revisions []coreworkflow.Revision
Runs []coreworkflow.Run
StepRuns []coreworkflow.StepRun
}
MockWorkflowStore is an in-memory WorkflowStore for tests. It records revisions the way the database store does, so a test can assert on history.
func (*MockWorkflowStore) CreateWorkflow ¶
func (m *MockWorkflowStore) CreateWorkflow(_ context.Context, teamID, createdBy, name, description, definition string) (*coreworkflow.Workflow, error)
func (*MockWorkflowStore) CreateWorkflowRun ¶
func (m *MockWorkflowStore) CreateWorkflowRun(_ context.Context, in coreworkflow.CreateRunInput) (*coreworkflow.Run, error)
func (*MockWorkflowStore) CreateWorkflowStepRuns ¶
func (m *MockWorkflowStore) CreateWorkflowStepRuns(_ context.Context, workflowRunID string, steps []coreworkflow.CreateStepRunInput) ([]coreworkflow.StepRun, error)
func (*MockWorkflowStore) GetWorkflow ¶
func (m *MockWorkflowStore) GetWorkflow(_ context.Context, workflowID string) (*coreworkflow.Workflow, error)
func (*MockWorkflowStore) GetWorkflowRevision ¶
func (m *MockWorkflowStore) GetWorkflowRevision(_ context.Context, workflowID string, revision int) (*coreworkflow.Revision, error)
func (*MockWorkflowStore) GetWorkflowRun ¶
func (m *MockWorkflowStore) GetWorkflowRun(_ context.Context, workflowRunID string) (*coreworkflow.Run, error)
func (*MockWorkflowStore) GetWorkflowStepRunByTaskID ¶
func (m *MockWorkflowStore) GetWorkflowStepRunByTaskID(_ context.Context, taskID string) (*coreworkflow.StepRun, error)
func (*MockWorkflowStore) GetWorkflowStepRunByTaskRunID ¶
func (m *MockWorkflowStore) GetWorkflowStepRunByTaskRunID(_ context.Context, taskRunID string) (*coreworkflow.StepRun, error)
func (*MockWorkflowStore) ListWorkflowRevisions ¶
func (m *MockWorkflowStore) ListWorkflowRevisions(_ context.Context, workflowID string, limit, offset int) ([]coreworkflow.Revision, int, error)
func (*MockWorkflowStore) ListWorkflowRunsByIssue ¶
func (m *MockWorkflowStore) ListWorkflowRunsByIssue(_ context.Context, issueID string, limit, offset int) ([]coreworkflow.Run, int, error)
func (*MockWorkflowStore) ListWorkflowRunsByWorkflow ¶
func (m *MockWorkflowStore) ListWorkflowRunsByWorkflow(_ context.Context, workflowID string, limit, offset int) ([]coreworkflow.Run, int, error)
func (*MockWorkflowStore) ListWorkflowStepRuns ¶
func (m *MockWorkflowStore) ListWorkflowStepRuns(_ context.Context, workflowRunID string) ([]coreworkflow.StepRun, error)
func (*MockWorkflowStore) ListWorkflowsByTeam ¶
func (m *MockWorkflowStore) ListWorkflowsByTeam(_ context.Context, teamID string) ([]coreworkflow.Workflow, error)
func (*MockWorkflowStore) UpdateWorkflow ¶
func (m *MockWorkflowStore) UpdateWorkflow(_ context.Context, workflowID, teamID string, in coreworkflow.UpdateInput) (*coreworkflow.Workflow, error)
func (*MockWorkflowStore) UpdateWorkflowRun ¶
func (m *MockWorkflowStore) UpdateWorkflowRun(_ context.Context, workflowRunID string, in coreworkflow.UpdateRunInput) (*coreworkflow.Run, error)
func (*MockWorkflowStore) UpdateWorkflowStepRun ¶
func (m *MockWorkflowStore) UpdateWorkflowStepRun(_ context.Context, stepRunID string, in coreworkflow.UpdateStepRunInput) (*coreworkflow.StepRun, error)
Source Files
¶
- agent.go
- artifact.go
- artifact_storage.go
- audit.go
- conversation.go
- doc.go
- issue.go
- issue_comment.go
- llm_model.go
- login_code.go
- persist_storage.go
- plugin.go
- plugin_activation.go
- quota.go
- refresh_token.go
- run_output.go
- run_output_storage.go
- store_helpers.go
- system_grant.go
- task.go
- task_result_delivery.go
- task_run.go
- team.go
- user.go
- webhook_key.go
- workflow.go