Documentation
¶
Index ¶
- Variables
- func EmitTx(ctx context.Context, tx pgx.Tx, event domain.Event) error
- type Completion
- type EnqueueInput
- type EventPage
- type Intent
- type Lease
- type Pause
- type PolicyCheck
- type ScopeCheck
- type Service
- func (s *Service) Advance(ctx context.Context, l Lease, next domain.TaskState) (Task, error)
- func (s *Service) AdvanceTx(ctx context.Context, tx pgx.Tx, l Lease, next domain.TaskState) (Task, error)
- func (s *Service) BeginIntent(ctx context.Context, l Lease, id string) (Intent, error)
- func (s *Service) BeginIntentTx(ctx context.Context, tx pgx.Tx, l Lease, id string) (Intent, error)
- func (s *Service) Cancel(ctx context.Context, session auth.Session, orgID, id string, expected int64, ...) (Task, error)
- func (s *Service) CheckProposalTx(ctx context.Context, tx pgx.Tx, t Task) (string, error)
- func (s *Service) Claim(ctx context.Context, workerID string, allowedOrgIDs []string, ...) (Lease, error)
- func (s *Service) ClaimScoped(ctx context.Context, workerID, orgID, poolID string, repositories []string, ...) (Lease, error)
- func (s *Service) ClaimScopedTx(ctx context.Context, tx pgx.Tx, workerID, orgID, poolID string, ...) (Lease, error)
- func (s *Service) Complete(ctx context.Context, l Lease, result Completion) (Task, error)
- func (s *Service) CompleteIntent(ctx context.Context, l Lease, id, outcome, evidence string) (Intent, error)
- func (s *Service) CompleteTx(ctx context.Context, tx pgx.Tx, l Lease, result Completion) (Task, error)
- func (s *Service) ConcludeReconciledTx(ctx context.Context, tx pgx.Tx, orgID, taskID, actor, request string) error
- func (s *Service) Enqueue(ctx context.Context, session auth.Session, orgID string, in EnqueueInput, ...) (Task, error)
- func (s *Service) EnqueuePrepared(ctx context.Context, session auth.Session, orgID string, in EnqueueInput, ...) (Task, error)
- func (s *Service) Get(ctx context.Context, session auth.Session, orgID, id string) (Task, error)
- func (s *Service) Heartbeat(ctx context.Context, l Lease, ttl time.Duration) (Lease, error)
- func (s *Service) InvalidateJobTx(ctx context.Context, tx pgx.Tx, orgID, workerID, jobID string) error
- func (s *Service) InvalidateWorkerTx(ctx context.Context, tx pgx.Tx, orgID, workerID string) error
- func (s *Service) List(ctx context.Context, session auth.Session, orgID, state string, limit int, ...) (domain.Page[Task], error)
- func (s *Service) PausedTx(ctx context.Context, tx pgx.Tx, orgID, id string) (bool, error)
- func (s *Service) PrepareIntentTx(ctx context.Context, tx pgx.Tx, l Lease, kind, key string, ...) (Intent, error)
- func (s *Service) PruneEvents(ctx context.Context, orgID string, through int64) error
- func (s *Service) ReconcileIntent(ctx context.Context, orgID, id, outcome, evidence string) (Intent, error)
- func (s *Service) ReconcileIntentTx(ctx context.Context, tx pgx.Tx, orgID, taskID, id, outcome, evidence string) (Intent, error)
- func (s *Service) Recover(ctx context.Context, orgID string) error
- func (s *Service) RegisterCampaignAuthority(check func(context.Context, pgx.Tx, Task) error)
- func (s *Service) RegisterScopeCheck(check ScopeCheck)
- func (s *Service) Replay(ctx context.Context, session auth.Session, orgID string, after int64, ...) (EventPage, error)
- func (s *Service) Resume(ctx context.Context, session auth.Session, orgID, id string, expected int64, ...) (Task, error)
- func (s *Service) SetCampaignPauseTx(ctx context.Context, tx pgx.Tx, org, id string, paused bool, ...) error
- func (s *Service) SetPause(ctx context.Context, session auth.Session, orgID string, p Pause, ...) (Pause, error)
- func (s *Service) ValidateFenceTx(ctx context.Context, tx pgx.Tx, l Lease, action string) (Task, error)
- type Task
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCursor = errors.New("event cursor expired; refetch current state")
View Source
var ErrFence = errors.New("lease or fencing token is no longer valid")
View Source
var ErrNoWork = errors.New("no eligible work")
View Source
var ErrPaused = errors.New("workflow scope is paused")
View Source
var ErrPolicy = errors.New("policy changed or does not permit this action")
View Source
var ErrReconciliation = errors.New("external outcome must be reconciled before retry")
Functions ¶
Types ¶
type Completion ¶
type EnqueueInput ¶
type EnqueueInput struct {
RepositoryID string `json:"repository_id"`
Recipe string `json:"recipe"`
RecipeVersion string `json:"recipe_version"`
TargetBranch string `json:"target_branch"`
ModelConnectionID string `json:"model_connection_id,omitempty"`
ModelRoute string `json:"model_route"`
CampaignID string `json:"campaign_id,omitempty"`
RunnerPoolID string `json:"runner_pool_id,omitempty"`
PolicyHash string `json:"policy_hash"`
IdempotencyKey string `json:"idempotency_key"`
MaxAttempts int `json:"max_attempts"`
Priority int `json:"priority"`
}
type Intent ¶
type Intent struct {
ID string `json:"id"`
OrgID string `json:"org_id"`
TaskID string `json:"task_id"`
RepositoryID string `json:"repository_id"`
OperationID string `json:"operation_id"`
Kind string `json:"kind"`
State string `json:"state"`
Payload json.RawMessage `json:"payload"`
DispatchCount int `json:"dispatch_count"`
Evidence string `json:"evidence"`
}
type Lease ¶
type Lease struct {
OrgID string `json:"org_id"`
RepositoryID string `json:"repository_id"`
TaskID string `json:"task_id"`
JobID string `json:"job_id"`
AttemptID string `json:"attempt_id"`
OperationID string `json:"operation_id"`
WorkerID string `json:"worker_id"`
Fence int64 `json:"fence"`
PolicyHash string `json:"policy_hash"`
ExpiresAt time.Time `json:"expires_at"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) BeginIntent ¶
func (*Service) BeginIntentTx ¶
func (*Service) CheckProposalTx ¶
func (*Service) ClaimScoped ¶
func (*Service) ClaimScopedTx ¶
func (*Service) CompleteIntent ¶
func (*Service) CompleteTx ¶
func (*Service) ConcludeReconciledTx ¶
func (*Service) EnqueuePrepared ¶
func (*Service) InvalidateJobTx ¶
func (*Service) InvalidateWorkerTx ¶
func (*Service) PrepareIntentTx ¶
func (*Service) PruneEvents ¶
func (*Service) ReconcileIntent ¶
func (*Service) ReconcileIntentTx ¶
func (*Service) RegisterCampaignAuthority ¶
func (*Service) RegisterScopeCheck ¶
func (s *Service) RegisterScopeCheck(check ScopeCheck)
func (*Service) SetCampaignPauseTx ¶
type Task ¶
type Task struct {
ID string `json:"id"`
OrgID string `json:"org_id"`
RepositoryID string `json:"repository_id"`
OperationID string `json:"operation_id"`
Recipe string `json:"recipe"`
RecipeVersion string `json:"recipe_version"`
TargetBranch string `json:"target_branch"`
ModelConnectionID string `json:"model_connection_id,omitempty"`
ModelRoute string `json:"model_route"`
CampaignID string `json:"campaign_id,omitempty"`
RunnerPoolID string `json:"runner_pool_id,omitempty"`
PolicyHash string `json:"policy_hash"`
StartingPolicyHash string `json:"starting_policy_hash"`
State domain.TaskState `json:"state"`
Reason string `json:"reason"`
Version int64 `json:"version"`
CancelVersion int64 `json:"cancel_version"`
CancellationRequested bool `json:"cancellation_requested"`
MaxAttempts int `json:"max_attempts"`
CreatedAt time.Time `json:"created_at"`
}
Click to show internal directories.
Click to hide internal directories.