contract

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Overview

Package contract serves the operator-wide Dispatch dashboard.

Index

Constants

View Source
const ContributorName = "dispatch"

ContributorName joins the Go contributor and the React plugin.

View Source
const DurableWardenName = "dispatchDurableOperator"
View Source
const WardenName = "dispatchInstallationOperator"

Variables

This section is empty.

Functions

func DurableAction

func DurableAction(intent string) string

DurableAction is a closed descriptor shared by admission and typed handlers.

func Register

func Register(d *dispatcher.Dispatcher, reg fc.Registry, wreg fc.WardenRegistry, deps Deps) error

Register validates the manifest and binds only implemented intents.

Types

type ArtifactCacheConfig

type ArtifactCacheConfig struct {
	Directory   string `json:"directory"`
	BudgetBytes int64  `json:"budgetBytes"`
	UsedBytes   int64  `json:"usedBytes"`
}

type ArtifactConfig

type ArtifactConfig struct {
	Enabled       bool                 `json:"enabled"`
	Backend       *string              `json:"backend"`
	DefaultBucket *string              `json:"defaultBucket"`
	Cache         *ArtifactCacheConfig `json:"cache"`
}

type ArtifactDetail

type ArtifactDetail struct {
	Enabled  bool         `json:"enabled"`
	Artifact *ArtifactRow `json:"artifact"`
	AsOf     string       `json:"asOf"`
}

type ArtifactDownload

type ArtifactDownload struct {
	Enabled   bool    `json:"enabled"`
	Supported bool    `json:"supported"`
	URL       *string `json:"url"`
	ExpiresAt *string `json:"expiresAt"`
	AsOf      string  `json:"asOf"`
}
type ArtifactJobLinks struct {
	JobArtifactLinks
	JobID string `json:"jobId"`
	AsOf  string `json:"asOf"`
}

type ArtifactLinkRow

type ArtifactLinkRow struct {
	ArtifactID string  `json:"artifactId"`
	Role       string  `json:"role"`
	Name       string  `json:"name"`
	Attempt    int     `json:"attempt"`
	CreatedAt  *string `json:"createdAt"`
}

type ArtifactRow

type ArtifactRow struct {
	ID                string             `json:"id"`
	Backend           string             `json:"backend"`
	Bucket            string             `json:"bucket"`
	Key               string             `json:"key"`
	Size              int64              `json:"size"`
	ContentHash       *string            `json:"contentHash"`
	ContentType       *string            `json:"contentType"`
	Lifecycle         artifact.Lifecycle `json:"lifecycle"`
	ScopeAppID        *string            `json:"scopeAppId"`
	ScopeOrgID        *string            `json:"scopeOrgId"`
	ExpiresAt         *string            `json:"expiresAt"`
	CreatedAt         *string            `json:"createdAt"`
	DeletedAt         *string            `json:"deletedAt"`
	DownloadAvailable bool               `json:"downloadAvailable"`
}

type ArtifactsListInput

type ArtifactsListInput struct {
	Lifecycle      artifact.Lifecycle `json:"lifecycle"`
	ScopeAppID     string             `json:"scopeAppId"`
	ScopeOrgID     string             `json:"scopeOrgId"`
	IncludeDeleted bool               `json:"includeDeleted"`
	Cursor         string             `json:"cursor"`
	Limit          int                `json:"limit"`
}

type ArtifactsPage

type ArtifactsPage struct {
	Page[ArtifactRow]
	Enabled bool `json:"enabled"`
}

type BeforeInput

type BeforeInput struct {
	Before string `json:"before"`
}

type CountResult

type CountResult struct {
	Count int64  `json:"count"`
	AsOf  string `json:"asOf"`
}

type CronDetail

type CronDetail struct {
	CronRow
	Payload Payload `json:"payload"`
	AsOf    string  `json:"asOf"`
}

type CronRow

type CronRow struct {
	ID             string   `json:"id"`
	Name           string   `json:"name"`
	Schedule       string   `json:"schedule"`
	JobName        string   `json:"jobName"`
	Queue          *string  `json:"queue"`
	EffectiveQueue string   `json:"effectiveQueue"`
	ScopeAppID     *string  `json:"scopeAppId"`
	ScopeOrgID     *string  `json:"scopeOrgId"`
	Enabled        bool     `json:"enabled"`
	CreatedAt      *string  `json:"createdAt"`
	UpdatedAt      *string  `json:"updatedAt"`
	LastRunAt      *string  `json:"lastRunAt"`
	NextRunAt      *string  `json:"nextRunAt"`
	LockedBy       *string  `json:"lockedBy"`
	LockedUntil    *string  `json:"lockedUntil"`
	NextFires      []string `json:"nextFires"`
	Location       *string  `json:"location"`
	ScheduleError  *string  `json:"scheduleError"`
}

type CronRunResult

type CronRunResult struct {
	CronID string `json:"cronId"`
	Job    JobRow `json:"job"`
	AsOf   string `json:"asOf"`
}

type CronSummary

type CronSummary struct {
	Enabled  int `json:"enabled"`
	Disabled int `json:"disabled"`
}

type DLQBulkResult

type DLQBulkResult struct {
	Replayed    int       `json:"replayed"`
	Conflicts   int       `json:"conflicts"`
	Errors      int       `json:"errors"`
	Limit       int       `json:"limit"`
	Interrupted bool      `json:"interrupted"`
	Failure     *fc.Error `json:"failure"`
	AsOf        string    `json:"asOf"`
}

type DLQCountsInput

type DLQCountsInput struct {
	Queue    string `json:"queue"`
	Replayed *bool  `json:"replayed"`
}

type DLQDetail

type DLQDetail struct {
	DLQRow
	Payload          Payload      `json:"payload"`
	Priority         int          `json:"priority"`
	Timeout          Duration     `json:"timeout"`
	LeaseTTL         Duration     `json:"leaseTtl"`
	ArtifactBindings Payload      `json:"artifactBindings"`
	Resources        resource.Set `json:"resources"`
	ResourceLimits   resource.Set `json:"resourceLimits"`
	ResourceClass    *string      `json:"resourceClass"`
	InputBytes       int64        `json:"inputBytes"`
	PrimaryInputHash *string      `json:"primaryInputHash"`
	AsOf             string       `json:"asOf"`
}

type DLQListInput

type DLQListInput struct {
	Queue      string `json:"queue"`
	NamePrefix string `json:"namePrefix"`
	ScopeAppID string `json:"scopeAppId"`
	ScopeOrgID string `json:"scopeOrgId"`
	Replayed   *bool  `json:"replayed"`
	Cursor     string `json:"cursor"`
	Limit      int    `json:"limit"`
}

type DLQPurgeResult

type DLQPurgeResult struct {
	Before      string    `json:"before"`
	Count       int64     `json:"count"`
	Interrupted bool      `json:"interrupted"`
	Failure     *fc.Error `json:"failure"`
	AsOf        string    `json:"asOf"`
}

type DLQReplayAllInput

type DLQReplayAllInput struct {
	Queue string `json:"queue"`
	Limit int    `json:"limit"`
}

type DLQReplayResult

type DLQReplayResult struct {
	EntryID string `json:"entryId"`
	Job     JobRow `json:"job"`
	AsOf    string `json:"asOf"`
}

type DLQRow

type DLQRow struct {
	ID            string  `json:"id"`
	JobID         string  `json:"jobId"`
	JobName       string  `json:"jobName"`
	Queue         string  `json:"queue"`
	Error         *string `json:"error"`
	RetryCount    int     `json:"retryCount"`
	MaxRetries    int     `json:"maxRetries"`
	ScopeAppID    *string `json:"scopeAppId"`
	ScopeOrgID    *string `json:"scopeOrgId"`
	FailedAt      *string `json:"failedAt"`
	CreatedAt     *string `json:"createdAt"`
	ReplayedAt    *string `json:"replayedAt"`
	ReplayedJobID *string `json:"replayedJobId"`
}

type DeletedResult

type DeletedResult struct {
	ID   string `json:"id"`
	AsOf string `json:"asOf"`
}

type Deps

type Deps struct {
	Durable  *operator.Service
	Security security.Boundary
	Engine   *engine.Engine
	Store    store.Store
	Logger   forge.Logger
}

Deps contains the running engine and the stores its intents inspect.

type Duration

type Duration struct {
	Text string `json:"text"`
	MS   int64  `json:"ms"`
}

type EmptyInput

type EmptyInput struct{}

type EngineConfig

type EngineConfig struct {
	WorkerID              string           `json:"workerId"`
	Pool                  PoolConfig       `json:"pool"`
	Scheduler             SchedulerConfig  `json:"scheduler"`
	Queues                []QueueConfigRow `json:"queues"`
	Executors             []ExecutorRow    `json:"executors"`
	Resources             ResourceConfig   `json:"resources"`
	Artifacts             ArtifactConfig   `json:"artifacts"`
	ScratchRoot           string           `json:"scratchRoot"`
	WakeNotifierSupported bool             `json:"wakeNotifierSupported"`
	AsOf                  string           `json:"asOf"`
}

type ExecutionPolicy

type ExecutionPolicy struct {
	Level          string   `json:"level"`
	GracePeriod    Duration `json:"gracePeriod"`
	AllowDowngrade bool     `json:"allowDowngrade"`
	Image          *string  `json:"image"`
}

type ExecutorRow

type ExecutorRow struct {
	Name       string            `json:"name"`
	Level      string            `json:"level"`
	Default    bool              `json:"default"`
	Subprocess *SubprocessConfig `json:"subprocess"`
}

type HandlerArtifactInput

type HandlerArtifactInput struct {
	Name     string `json:"name"`
	Required bool   `json:"required"`
	MaxSize  int64  `json:"maxSize"`
	Mode     string `json:"mode"`
}

type HandlerDetail

type HandlerDetail struct {
	HandlerRow
	Job  *JobHandlerDetail `json:"job"`
	AsOf string            `json:"asOf"`
}

type HandlerInput

type HandlerInput struct {
	Kind string `json:"kind"`
	Name string `json:"name"`
}

type HandlerRow

type HandlerRow struct {
	Kind       string `json:"kind"`
	Name       string `json:"name"`
	Versions   []int  `json:"versions"`
	InputCount int    `json:"inputCount"`
}

type IDInput

type IDInput struct {
	ID string `json:"id"`
}

type JobAction

type JobAction struct {
	Job  JobRow `json:"job"`
	AsOf string `json:"asOf"`
}
type JobArtifactLinks struct {
	Enabled bool              `json:"enabled"`
	Links   []ArtifactLinkRow `json:"links"`
}

type JobCounts

type JobCounts struct {
	Counts map[job.State]int64 `json:"counts"`
	Total  int64               `json:"total"`
	AsOf   string              `json:"asOf"`
}

type JobDetail

type JobDetail struct {
	JobRow
	Payload           Payload          `json:"payload"`
	LastError         *string          `json:"lastError"`
	HeartbeatAt       *string          `json:"heartbeatAt"`
	Timeout           Duration         `json:"timeout"`
	LeaseEpoch        int              `json:"leaseEpoch"`
	LeaseExpiresAt    *string          `json:"leaseExpiresAt"`
	LeaseTTL          Duration         `json:"leaseTtl"`
	EffectiveLeaseTTL Duration         `json:"effectiveLeaseTtl"`
	EvictCount        int              `json:"evictCount"`
	Resources         resource.Set     `json:"resources"`
	ResourceLimits    resource.Set     `json:"resourceLimits"`
	ResourceClass     *string          `json:"resourceClass"`
	InputBytes        int64            `json:"inputBytes"`
	PrimaryInputHash  *string          `json:"primaryInputHash"`
	ArtifactBindings  Payload          `json:"artifactBindings"`
	Artifacts         JobArtifactLinks `json:"artifacts"`
	DLQEntryID        *string          `json:"dlqEntryId"`
	AsOf              string           `json:"asOf"`
}

type JobHandlerDetail

type JobHandlerDetail struct {
	Inputs            []HandlerArtifactInput `json:"inputs"`
	Resources         resource.Set           `json:"resources"`
	ResourceLimits    resource.Set           `json:"resourceLimits"`
	ResourceClass     *string                `json:"resourceClass"`
	ResourceFunction  bool                   `json:"resourceFunction"`
	LeaseTTL          *Duration              `json:"leaseTtl"`
	EffectiveLeaseTTL Duration               `json:"effectiveLeaseTtl"`
	Execution         ExecutionPolicy        `json:"execution"`
}

type JobRow

type JobRow struct {
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	Queue       string    `json:"queue"`
	State       job.State `json:"state"`
	Priority    int       `json:"priority"`
	MaxRetries  int       `json:"maxRetries"`
	RetryCount  int       `json:"retryCount"`
	WorkerID    *string   `json:"workerId"`
	ScopeAppID  *string   `json:"scopeAppId"`
	ScopeOrgID  *string   `json:"scopeOrgId"`
	CreatedAt   *string   `json:"createdAt"`
	RunAt       *string   `json:"runAt"`
	StartedAt   *string   `json:"startedAt"`
	CompletedAt *string   `json:"completedAt"`
}

type JobsListInput

type JobsListInput struct {
	States     []job.State `json:"states"`
	Queue      string      `json:"queue"`
	NamePrefix string      `json:"namePrefix"`
	ScopeAppID string      `json:"scopeAppId"`
	ScopeOrgID string      `json:"scopeOrgId"`
	Cursor     string      `json:"cursor"`
	Limit      int         `json:"limit"`
}

type LocalResources

type LocalResources struct {
	Enabled     bool               `json:"enabled"`
	Capacity    resource.Set       `json:"capacity"`
	Free        resource.Set       `json:"free"`
	Reclaimable resource.Set       `json:"reclaimable"`
	Leases      []ResourceLeaseRow `json:"leases"`
}

type NameInput

type NameInput struct {
	Name string `json:"name"`
}

type OverviewSummary

type OverviewSummary struct {
	Jobs                  JobCounts                   `json:"jobs"`
	Runs                  map[workflow.RunState]int64 `json:"runs"`
	UnreplayedDeadLetters int64                       `json:"unreplayedDeadLetters"`
	Crons                 CronSummary                 `json:"crons"`
	Workers               WorkerSummary               `json:"workers"`
	AsOf                  string                      `json:"asOf"`
}

type Page

type Page[T any] struct {
	Items      []T     `json:"items"`
	NextCursor *string `json:"nextCursor"`
	Complete   bool    `json:"complete"`
	AsOf       string  `json:"asOf"`
}

type Payload

type Payload struct {
	Kind     string          `json:"kind"`
	JSON     json.RawMessage `json:"json,omitempty"`
	JSONText string          `json:"jsonText,omitempty"`
	Bytes    *int            `json:"bytes,omitempty"`
}

Payload exposes JSON with its original text and opaque content only as a size.

type PoolConfig

type PoolConfig struct {
	Concurrency             int      `json:"concurrency"`
	Queues                  []string `json:"queues"`
	PollInterval            Duration `json:"pollInterval"`
	MaxPollInterval         Duration `json:"maxPollInterval"`
	JobHeartbeatInterval    Duration `json:"jobHeartbeatInterval"`
	WorkerHeartbeatInterval Duration `json:"workerHeartbeatInterval"`
	WorkerStaleThreshold    Duration `json:"workerStaleThreshold"`
	StaleJobThreshold       Duration `json:"staleJobThreshold"`
	ReapInterval            Duration `json:"reapInterval"`
	DefaultLeaseTTL         Duration `json:"defaultLeaseTtl"`
	StoreCallTimeout        Duration `json:"storeCallTimeout"`
	ShutdownTimeout         Duration `json:"shutdownTimeout"`
	StoreCallsBounded       bool     `json:"storeCallsBounded"`
	ReapingEnabled          bool     `json:"reapingEnabled"`
	LeasesEnabled           bool     `json:"leasesEnabled"`
}

type QueueConfigRow

type QueueConfigRow struct {
	Name     string        `json:"name"`
	Settings QueueSettings `json:"settings"`
}

type QueueDetail

type QueueDetail struct {
	QueueRow
	AsOf string `json:"asOf"`
}

type QueueInput

type QueueInput struct {
	Queue string `json:"queue"`
}

type QueueRow

type QueueRow struct {
	Name                string              `json:"name"`
	Counts              map[job.State]int64 `json:"counts"`
	Total               int64               `json:"total"`
	PolledByThisProcess bool                `json:"polledByThisProcess"`
	LocalSettings       *QueueSettings      `json:"localSettings"`
	LocalActiveCount    *int                `json:"localActiveCount"`
}

type QueueSettings

type QueueSettings struct {
	MaxConcurrency     int     `json:"maxConcurrency"`
	RateLimit          float64 `json:"rateLimit"`
	RateBurst          int     `json:"rateBurst"`
	EffectiveRateBurst *int    `json:"effectiveRateBurst"`
}

type QueuesPage

type QueuesPage struct {
	Page[QueueRow]
	WorkerDiscoveryEnabled bool `json:"workerDiscoveryEnabled"`
}

type RequestedRlimits

type RequestedRlimits struct {
	AddressSpace int64 `json:"addressSpace"`
	NoFile       int64 `json:"noFile"`
	NProc        int64 `json:"nProc"`
	Core         int64 `json:"core"`
	FSize        int64 `json:"fSize"`
}

type ResourceConfig

type ResourceConfig struct {
	Enabled                  bool                    `json:"enabled"`
	Defaults                 resource.Set            `json:"defaults"`
	Queues                   map[string]resource.Set `json:"queues"`
	AdvertisedWorkerCapacity resource.Set            `json:"advertisedWorkerCapacity"`
	CustomKeys               []string                `json:"customKeys"`
	EstimatorConfigured      bool                    `json:"estimatorConfigured"`
}

type ResourceLeaseRow

type ResourceLeaseRow struct {
	Owner      string       `json:"owner"`
	Held       resource.Set `json:"held"`
	AcquiredAt *string      `json:"acquiredAt"`
}

type SchedulerConfig

type SchedulerConfig struct {
	TickInterval      Duration `json:"tickInterval"`
	LeaderTTL         Duration `json:"leaderTtl"`
	RefreshInterval   Duration `json:"refreshInterval"`
	LockTTL           Duration `json:"lockTtl"`
	StoreCallTimeout  Duration `json:"storeCallTimeout"`
	StoreCallsBounded bool     `json:"storeCallsBounded"`
}

type SubprocessConfig

type SubprocessConfig struct {
	UserConfigured  bool             `json:"userConfigured"`
	UID             *int             `json:"uid"`
	GID             *int             `json:"gid"`
	AllowSameUser   bool             `json:"allowSameUser"`
	HasRlimits      bool             `json:"hasRlimits"`
	StrictRlimits   bool             `json:"strictRlimits"`
	RequestedLimits RequestedRlimits `json:"requestedLimits"`
	ScratchDir      *string          `json:"scratchDir"`
}

type WorkerDetail

type WorkerDetail struct {
	Enabled     bool           `json:"enabled"`
	Worker      *WorkerRow     `json:"worker"`
	LeaderID    *string        `json:"leaderId"`
	SilentAfter *Duration      `json:"silentAfter"`
	Resources   LocalResources `json:"resources"`
	AsOf        string         `json:"asOf"`
}

type WorkerRow

type WorkerRow struct {
	ID                string              `json:"id"`
	Hostname          *string             `json:"hostname"`
	Queues            []string            `json:"queues"`
	Concurrency       int                 `json:"concurrency"`
	State             cluster.WorkerState `json:"state"`
	Self              bool                `json:"self"`
	IsLeader          bool                `json:"isLeader"`
	LeaderUntil       *string             `json:"leaderUntil"`
	LastSeen          *string             `json:"lastSeen"`
	CreatedAt         *string             `json:"createdAt"`
	HeartbeatAge      *Duration           `json:"heartbeatAge"`
	HeartbeatInterval *Duration           `json:"heartbeatInterval"`
	HeartbeatStatus   string              `json:"heartbeatStatus"`
	ClockSkew         bool                `json:"clockSkew"`
	Capacity          resource.Set        `json:"capacity"`
}

type WorkerSummary

type WorkerSummary struct {
	Enabled     bool      `json:"enabled"`
	Recent      int       `json:"recent"`
	Silent      int       `json:"silent"`
	Unknown     int       `json:"unknown"`
	LeaderID    *string   `json:"leaderId"`
	SilentAfter *Duration `json:"silentAfter"`
}

type WorkersPage

type WorkersPage struct {
	Page[WorkerRow]
	Enabled            bool      `json:"enabled"`
	LeaderID           *string   `json:"leaderId"`
	HeartbeatReference *Duration `json:"heartbeatReference"`
	SilentAfter        *Duration `json:"silentAfter"`
}

type WorkflowCheckpoint

type WorkflowCheckpoint struct {
	ID        string  `json:"id"`
	StepName  string  `json:"stepName"`
	CreatedAt *string `json:"createdAt"`
	Payload   Payload `json:"payload"`
}

type WorkflowDetail

type WorkflowDetail struct {
	WorkflowRow
	Input             Payload              `json:"input"`
	Output            Payload              `json:"output"`
	Error             *string              `json:"error"`
	Checkpoints       []WorkflowCheckpoint `json:"checkpoints"`
	Children          []WorkflowRow        `json:"children"`
	VersionRegistered bool                 `json:"versionRegistered"`
	AsOf              string               `json:"asOf"`
}

type WorkflowReplayCommandInput

type WorkflowReplayCommandInput struct {
	WorkflowReplayInput
	ExpectedGeneration *int64 `json:"expectedGeneration"`
}

type WorkflowReplayInput

type WorkflowReplayInput struct {
	ID       string `json:"id"`
	FromStep string `json:"fromStep"`
}

type WorkflowReplayPreview

type WorkflowReplayPreview struct {
	RunID      string            `json:"runId"`
	FromStep   string            `json:"fromStep"`
	Version    int               `json:"version"`
	Generation int64             `json:"generation"`
	State      workflow.RunState `json:"state"`
	Reruns     []string          `json:"reruns"`
	AsOf       string            `json:"asOf"`
}

type WorkflowReplayResult

type WorkflowReplayResult struct {
	Plan               WorkflowReplayPreview `json:"plan"`
	AcceptedGeneration int64                 `json:"acceptedGeneration"`
	AsOf               string                `json:"asOf"`
}

type WorkflowRow

type WorkflowRow struct {
	ID               string            `json:"id"`
	Name             string            `json:"name"`
	State            workflow.RunState `json:"state"`
	Version          int               `json:"version"`
	RecordedVersion  int               `json:"recordedVersion"`
	ReplayGeneration int64             `json:"replayGeneration"`
	ParentRunID      *string           `json:"parentRunId"`
	ScopeAppID       *string           `json:"scopeAppId"`
	ScopeOrgID       *string           `json:"scopeOrgId"`
	CreatedAt        *string           `json:"createdAt"`
	UpdatedAt        *string           `json:"updatedAt"`
	StartedAt        *string           `json:"startedAt"`
	CompletedAt      *string           `json:"completedAt"`
	Duration         *Duration         `json:"duration"`
}

type WorkflowsListInput

type WorkflowsListInput struct {
	State      workflow.RunState `json:"state"`
	NamePrefix string            `json:"namePrefix"`
	ScopeAppID string            `json:"scopeAppId"`
	ScopeOrgID string            `json:"scopeOrgId"`
	Cursor     string            `json:"cursor"`
	Limit      int               `json:"limit"`
}

Jump to

Keyboard shortcuts

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