Documentation
¶
Index ¶
- Variables
- type AuditEntry
- type AuditFilter
- type AuditStore
- type AuthSessionStoreAdapter
- func (a *AuthSessionStoreAdapter) Cleanup(ctx context.Context) error
- func (a *AuthSessionStoreAdapter) Delete(ctx context.Context, sessionID string) error
- func (a *AuthSessionStoreAdapter) Get(ctx context.Context, sessionID string) (*auth.Session, error)
- func (a *AuthSessionStoreAdapter) Store(ctx context.Context, session *auth.Session) error
- type AuthUserStoreAdapter
- func (a *AuthUserStoreAdapter) CreateUser(ctx context.Context, user *auth.User) error
- func (a *AuthUserStoreAdapter) DeleteUser(ctx context.Context, userID string) error
- func (a *AuthUserStoreAdapter) GetUser(ctx context.Context, userID string) (*auth.User, error)
- func (a *AuthUserStoreAdapter) GetUserByEmail(ctx context.Context, email string) (*auth.User, error)
- func (a *AuthUserStoreAdapter) UpdateUser(ctx context.Context, user *auth.User) error
- type Company
- type CompanyFilter
- type CompanyStore
- type CrossWorkflowLink
- type CrossWorkflowLinkFilter
- type CrossWorkflowLinkStore
- type ExecutionFilter
- type ExecutionLog
- type ExecutionStatus
- type ExecutionStep
- type ExecutionStore
- type IAMProviderConfig
- type IAMProviderFilter
- type IAMProviderType
- type IAMRoleMapping
- type IAMRoleMappingFilter
- type IAMStore
- type LogFilter
- type LogLevel
- type LogStore
- type Membership
- type MembershipFilter
- type MembershipStore
- type Migrator
- type MockAuditStore
- type MockCompanyStore
- func (s *MockCompanyStore) Create(_ context.Context, c *Company) error
- func (s *MockCompanyStore) Delete(_ context.Context, id uuid.UUID) error
- func (s *MockCompanyStore) Get(_ context.Context, id uuid.UUID) (*Company, error)
- func (s *MockCompanyStore) GetBySlug(_ context.Context, slug string) (*Company, error)
- func (s *MockCompanyStore) List(_ context.Context, f CompanyFilter) ([]*Company, error)
- func (s *MockCompanyStore) ListForUser(_ context.Context, userID uuid.UUID) ([]*Company, error)
- func (s *MockCompanyStore) SetMembershipStore(ms *MockMembershipStore)
- func (s *MockCompanyStore) Update(_ context.Context, c *Company) error
- type MockCrossWorkflowLinkStore
- func (s *MockCrossWorkflowLinkStore) Create(_ context.Context, l *CrossWorkflowLink) error
- func (s *MockCrossWorkflowLinkStore) Delete(_ context.Context, id uuid.UUID) error
- func (s *MockCrossWorkflowLinkStore) Get(_ context.Context, id uuid.UUID) (*CrossWorkflowLink, error)
- func (s *MockCrossWorkflowLinkStore) List(_ context.Context, f CrossWorkflowLinkFilter) ([]*CrossWorkflowLink, error)
- type MockExecutionStore
- func (s *MockExecutionStore) CountByStatus(_ context.Context, workflowID uuid.UUID) (map[ExecutionStatus]int, error)
- func (s *MockExecutionStore) CreateExecution(_ context.Context, e *WorkflowExecution) error
- func (s *MockExecutionStore) CreateStep(_ context.Context, step *ExecutionStep) error
- func (s *MockExecutionStore) GetExecution(_ context.Context, id uuid.UUID) (*WorkflowExecution, error)
- func (s *MockExecutionStore) ListExecutions(_ context.Context, f ExecutionFilter) ([]*WorkflowExecution, error)
- func (s *MockExecutionStore) ListSteps(_ context.Context, executionID uuid.UUID) ([]*ExecutionStep, error)
- func (s *MockExecutionStore) UpdateExecution(_ context.Context, e *WorkflowExecution) error
- func (s *MockExecutionStore) UpdateStep(_ context.Context, step *ExecutionStep) error
- type MockIAMStore
- func (s *MockIAMStore) CreateMapping(_ context.Context, m *IAMRoleMapping) error
- func (s *MockIAMStore) CreateProvider(_ context.Context, p *IAMProviderConfig) error
- func (s *MockIAMStore) DeleteMapping(_ context.Context, id uuid.UUID) error
- func (s *MockIAMStore) DeleteProvider(_ context.Context, id uuid.UUID) error
- func (s *MockIAMStore) GetMapping(_ context.Context, id uuid.UUID) (*IAMRoleMapping, error)
- func (s *MockIAMStore) GetProvider(_ context.Context, id uuid.UUID) (*IAMProviderConfig, error)
- func (s *MockIAMStore) ListMappings(_ context.Context, f IAMRoleMappingFilter) ([]*IAMRoleMapping, error)
- func (s *MockIAMStore) ListProviders(_ context.Context, f IAMProviderFilter) ([]*IAMProviderConfig, error)
- func (s *MockIAMStore) ResolveRole(_ context.Context, providerID uuid.UUID, externalID string, ...) (Role, error)
- func (s *MockIAMStore) UpdateProvider(_ context.Context, p *IAMProviderConfig) error
- type MockLogStore
- type MockMembershipStore
- func (s *MockMembershipStore) Create(_ context.Context, m *Membership) error
- func (s *MockMembershipStore) Delete(_ context.Context, id uuid.UUID) error
- func (s *MockMembershipStore) Get(_ context.Context, id uuid.UUID) (*Membership, error)
- func (s *MockMembershipStore) GetEffectiveRole(_ context.Context, userID, companyID uuid.UUID, projectID *uuid.UUID) (Role, error)
- func (s *MockMembershipStore) List(_ context.Context, f MembershipFilter) ([]*Membership, error)
- func (s *MockMembershipStore) Update(_ context.Context, m *Membership) error
- type MockProjectStore
- func (s *MockProjectStore) Create(_ context.Context, p *Project) error
- func (s *MockProjectStore) Delete(_ context.Context, id uuid.UUID) error
- func (s *MockProjectStore) Get(_ context.Context, id uuid.UUID) (*Project, error)
- func (s *MockProjectStore) GetBySlug(_ context.Context, companyID uuid.UUID, slug string) (*Project, error)
- func (s *MockProjectStore) List(_ context.Context, f ProjectFilter) ([]*Project, error)
- func (s *MockProjectStore) ListForUser(_ context.Context, userID uuid.UUID) ([]*Project, error)
- func (s *MockProjectStore) SetMembershipStore(ms *MockMembershipStore)
- func (s *MockProjectStore) Update(_ context.Context, p *Project) error
- type MockSessionStore
- func (s *MockSessionStore) Create(_ context.Context, sess *Session) error
- func (s *MockSessionStore) Delete(_ context.Context, id uuid.UUID) error
- func (s *MockSessionStore) DeleteExpired(_ context.Context) (int64, error)
- func (s *MockSessionStore) Get(_ context.Context, id uuid.UUID) (*Session, error)
- func (s *MockSessionStore) GetByToken(_ context.Context, token string) (*Session, error)
- func (s *MockSessionStore) List(_ context.Context, f SessionFilter) ([]*Session, error)
- func (s *MockSessionStore) Update(_ context.Context, sess *Session) error
- type MockUserStore
- func (s *MockUserStore) Create(_ context.Context, u *User) error
- func (s *MockUserStore) Delete(_ context.Context, id uuid.UUID) error
- func (s *MockUserStore) Get(_ context.Context, id uuid.UUID) (*User, error)
- func (s *MockUserStore) GetByEmail(_ context.Context, email string) (*User, error)
- func (s *MockUserStore) GetByOAuth(_ context.Context, provider OAuthProvider, oauthID string) (*User, error)
- func (s *MockUserStore) List(_ context.Context, f UserFilter) ([]*User, error)
- func (s *MockUserStore) Update(_ context.Context, u *User) error
- type MockWorkflowStore
- func (s *MockWorkflowStore) Create(_ context.Context, w *WorkflowRecord) error
- func (s *MockWorkflowStore) Delete(_ context.Context, id uuid.UUID) error
- func (s *MockWorkflowStore) Get(_ context.Context, id uuid.UUID) (*WorkflowRecord, error)
- func (s *MockWorkflowStore) GetBySlug(_ context.Context, projectID uuid.UUID, slug string) (*WorkflowRecord, error)
- func (s *MockWorkflowStore) GetVersion(_ context.Context, id uuid.UUID, version int) (*WorkflowRecord, error)
- func (s *MockWorkflowStore) List(_ context.Context, f WorkflowFilter) ([]*WorkflowRecord, error)
- func (s *MockWorkflowStore) ListVersions(_ context.Context, id uuid.UUID) ([]*WorkflowRecord, error)
- func (s *MockWorkflowStore) Update(_ context.Context, w *WorkflowRecord) error
- type OAuthProvider
- type Organization
- type OrganizationStore
- type PGAuditStore
- type PGCompanyStore
- func (s *PGCompanyStore) Create(ctx context.Context, c *Company) error
- func (s *PGCompanyStore) Delete(ctx context.Context, id uuid.UUID) error
- func (s *PGCompanyStore) Get(ctx context.Context, id uuid.UUID) (*Company, error)
- func (s *PGCompanyStore) GetBySlug(ctx context.Context, slug string) (*Company, error)
- func (s *PGCompanyStore) List(ctx context.Context, f CompanyFilter) ([]*Company, error)
- func (s *PGCompanyStore) ListForUser(ctx context.Context, userID uuid.UUID) ([]*Company, error)
- func (s *PGCompanyStore) Update(ctx context.Context, c *Company) error
- type PGConfig
- type PGCrossWorkflowLinkStore
- func (s *PGCrossWorkflowLinkStore) Create(ctx context.Context, l *CrossWorkflowLink) error
- func (s *PGCrossWorkflowLinkStore) Delete(ctx context.Context, id uuid.UUID) error
- func (s *PGCrossWorkflowLinkStore) Get(ctx context.Context, id uuid.UUID) (*CrossWorkflowLink, error)
- func (s *PGCrossWorkflowLinkStore) List(ctx context.Context, f CrossWorkflowLinkFilter) ([]*CrossWorkflowLink, error)
- type PGExecutionStore
- func (s *PGExecutionStore) CountByStatus(ctx context.Context, workflowID uuid.UUID) (map[ExecutionStatus]int, error)
- func (s *PGExecutionStore) CreateExecution(ctx context.Context, e *WorkflowExecution) error
- func (s *PGExecutionStore) CreateStep(ctx context.Context, step *ExecutionStep) error
- func (s *PGExecutionStore) GetExecution(ctx context.Context, id uuid.UUID) (*WorkflowExecution, error)
- func (s *PGExecutionStore) ListExecutions(ctx context.Context, f ExecutionFilter) ([]*WorkflowExecution, error)
- func (s *PGExecutionStore) ListSteps(ctx context.Context, executionID uuid.UUID) ([]*ExecutionStep, error)
- func (s *PGExecutionStore) UpdateExecution(ctx context.Context, e *WorkflowExecution) error
- func (s *PGExecutionStore) UpdateStep(ctx context.Context, step *ExecutionStep) error
- type PGIAMStore
- func (s *PGIAMStore) CreateMapping(ctx context.Context, m *IAMRoleMapping) error
- func (s *PGIAMStore) CreateProvider(ctx context.Context, p *IAMProviderConfig) error
- func (s *PGIAMStore) DeleteMapping(ctx context.Context, id uuid.UUID) error
- func (s *PGIAMStore) DeleteProvider(ctx context.Context, id uuid.UUID) error
- func (s *PGIAMStore) GetMapping(ctx context.Context, id uuid.UUID) (*IAMRoleMapping, error)
- func (s *PGIAMStore) GetProvider(ctx context.Context, id uuid.UUID) (*IAMProviderConfig, error)
- func (s *PGIAMStore) ListMappings(ctx context.Context, f IAMRoleMappingFilter) ([]*IAMRoleMapping, error)
- func (s *PGIAMStore) ListProviders(ctx context.Context, f IAMProviderFilter) ([]*IAMProviderConfig, error)
- func (s *PGIAMStore) ResolveRole(ctx context.Context, providerID uuid.UUID, externalID string, ...) (Role, error)
- func (s *PGIAMStore) UpdateProvider(ctx context.Context, p *IAMProviderConfig) error
- type PGLogStore
- type PGMembershipStore
- func (s *PGMembershipStore) Create(ctx context.Context, m *Membership) error
- func (s *PGMembershipStore) Delete(ctx context.Context, id uuid.UUID) error
- func (s *PGMembershipStore) Get(ctx context.Context, id uuid.UUID) (*Membership, error)
- func (s *PGMembershipStore) GetEffectiveRole(ctx context.Context, userID, companyID uuid.UUID, projectID *uuid.UUID) (Role, error)
- func (s *PGMembershipStore) List(ctx context.Context, f MembershipFilter) ([]*Membership, error)
- func (s *PGMembershipStore) Update(ctx context.Context, m *Membership) error
- type PGProjectStore
- func (s *PGProjectStore) Create(ctx context.Context, p *Project) error
- func (s *PGProjectStore) Delete(ctx context.Context, id uuid.UUID) error
- func (s *PGProjectStore) Get(ctx context.Context, id uuid.UUID) (*Project, error)
- func (s *PGProjectStore) GetBySlug(ctx context.Context, companyID uuid.UUID, slug string) (*Project, error)
- func (s *PGProjectStore) List(ctx context.Context, f ProjectFilter) ([]*Project, error)
- func (s *PGProjectStore) ListForUser(ctx context.Context, userID uuid.UUID) ([]*Project, error)
- func (s *PGProjectStore) Update(ctx context.Context, p *Project) error
- type PGSessionStore
- func (s *PGSessionStore) Create(ctx context.Context, sess *Session) error
- func (s *PGSessionStore) Delete(ctx context.Context, id uuid.UUID) error
- func (s *PGSessionStore) DeleteExpired(ctx context.Context) (int64, error)
- func (s *PGSessionStore) Get(ctx context.Context, id uuid.UUID) (*Session, error)
- func (s *PGSessionStore) GetByToken(ctx context.Context, token string) (*Session, error)
- func (s *PGSessionStore) List(ctx context.Context, f SessionFilter) ([]*Session, error)
- func (s *PGSessionStore) Update(ctx context.Context, sess *Session) error
- type PGStore
- func (s *PGStore) Audit() AuditStore
- func (s *PGStore) Close()
- func (s *PGStore) Companies() CompanyStore
- func (s *PGStore) CrossWorkflowLinks() CrossWorkflowLinkStore
- func (s *PGStore) Executions() ExecutionStore
- func (s *PGStore) IAM() IAMStore
- func (s *PGStore) Logs() LogStore
- func (s *PGStore) Memberships() MembershipStore
- func (s *PGStore) Pool() *pgxpool.Pool
- func (s *PGStore) Projects() ProjectStore
- func (s *PGStore) Sessions() SessionStore
- func (s *PGStore) Users() UserStore
- func (s *PGStore) Workflows() WorkflowStore
- type PGUserStore
- func (s *PGUserStore) Create(ctx context.Context, u *User) error
- func (s *PGUserStore) Delete(ctx context.Context, id uuid.UUID) error
- func (s *PGUserStore) Get(ctx context.Context, id uuid.UUID) (*User, error)
- func (s *PGUserStore) GetByEmail(ctx context.Context, email string) (*User, error)
- func (s *PGUserStore) GetByOAuth(ctx context.Context, provider OAuthProvider, oauthID string) (*User, error)
- func (s *PGUserStore) List(ctx context.Context, f UserFilter) ([]*User, error)
- func (s *PGUserStore) Update(ctx context.Context, u *User) error
- type PGWorkflowStore
- func (s *PGWorkflowStore) Create(ctx context.Context, w *WorkflowRecord) error
- func (s *PGWorkflowStore) Delete(ctx context.Context, id uuid.UUID) error
- func (s *PGWorkflowStore) Get(ctx context.Context, id uuid.UUID) (*WorkflowRecord, error)
- func (s *PGWorkflowStore) GetBySlug(ctx context.Context, projectID uuid.UUID, slug string) (*WorkflowRecord, error)
- func (s *PGWorkflowStore) GetVersion(ctx context.Context, id uuid.UUID, version int) (*WorkflowRecord, error)
- func (s *PGWorkflowStore) List(ctx context.Context, f WorkflowFilter) ([]*WorkflowRecord, error)
- func (s *PGWorkflowStore) ListVersions(ctx context.Context, id uuid.UUID) ([]*WorkflowRecord, error)
- func (s *PGWorkflowStore) Update(ctx context.Context, w *WorkflowRecord) error
- type Pagination
- type Project
- type ProjectFilter
- type ProjectStore
- type Role
- type Session
- type SessionFilter
- type SessionStore
- type StepStatus
- type User
- type UserFilter
- type UserStore
- type WorkflowExecution
- type WorkflowFilter
- type WorkflowRecord
- type WorkflowStatus
- type WorkflowStore
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotFound = errors.New("not found") ErrDuplicate = errors.New("duplicate entry") ErrConflict = errors.New("conflict") ErrForbidden = errors.New("forbidden") )
Sentinel errors for store operations.
var ValidRoles = map[Role]bool{ RoleOwner: true, RoleAdmin: true, RoleEditor: true, RoleViewer: true, }
ValidRoles is the set of valid role values.
var ValidWorkflowStatuses = map[WorkflowStatus]bool{ WorkflowStatusDraft: true, WorkflowStatusActive: true, WorkflowStatusStopped: true, WorkflowStatusError: true, }
ValidWorkflowStatuses is the set of valid workflow status values.
Functions ¶
This section is empty.
Types ¶
type AuditEntry ¶
type AuditEntry struct {
ID int64 `json:"id"`
UserID *uuid.UUID `json:"user_id,omitempty"`
Action string `json:"action"`
ResourceType string `json:"resource_type"`
ResourceID *uuid.UUID `json:"resource_id,omitempty"`
Details json.RawMessage `json:"details,omitempty"`
IPAddress string `json:"ip_address,omitempty"`
UserAgent string `json:"user_agent,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
AuditEntry represents an entry in the audit log.
type AuditFilter ¶
type AuditFilter struct {
UserID *uuid.UUID
Action string
ResourceType string
ResourceID *uuid.UUID
Since *time.Time
Until *time.Time
Pagination Pagination
}
AuditFilter specifies criteria for querying audit entries.
type AuditStore ¶
type AuditStore interface {
// Record adds an audit entry.
Record(ctx context.Context, e *AuditEntry) error
// Query returns audit entries matching the filter.
Query(ctx context.Context, f AuditFilter) ([]*AuditEntry, error)
}
AuditStore defines persistence operations for audit log entries.
type AuthSessionStoreAdapter ¶
type AuthSessionStoreAdapter struct {
// contains filtered or unexported fields
}
AuthSessionStoreAdapter adapts a store.SessionStore to the auth.SessionStore interface.
func NewAuthSessionStoreAdapter ¶
func NewAuthSessionStoreAdapter(store SessionStore) *AuthSessionStoreAdapter
NewAuthSessionStoreAdapter creates a new adapter.
func (*AuthSessionStoreAdapter) Cleanup ¶
func (a *AuthSessionStoreAdapter) Cleanup(ctx context.Context) error
func (*AuthSessionStoreAdapter) Delete ¶
func (a *AuthSessionStoreAdapter) Delete(ctx context.Context, sessionID string) error
type AuthUserStoreAdapter ¶
type AuthUserStoreAdapter struct {
// contains filtered or unexported fields
}
AuthUserStoreAdapter adapts a store.UserStore to the auth.UserStore interface.
func NewAuthUserStoreAdapter ¶
func NewAuthUserStoreAdapter(store UserStore) *AuthUserStoreAdapter
NewAuthUserStoreAdapter creates a new adapter.
func (*AuthUserStoreAdapter) CreateUser ¶
func (*AuthUserStoreAdapter) DeleteUser ¶
func (a *AuthUserStoreAdapter) DeleteUser(ctx context.Context, userID string) error
func (*AuthUserStoreAdapter) GetUserByEmail ¶
func (*AuthUserStoreAdapter) UpdateUser ¶
type Company ¶
type Company struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
OwnerID uuid.UUID `json:"owner_id"`
Metadata json.RawMessage `json:"metadata,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Company represents a top-level organization or company.
type CompanyFilter ¶
type CompanyFilter struct {
OwnerID *uuid.UUID
Slug string
Pagination Pagination
}
CompanyFilter specifies criteria for listing companies.
type CompanyStore ¶
type CompanyStore interface {
Create(ctx context.Context, c *Company) error
Get(ctx context.Context, id uuid.UUID) (*Company, error)
GetBySlug(ctx context.Context, slug string) (*Company, error)
Update(ctx context.Context, c *Company) error
Delete(ctx context.Context, id uuid.UUID) error
List(ctx context.Context, f CompanyFilter) ([]*Company, error)
ListForUser(ctx context.Context, userID uuid.UUID) ([]*Company, error)
}
CompanyStore defines persistence operations for companies.
type CrossWorkflowLink ¶
type CrossWorkflowLink struct {
ID uuid.UUID `json:"id"`
SourceWorkflowID uuid.UUID `json:"source_workflow_id"`
TargetWorkflowID uuid.UUID `json:"target_workflow_id"`
LinkType string `json:"link_type"`
Config json.RawMessage `json:"config,omitempty"`
CreatedBy uuid.UUID `json:"created_by"`
CreatedAt time.Time `json:"created_at"`
}
CrossWorkflowLink represents a directed link between two workflows.
type CrossWorkflowLinkFilter ¶
type CrossWorkflowLinkFilter struct {
SourceWorkflowID *uuid.UUID
TargetWorkflowID *uuid.UUID
LinkType string
Pagination Pagination
}
CrossWorkflowLinkFilter specifies criteria for listing cross-workflow links.
type CrossWorkflowLinkStore ¶
type CrossWorkflowLinkStore interface {
Create(ctx context.Context, l *CrossWorkflowLink) error
Get(ctx context.Context, id uuid.UUID) (*CrossWorkflowLink, error)
Delete(ctx context.Context, id uuid.UUID) error
List(ctx context.Context, f CrossWorkflowLinkFilter) ([]*CrossWorkflowLink, error)
}
CrossWorkflowLinkStore defines persistence operations for cross-workflow links.
type ExecutionFilter ¶
type ExecutionFilter struct {
WorkflowID *uuid.UUID
Status ExecutionStatus
Since *time.Time
Until *time.Time
Pagination Pagination
}
ExecutionFilter specifies criteria for listing executions.
type ExecutionLog ¶
type ExecutionLog struct {
ID int64 `json:"id"`
WorkflowID uuid.UUID `json:"workflow_id"`
ExecutionID *uuid.UUID `json:"execution_id,omitempty"`
Level LogLevel `json:"level"`
Message string `json:"message"`
ModuleName string `json:"module_name,omitempty"`
Fields json.RawMessage `json:"fields,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
ExecutionLog represents a log entry for a workflow execution.
type ExecutionStatus ¶
type ExecutionStatus string
ExecutionStatus represents the status of a workflow execution.
const ( ExecutionStatusPending ExecutionStatus = "pending" ExecutionStatusRunning ExecutionStatus = "running" ExecutionStatusCompleted ExecutionStatus = "completed" ExecutionStatusFailed ExecutionStatus = "failed" ExecutionStatusCancelled ExecutionStatus = "cancelled" )
type ExecutionStep ¶
type ExecutionStep struct {
ID uuid.UUID `json:"id"`
ExecutionID uuid.UUID `json:"execution_id"`
StepName string `json:"step_name"`
StepType string `json:"step_type"`
InputData json.RawMessage `json:"input_data,omitempty"`
OutputData json.RawMessage `json:"output_data,omitempty"`
Status StepStatus `json:"status"`
ErrorMessage string `json:"error_message,omitempty"`
StartedAt *time.Time `json:"started_at,omitempty"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
DurationMs *int64 `json:"duration_ms,omitempty"`
SequenceNum int `json:"sequence_num"`
Metadata json.RawMessage `json:"metadata,omitempty"`
}
ExecutionStep represents a single step within a workflow execution.
type ExecutionStore ¶
type ExecutionStore interface {
// CreateExecution creates a new workflow execution record.
CreateExecution(ctx context.Context, e *WorkflowExecution) error
// GetExecution retrieves an execution by ID.
GetExecution(ctx context.Context, id uuid.UUID) (*WorkflowExecution, error)
// UpdateExecution updates an execution record.
UpdateExecution(ctx context.Context, e *WorkflowExecution) error
// ListExecutions lists executions matching the filter.
ListExecutions(ctx context.Context, f ExecutionFilter) ([]*WorkflowExecution, error)
// CreateStep creates a new execution step.
CreateStep(ctx context.Context, s *ExecutionStep) error
// UpdateStep updates an execution step.
UpdateStep(ctx context.Context, s *ExecutionStep) error
// ListSteps lists steps for an execution.
ListSteps(ctx context.Context, executionID uuid.UUID) ([]*ExecutionStep, error)
// CountByStatus returns execution counts grouped by status for a workflow.
CountByStatus(ctx context.Context, workflowID uuid.UUID) (map[ExecutionStatus]int, error)
}
ExecutionStore defines persistence operations for workflow executions.
type IAMProviderConfig ¶
type IAMProviderConfig struct {
ID uuid.UUID `json:"id"`
CompanyID uuid.UUID `json:"company_id"`
ProviderType IAMProviderType `json:"provider_type"`
Name string `json:"name"`
Config json.RawMessage `json:"config"`
Enabled bool `json:"enabled"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
IAMProviderConfig represents a configured IAM provider for a company.
type IAMProviderFilter ¶
type IAMProviderFilter struct {
CompanyID *uuid.UUID
ProviderType IAMProviderType
Enabled *bool
Pagination Pagination
}
IAMProviderFilter specifies criteria for listing IAM providers.
type IAMProviderType ¶
type IAMProviderType string
IAMProviderType represents the type of an IAM provider.
const ( IAMProviderAWS IAMProviderType = "aws_iam" IAMProviderKubernetes IAMProviderType = "kubernetes" IAMProviderOIDC IAMProviderType = "oidc" IAMProviderSAML IAMProviderType = "saml" IAMProviderLDAP IAMProviderType = "ldap" IAMProviderCustom IAMProviderType = "custom" )
type IAMRoleMapping ¶
type IAMRoleMapping struct {
ID uuid.UUID `json:"id"`
ProviderID uuid.UUID `json:"provider_id"`
ExternalIdentifier string `json:"external_identifier"`
ResourceType string `json:"resource_type"`
ResourceID uuid.UUID `json:"resource_id"`
Role Role `json:"role"`
CreatedAt time.Time `json:"created_at"`
}
IAMRoleMapping maps an external identity to a role on a resource.
type IAMRoleMappingFilter ¶
type IAMRoleMappingFilter struct {
ProviderID *uuid.UUID
ExternalIdentifier string
ResourceType string
ResourceID *uuid.UUID
Pagination Pagination
}
IAMRoleMappingFilter specifies criteria for listing IAM role mappings.
type IAMStore ¶
type IAMStore interface {
// CreateProvider creates a new IAM provider config.
CreateProvider(ctx context.Context, p *IAMProviderConfig) error
// GetProvider retrieves an IAM provider by ID.
GetProvider(ctx context.Context, id uuid.UUID) (*IAMProviderConfig, error)
// UpdateProvider updates an IAM provider config.
UpdateProvider(ctx context.Context, p *IAMProviderConfig) error
// DeleteProvider deletes an IAM provider config.
DeleteProvider(ctx context.Context, id uuid.UUID) error
// ListProviders lists IAM providers matching the filter.
ListProviders(ctx context.Context, f IAMProviderFilter) ([]*IAMProviderConfig, error)
// CreateMapping creates a new IAM role mapping.
CreateMapping(ctx context.Context, m *IAMRoleMapping) error
// GetMapping retrieves an IAM role mapping by ID.
GetMapping(ctx context.Context, id uuid.UUID) (*IAMRoleMapping, error)
// DeleteMapping deletes an IAM role mapping.
DeleteMapping(ctx context.Context, id uuid.UUID) error
// ListMappings lists IAM role mappings matching the filter.
ListMappings(ctx context.Context, f IAMRoleMappingFilter) ([]*IAMRoleMapping, error)
// ResolveRole resolves the role for an external identifier on a resource.
ResolveRole(ctx context.Context, providerID uuid.UUID, externalID string, resourceType string, resourceID uuid.UUID) (Role, error)
}
IAMStore defines persistence operations for IAM providers and role mappings.
type LogFilter ¶
type LogFilter struct {
WorkflowID *uuid.UUID
ExecutionID *uuid.UUID
Level LogLevel
ModuleName string
Since *time.Time
Until *time.Time
Pagination Pagination
}
LogFilter specifies criteria for querying logs.
type LogStore ¶
type LogStore interface {
// Append adds a log entry.
Append(ctx context.Context, l *ExecutionLog) error
// Query returns log entries matching the filter.
Query(ctx context.Context, f LogFilter) ([]*ExecutionLog, error)
// CountByLevel returns log counts grouped by level for a workflow.
CountByLevel(ctx context.Context, workflowID uuid.UUID) (map[LogLevel]int, error)
}
LogStore defines persistence operations for execution logs.
type Membership ¶
type Membership struct {
ID uuid.UUID `json:"id"`
UserID uuid.UUID `json:"user_id"`
CompanyID uuid.UUID `json:"company_id"`
ProjectID *uuid.UUID `json:"project_id,omitempty"` // nil means company-level membership
Role Role `json:"role"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Membership represents a user's role within a company or project.
type MembershipFilter ¶
type MembershipFilter struct {
UserID *uuid.UUID
CompanyID *uuid.UUID
ProjectID *uuid.UUID
Role Role
Pagination Pagination
}
MembershipFilter specifies criteria for listing memberships.
type MembershipStore ¶
type MembershipStore interface {
Create(ctx context.Context, m *Membership) error
Get(ctx context.Context, id uuid.UUID) (*Membership, error)
Update(ctx context.Context, m *Membership) error
Delete(ctx context.Context, id uuid.UUID) error
List(ctx context.Context, f MembershipFilter) ([]*Membership, error)
// GetEffectiveRole resolves the effective role for a user in a project,
// cascading from company-level if no project-level membership exists.
GetEffectiveRole(ctx context.Context, userID, companyID uuid.UUID, projectID *uuid.UUID) (Role, error)
}
MembershipStore defines persistence operations for memberships.
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator applies SQL migrations from the embedded filesystem.
func NewMigrator ¶
NewMigrator creates a new Migrator.
type MockAuditStore ¶
type MockAuditStore struct {
// contains filtered or unexported fields
}
MockAuditStore is an in-memory implementation of AuditStore for testing.
func NewMockAuditStore ¶
func NewMockAuditStore() *MockAuditStore
NewMockAuditStore creates a new MockAuditStore.
func (*MockAuditStore) Query ¶
func (s *MockAuditStore) Query(_ context.Context, f AuditFilter) ([]*AuditEntry, error)
func (*MockAuditStore) Record ¶
func (s *MockAuditStore) Record(_ context.Context, e *AuditEntry) error
type MockCompanyStore ¶
type MockCompanyStore struct {
// contains filtered or unexported fields
}
MockCompanyStore is an in-memory implementation of CompanyStore for testing.
func NewMockCompanyStore ¶
func NewMockCompanyStore() *MockCompanyStore
NewMockCompanyStore creates a new MockCompanyStore.
func (*MockCompanyStore) Create ¶
func (s *MockCompanyStore) Create(_ context.Context, c *Company) error
func (*MockCompanyStore) List ¶
func (s *MockCompanyStore) List(_ context.Context, f CompanyFilter) ([]*Company, error)
func (*MockCompanyStore) ListForUser ¶
func (*MockCompanyStore) SetMembershipStore ¶
func (s *MockCompanyStore) SetMembershipStore(ms *MockMembershipStore)
SetMembershipStore links a MockMembershipStore for ListForUser support.
type MockCrossWorkflowLinkStore ¶
type MockCrossWorkflowLinkStore struct {
// contains filtered or unexported fields
}
MockCrossWorkflowLinkStore is an in-memory implementation of CrossWorkflowLinkStore for testing.
func NewMockCrossWorkflowLinkStore ¶
func NewMockCrossWorkflowLinkStore() *MockCrossWorkflowLinkStore
NewMockCrossWorkflowLinkStore creates a new MockCrossWorkflowLinkStore.
func (*MockCrossWorkflowLinkStore) Create ¶
func (s *MockCrossWorkflowLinkStore) Create(_ context.Context, l *CrossWorkflowLink) error
func (*MockCrossWorkflowLinkStore) Get ¶
func (s *MockCrossWorkflowLinkStore) Get(_ context.Context, id uuid.UUID) (*CrossWorkflowLink, error)
func (*MockCrossWorkflowLinkStore) List ¶
func (s *MockCrossWorkflowLinkStore) List(_ context.Context, f CrossWorkflowLinkFilter) ([]*CrossWorkflowLink, error)
type MockExecutionStore ¶
type MockExecutionStore struct {
// contains filtered or unexported fields
}
MockExecutionStore is an in-memory implementation of ExecutionStore for testing.
func NewMockExecutionStore ¶
func NewMockExecutionStore() *MockExecutionStore
NewMockExecutionStore creates a new MockExecutionStore.
func (*MockExecutionStore) CountByStatus ¶
func (s *MockExecutionStore) CountByStatus(_ context.Context, workflowID uuid.UUID) (map[ExecutionStatus]int, error)
func (*MockExecutionStore) CreateExecution ¶
func (s *MockExecutionStore) CreateExecution(_ context.Context, e *WorkflowExecution) error
func (*MockExecutionStore) CreateStep ¶
func (s *MockExecutionStore) CreateStep(_ context.Context, step *ExecutionStep) error
func (*MockExecutionStore) GetExecution ¶
func (s *MockExecutionStore) GetExecution(_ context.Context, id uuid.UUID) (*WorkflowExecution, error)
func (*MockExecutionStore) ListExecutions ¶
func (s *MockExecutionStore) ListExecutions(_ context.Context, f ExecutionFilter) ([]*WorkflowExecution, error)
func (*MockExecutionStore) ListSteps ¶
func (s *MockExecutionStore) ListSteps(_ context.Context, executionID uuid.UUID) ([]*ExecutionStep, error)
func (*MockExecutionStore) UpdateExecution ¶
func (s *MockExecutionStore) UpdateExecution(_ context.Context, e *WorkflowExecution) error
func (*MockExecutionStore) UpdateStep ¶
func (s *MockExecutionStore) UpdateStep(_ context.Context, step *ExecutionStep) error
type MockIAMStore ¶
type MockIAMStore struct {
// contains filtered or unexported fields
}
MockIAMStore is an in-memory implementation of IAMStore for testing.
func NewMockIAMStore ¶
func NewMockIAMStore() *MockIAMStore
NewMockIAMStore creates a new MockIAMStore.
func (*MockIAMStore) CreateMapping ¶
func (s *MockIAMStore) CreateMapping(_ context.Context, m *IAMRoleMapping) error
func (*MockIAMStore) CreateProvider ¶
func (s *MockIAMStore) CreateProvider(_ context.Context, p *IAMProviderConfig) error
func (*MockIAMStore) DeleteMapping ¶
func (*MockIAMStore) DeleteProvider ¶
func (*MockIAMStore) GetMapping ¶
func (s *MockIAMStore) GetMapping(_ context.Context, id uuid.UUID) (*IAMRoleMapping, error)
func (*MockIAMStore) GetProvider ¶
func (s *MockIAMStore) GetProvider(_ context.Context, id uuid.UUID) (*IAMProviderConfig, error)
func (*MockIAMStore) ListMappings ¶
func (s *MockIAMStore) ListMappings(_ context.Context, f IAMRoleMappingFilter) ([]*IAMRoleMapping, error)
func (*MockIAMStore) ListProviders ¶
func (s *MockIAMStore) ListProviders(_ context.Context, f IAMProviderFilter) ([]*IAMProviderConfig, error)
func (*MockIAMStore) ResolveRole ¶
func (*MockIAMStore) UpdateProvider ¶
func (s *MockIAMStore) UpdateProvider(_ context.Context, p *IAMProviderConfig) error
type MockLogStore ¶
type MockLogStore struct {
// contains filtered or unexported fields
}
MockLogStore is an in-memory implementation of LogStore for testing.
func NewMockLogStore ¶
func NewMockLogStore() *MockLogStore
NewMockLogStore creates a new MockLogStore.
func (*MockLogStore) Append ¶
func (s *MockLogStore) Append(_ context.Context, l *ExecutionLog) error
func (*MockLogStore) CountByLevel ¶
func (*MockLogStore) Query ¶
func (s *MockLogStore) Query(_ context.Context, f LogFilter) ([]*ExecutionLog, error)
type MockMembershipStore ¶
type MockMembershipStore struct {
// contains filtered or unexported fields
}
MockMembershipStore is an in-memory implementation of MembershipStore for testing.
func NewMockMembershipStore ¶
func NewMockMembershipStore() *MockMembershipStore
NewMockMembershipStore creates a new MockMembershipStore.
func (*MockMembershipStore) Create ¶
func (s *MockMembershipStore) Create(_ context.Context, m *Membership) error
func (*MockMembershipStore) Get ¶
func (s *MockMembershipStore) Get(_ context.Context, id uuid.UUID) (*Membership, error)
func (*MockMembershipStore) GetEffectiveRole ¶
func (*MockMembershipStore) List ¶
func (s *MockMembershipStore) List(_ context.Context, f MembershipFilter) ([]*Membership, error)
func (*MockMembershipStore) Update ¶
func (s *MockMembershipStore) Update(_ context.Context, m *Membership) error
type MockProjectStore ¶
type MockProjectStore struct {
// contains filtered or unexported fields
}
MockProjectStore is an in-memory implementation of ProjectStore for testing.
func NewMockProjectStore ¶
func NewMockProjectStore() *MockProjectStore
NewMockProjectStore creates a new MockProjectStore.
func (*MockProjectStore) Create ¶
func (s *MockProjectStore) Create(_ context.Context, p *Project) error
func (*MockProjectStore) List ¶
func (s *MockProjectStore) List(_ context.Context, f ProjectFilter) ([]*Project, error)
func (*MockProjectStore) ListForUser ¶
func (*MockProjectStore) SetMembershipStore ¶
func (s *MockProjectStore) SetMembershipStore(ms *MockMembershipStore)
SetMembershipStore links a MockMembershipStore for ListForUser support.
type MockSessionStore ¶
type MockSessionStore struct {
// contains filtered or unexported fields
}
MockSessionStore is an in-memory implementation of SessionStore for testing.
func NewMockSessionStore ¶
func NewMockSessionStore() *MockSessionStore
NewMockSessionStore creates a new MockSessionStore.
func (*MockSessionStore) Create ¶
func (s *MockSessionStore) Create(_ context.Context, sess *Session) error
func (*MockSessionStore) DeleteExpired ¶
func (s *MockSessionStore) DeleteExpired(_ context.Context) (int64, error)
func (*MockSessionStore) GetByToken ¶
func (*MockSessionStore) List ¶
func (s *MockSessionStore) List(_ context.Context, f SessionFilter) ([]*Session, error)
type MockUserStore ¶
type MockUserStore struct {
// contains filtered or unexported fields
}
MockUserStore is an in-memory implementation of UserStore for testing.
func NewMockUserStore ¶
func NewMockUserStore() *MockUserStore
NewMockUserStore creates a new MockUserStore.
func (*MockUserStore) GetByEmail ¶
func (*MockUserStore) GetByOAuth ¶
func (s *MockUserStore) GetByOAuth(_ context.Context, provider OAuthProvider, oauthID string) (*User, error)
func (*MockUserStore) List ¶
func (s *MockUserStore) List(_ context.Context, f UserFilter) ([]*User, error)
type MockWorkflowStore ¶
type MockWorkflowStore struct {
// contains filtered or unexported fields
}
MockWorkflowStore is an in-memory implementation of WorkflowStore for testing.
func NewMockWorkflowStore ¶
func NewMockWorkflowStore() *MockWorkflowStore
NewMockWorkflowStore creates a new MockWorkflowStore.
func (*MockWorkflowStore) Create ¶
func (s *MockWorkflowStore) Create(_ context.Context, w *WorkflowRecord) error
func (*MockWorkflowStore) Get ¶
func (s *MockWorkflowStore) Get(_ context.Context, id uuid.UUID) (*WorkflowRecord, error)
func (*MockWorkflowStore) GetBySlug ¶
func (s *MockWorkflowStore) GetBySlug(_ context.Context, projectID uuid.UUID, slug string) (*WorkflowRecord, error)
func (*MockWorkflowStore) GetVersion ¶
func (s *MockWorkflowStore) GetVersion(_ context.Context, id uuid.UUID, version int) (*WorkflowRecord, error)
func (*MockWorkflowStore) List ¶
func (s *MockWorkflowStore) List(_ context.Context, f WorkflowFilter) ([]*WorkflowRecord, error)
func (*MockWorkflowStore) ListVersions ¶
func (s *MockWorkflowStore) ListVersions(_ context.Context, id uuid.UUID) ([]*WorkflowRecord, error)
func (*MockWorkflowStore) Update ¶
func (s *MockWorkflowStore) Update(_ context.Context, w *WorkflowRecord) error
type OAuthProvider ¶
type OAuthProvider string
OAuthProvider represents the provider for an OAuth connection.
const ( OAuthProviderGitHub OAuthProvider = "github" OAuthProviderGoogle OAuthProvider = "google" )
type Organization ¶
type Organization = Company
Organization is an alias for Company for code clarity where "organization" terminology is preferred.
type OrganizationStore ¶
type OrganizationStore = CompanyStore
OrganizationStore is an alias for CompanyStore.
type PGAuditStore ¶
type PGAuditStore struct {
// contains filtered or unexported fields
}
PGAuditStore implements AuditStore backed by PostgreSQL.
func (*PGAuditStore) Query ¶
func (s *PGAuditStore) Query(ctx context.Context, f AuditFilter) ([]*AuditEntry, error)
func (*PGAuditStore) Record ¶
func (s *PGAuditStore) Record(ctx context.Context, e *AuditEntry) error
type PGCompanyStore ¶
type PGCompanyStore struct {
// contains filtered or unexported fields
}
PGCompanyStore implements CompanyStore backed by PostgreSQL.
func (*PGCompanyStore) Create ¶
func (s *PGCompanyStore) Create(ctx context.Context, c *Company) error
func (*PGCompanyStore) List ¶
func (s *PGCompanyStore) List(ctx context.Context, f CompanyFilter) ([]*Company, error)
func (*PGCompanyStore) ListForUser ¶
type PGConfig ¶
type PGConfig struct {
URL string `yaml:"url" json:"url"`
MaxConns int32 `yaml:"max_conns" json:"max_conns"`
MinConns int32 `yaml:"min_conns" json:"min_conns"`
MaxConnIdleTime string `yaml:"max_conn_idle_time" json:"max_conn_idle_time"`
}
PGConfig holds PostgreSQL connection configuration.
type PGCrossWorkflowLinkStore ¶
type PGCrossWorkflowLinkStore struct {
// contains filtered or unexported fields
}
PGCrossWorkflowLinkStore implements CrossWorkflowLinkStore backed by PostgreSQL.
func (*PGCrossWorkflowLinkStore) Create ¶
func (s *PGCrossWorkflowLinkStore) Create(ctx context.Context, l *CrossWorkflowLink) error
func (*PGCrossWorkflowLinkStore) Get ¶
func (s *PGCrossWorkflowLinkStore) Get(ctx context.Context, id uuid.UUID) (*CrossWorkflowLink, error)
func (*PGCrossWorkflowLinkStore) List ¶
func (s *PGCrossWorkflowLinkStore) List(ctx context.Context, f CrossWorkflowLinkFilter) ([]*CrossWorkflowLink, error)
type PGExecutionStore ¶
type PGExecutionStore struct {
// contains filtered or unexported fields
}
PGExecutionStore implements ExecutionStore backed by PostgreSQL.
func (*PGExecutionStore) CountByStatus ¶
func (s *PGExecutionStore) CountByStatus(ctx context.Context, workflowID uuid.UUID) (map[ExecutionStatus]int, error)
func (*PGExecutionStore) CreateExecution ¶
func (s *PGExecutionStore) CreateExecution(ctx context.Context, e *WorkflowExecution) error
func (*PGExecutionStore) CreateStep ¶
func (s *PGExecutionStore) CreateStep(ctx context.Context, step *ExecutionStep) error
func (*PGExecutionStore) GetExecution ¶
func (s *PGExecutionStore) GetExecution(ctx context.Context, id uuid.UUID) (*WorkflowExecution, error)
func (*PGExecutionStore) ListExecutions ¶
func (s *PGExecutionStore) ListExecutions(ctx context.Context, f ExecutionFilter) ([]*WorkflowExecution, error)
func (*PGExecutionStore) ListSteps ¶
func (s *PGExecutionStore) ListSteps(ctx context.Context, executionID uuid.UUID) ([]*ExecutionStep, error)
func (*PGExecutionStore) UpdateExecution ¶
func (s *PGExecutionStore) UpdateExecution(ctx context.Context, e *WorkflowExecution) error
func (*PGExecutionStore) UpdateStep ¶
func (s *PGExecutionStore) UpdateStep(ctx context.Context, step *ExecutionStep) error
type PGIAMStore ¶
type PGIAMStore struct {
// contains filtered or unexported fields
}
PGIAMStore implements IAMStore backed by PostgreSQL.
func (*PGIAMStore) CreateMapping ¶
func (s *PGIAMStore) CreateMapping(ctx context.Context, m *IAMRoleMapping) error
func (*PGIAMStore) CreateProvider ¶
func (s *PGIAMStore) CreateProvider(ctx context.Context, p *IAMProviderConfig) error
func (*PGIAMStore) DeleteMapping ¶
func (*PGIAMStore) DeleteProvider ¶
func (*PGIAMStore) GetMapping ¶
func (s *PGIAMStore) GetMapping(ctx context.Context, id uuid.UUID) (*IAMRoleMapping, error)
func (*PGIAMStore) GetProvider ¶
func (s *PGIAMStore) GetProvider(ctx context.Context, id uuid.UUID) (*IAMProviderConfig, error)
func (*PGIAMStore) ListMappings ¶
func (s *PGIAMStore) ListMappings(ctx context.Context, f IAMRoleMappingFilter) ([]*IAMRoleMapping, error)
func (*PGIAMStore) ListProviders ¶
func (s *PGIAMStore) ListProviders(ctx context.Context, f IAMProviderFilter) ([]*IAMProviderConfig, error)
func (*PGIAMStore) ResolveRole ¶
func (*PGIAMStore) UpdateProvider ¶
func (s *PGIAMStore) UpdateProvider(ctx context.Context, p *IAMProviderConfig) error
type PGLogStore ¶
type PGLogStore struct {
// contains filtered or unexported fields
}
PGLogStore implements LogStore backed by PostgreSQL.
func (*PGLogStore) Append ¶
func (s *PGLogStore) Append(ctx context.Context, l *ExecutionLog) error
func (*PGLogStore) CountByLevel ¶
func (*PGLogStore) Query ¶
func (s *PGLogStore) Query(ctx context.Context, f LogFilter) ([]*ExecutionLog, error)
type PGMembershipStore ¶
type PGMembershipStore struct {
// contains filtered or unexported fields
}
PGMembershipStore implements MembershipStore backed by PostgreSQL.
func (*PGMembershipStore) Create ¶
func (s *PGMembershipStore) Create(ctx context.Context, m *Membership) error
func (*PGMembershipStore) Get ¶
func (s *PGMembershipStore) Get(ctx context.Context, id uuid.UUID) (*Membership, error)
func (*PGMembershipStore) GetEffectiveRole ¶
func (s *PGMembershipStore) GetEffectiveRole(ctx context.Context, userID, companyID uuid.UUID, projectID *uuid.UUID) (Role, error)
GetEffectiveRole resolves the effective role for a user. If projectID is non-nil, it first checks for a project-level membership; if none is found it falls back to the company-level membership.
func (*PGMembershipStore) List ¶
func (s *PGMembershipStore) List(ctx context.Context, f MembershipFilter) ([]*Membership, error)
func (*PGMembershipStore) Update ¶
func (s *PGMembershipStore) Update(ctx context.Context, m *Membership) error
type PGProjectStore ¶
type PGProjectStore struct {
// contains filtered or unexported fields
}
PGProjectStore implements ProjectStore backed by PostgreSQL.
func (*PGProjectStore) Create ¶
func (s *PGProjectStore) Create(ctx context.Context, p *Project) error
func (*PGProjectStore) List ¶
func (s *PGProjectStore) List(ctx context.Context, f ProjectFilter) ([]*Project, error)
func (*PGProjectStore) ListForUser ¶
type PGSessionStore ¶
type PGSessionStore struct {
// contains filtered or unexported fields
}
PGSessionStore implements SessionStore backed by PostgreSQL.
func (*PGSessionStore) Create ¶
func (s *PGSessionStore) Create(ctx context.Context, sess *Session) error
func (*PGSessionStore) DeleteExpired ¶
func (s *PGSessionStore) DeleteExpired(ctx context.Context) (int64, error)
func (*PGSessionStore) GetByToken ¶
func (*PGSessionStore) List ¶
func (s *PGSessionStore) List(ctx context.Context, f SessionFilter) ([]*Session, error)
type PGStore ¶
type PGStore struct {
// contains filtered or unexported fields
}
PGStore wraps a pgxpool.Pool and provides access to all domain stores.
func NewPGStore ¶
NewPGStore connects to PostgreSQL and returns a PGStore with all sub-stores.
func (*PGStore) Companies ¶
func (s *PGStore) Companies() CompanyStore
Companies returns the CompanyStore.
func (*PGStore) CrossWorkflowLinks ¶
func (s *PGStore) CrossWorkflowLinks() CrossWorkflowLinkStore
CrossWorkflowLinks returns the CrossWorkflowLinkStore.
func (*PGStore) Executions ¶
func (s *PGStore) Executions() ExecutionStore
Executions returns the ExecutionStore.
func (*PGStore) Memberships ¶
func (s *PGStore) Memberships() MembershipStore
Memberships returns the MembershipStore.
func (*PGStore) Projects ¶
func (s *PGStore) Projects() ProjectStore
Projects returns the ProjectStore.
func (*PGStore) Sessions ¶
func (s *PGStore) Sessions() SessionStore
Sessions returns the SessionStore.
func (*PGStore) Workflows ¶
func (s *PGStore) Workflows() WorkflowStore
Workflows returns the WorkflowStore.
type PGUserStore ¶
type PGUserStore struct {
// contains filtered or unexported fields
}
PGUserStore implements UserStore backed by PostgreSQL.
func (*PGUserStore) GetByEmail ¶
func (*PGUserStore) GetByOAuth ¶
func (s *PGUserStore) GetByOAuth(ctx context.Context, provider OAuthProvider, oauthID string) (*User, error)
func (*PGUserStore) List ¶
func (s *PGUserStore) List(ctx context.Context, f UserFilter) ([]*User, error)
type PGWorkflowStore ¶
type PGWorkflowStore struct {
// contains filtered or unexported fields
}
PGWorkflowStore implements WorkflowStore backed by PostgreSQL. Versioning is handled via a workflow_versions table; the main workflows table always reflects the latest version.
func (*PGWorkflowStore) Create ¶
func (s *PGWorkflowStore) Create(ctx context.Context, w *WorkflowRecord) error
func (*PGWorkflowStore) Get ¶
func (s *PGWorkflowStore) Get(ctx context.Context, id uuid.UUID) (*WorkflowRecord, error)
func (*PGWorkflowStore) GetBySlug ¶
func (s *PGWorkflowStore) GetBySlug(ctx context.Context, projectID uuid.UUID, slug string) (*WorkflowRecord, error)
func (*PGWorkflowStore) GetVersion ¶
func (s *PGWorkflowStore) GetVersion(ctx context.Context, id uuid.UUID, version int) (*WorkflowRecord, error)
func (*PGWorkflowStore) List ¶
func (s *PGWorkflowStore) List(ctx context.Context, f WorkflowFilter) ([]*WorkflowRecord, error)
func (*PGWorkflowStore) ListVersions ¶
func (s *PGWorkflowStore) ListVersions(ctx context.Context, id uuid.UUID) ([]*WorkflowRecord, error)
func (*PGWorkflowStore) Update ¶
func (s *PGWorkflowStore) Update(ctx context.Context, w *WorkflowRecord) error
type Pagination ¶
Pagination holds common pagination parameters.
func DefaultPagination ¶
func DefaultPagination() Pagination
DefaultPagination returns a Pagination with sensible defaults.
type Project ¶
type Project struct {
ID uuid.UUID `json:"id"`
CompanyID uuid.UUID `json:"company_id"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description,omitempty"`
Metadata json.RawMessage `json:"metadata,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Project represents a project within a company.
type ProjectFilter ¶
type ProjectFilter struct {
CompanyID *uuid.UUID
Slug string
Pagination Pagination
}
ProjectFilter specifies criteria for listing projects.
type ProjectStore ¶
type ProjectStore interface {
Create(ctx context.Context, p *Project) error
Get(ctx context.Context, id uuid.UUID) (*Project, error)
GetBySlug(ctx context.Context, companyID uuid.UUID, slug string) (*Project, error)
Update(ctx context.Context, p *Project) error
Delete(ctx context.Context, id uuid.UUID) error
List(ctx context.Context, f ProjectFilter) ([]*Project, error)
ListForUser(ctx context.Context, userID uuid.UUID) ([]*Project, error)
}
ProjectStore defines persistence operations for projects.
type Session ¶
type Session struct {
ID uuid.UUID `json:"id"`
UserID uuid.UUID `json:"user_id"`
Token string `json:"-"`
IPAddress string `json:"ip_address"`
UserAgent string `json:"user_agent"`
Metadata json.RawMessage `json:"metadata,omitempty"`
Active bool `json:"active"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
}
Session represents an active user session.
type SessionFilter ¶
type SessionFilter struct {
UserID *uuid.UUID
Active *bool
Pagination Pagination
}
SessionFilter specifies criteria for listing sessions.
type SessionStore ¶
type SessionStore interface {
Create(ctx context.Context, s *Session) error
Get(ctx context.Context, id uuid.UUID) (*Session, error)
GetByToken(ctx context.Context, token string) (*Session, error)
Update(ctx context.Context, s *Session) error
Delete(ctx context.Context, id uuid.UUID) error
List(ctx context.Context, f SessionFilter) ([]*Session, error)
DeleteExpired(ctx context.Context) (int64, error)
}
SessionStore defines persistence operations for sessions.
type StepStatus ¶
type StepStatus string
StepStatus represents the status of an execution step.
const ( StepStatusPending StepStatus = "pending" StepStatusRunning StepStatus = "running" StepStatusCompleted StepStatus = "completed" StepStatusFailed StepStatus = "failed" StepStatusSkipped StepStatus = "skipped" )
type User ¶
type User struct {
ID uuid.UUID `json:"id"`
Email string `json:"email"`
PasswordHash string `json:"-"`
DisplayName string `json:"display_name"`
AvatarURL string `json:"avatar_url,omitempty"`
OAuthProvider OAuthProvider `json:"oauth_provider,omitempty"`
OAuthID string `json:"oauth_id,omitempty"`
Active bool `json:"active"`
Metadata json.RawMessage `json:"metadata,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
LastLoginAt *time.Time `json:"last_login_at,omitempty"`
}
User represents a platform user.
type UserFilter ¶
type UserFilter struct {
Email string
Active *bool
OAuthProvider OAuthProvider
Pagination Pagination
}
UserFilter specifies criteria for listing users.
type UserStore ¶
type UserStore interface {
Create(ctx context.Context, u *User) error
Get(ctx context.Context, id uuid.UUID) (*User, error)
GetByEmail(ctx context.Context, email string) (*User, error)
GetByOAuth(ctx context.Context, provider OAuthProvider, oauthID string) (*User, error)
Update(ctx context.Context, u *User) error
Delete(ctx context.Context, id uuid.UUID) error
List(ctx context.Context, f UserFilter) ([]*User, error)
}
UserStore defines persistence operations for users.
type WorkflowExecution ¶
type WorkflowExecution struct {
ID uuid.UUID `json:"id"`
WorkflowID uuid.UUID `json:"workflow_id"`
TriggerType string `json:"trigger_type"`
TriggerData json.RawMessage `json:"trigger_data,omitempty"`
Status ExecutionStatus `json:"status"`
OutputData json.RawMessage `json:"output_data,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
ErrorStack string `json:"error_stack,omitempty"`
StartedAt time.Time `json:"started_at"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
DurationMs *int64 `json:"duration_ms,omitempty"`
Metadata json.RawMessage `json:"metadata,omitempty"`
}
WorkflowExecution represents a single execution of a workflow.
type WorkflowFilter ¶
type WorkflowFilter struct {
ProjectID *uuid.UUID
Status WorkflowStatus
Slug string
Pagination Pagination
}
WorkflowFilter specifies criteria for listing workflow records.
type WorkflowRecord ¶
type WorkflowRecord struct {
ID uuid.UUID `json:"id"`
ProjectID uuid.UUID `json:"project_id"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description,omitempty"`
ConfigYAML string `json:"config_yaml"`
Version int `json:"version"`
Status WorkflowStatus `json:"status"`
CreatedBy uuid.UUID `json:"created_by"`
UpdatedBy uuid.UUID `json:"updated_by"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
WorkflowRecord represents a stored workflow configuration with version tracking.
type WorkflowStatus ¶
type WorkflowStatus string
WorkflowStatus represents the lifecycle status of a workflow record.
const ( WorkflowStatusDraft WorkflowStatus = "draft" WorkflowStatusActive WorkflowStatus = "active" WorkflowStatusStopped WorkflowStatus = "stopped" WorkflowStatusError WorkflowStatus = "error" )
type WorkflowStore ¶
type WorkflowStore interface {
Create(ctx context.Context, w *WorkflowRecord) error
Get(ctx context.Context, id uuid.UUID) (*WorkflowRecord, error)
GetBySlug(ctx context.Context, projectID uuid.UUID, slug string) (*WorkflowRecord, error)
Update(ctx context.Context, w *WorkflowRecord) error
Delete(ctx context.Context, id uuid.UUID) error
List(ctx context.Context, f WorkflowFilter) ([]*WorkflowRecord, error)
// GetVersion retrieves a specific version of a workflow.
GetVersion(ctx context.Context, id uuid.UUID, version int) (*WorkflowRecord, error)
// ListVersions returns all versions for a given workflow ID.
ListVersions(ctx context.Context, id uuid.UUID) ([]*WorkflowRecord, error)
}
WorkflowStore defines persistence operations for workflow records.