Documentation
¶
Overview ¶
Package api will implement the looperd HTTP surface and adapters.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigFieldMetadata ¶ added in v0.11.0
type ConfigFieldMetadata struct {
Source string `json:"source"`
Editable bool `json:"editable"`
ApplyMode string `json:"applyMode"`
}
ConfigFieldMetadata describes where an effective field came from and whether the dashboard may change it without restarting looperd.
type ConfigMetadata ¶ added in v0.11.0
type ConfigMetadata struct {
ConfigPath string `json:"configPath"`
Format string `json:"format"`
FilePresent bool `json:"filePresent"`
Revision string `json:"revision"`
LastAttemptAt *time.Time `json:"lastAttemptAt,omitempty"`
LastAppliedAt *time.Time `json:"lastAppliedAt,omitempty"`
LastError *string `json:"lastError,omitempty"`
RejectedPaths []string `json:"rejectedPaths"`
Fields map[string]ConfigFieldMetadata `json:"fields"`
}
ConfigMetadata describes the effective configuration source and the most recent file reload attempt. Fields is keyed by canonical dotted config path.
type ConfigPatchIssue ¶ added in v0.11.0
type ConfigPatchIssue struct {
Path string `json:"path,omitempty"`
Code string `json:"code"`
Message string `json:"message"`
}
ConfigPatchIssue identifies one rejected field-level mutation.
type ConfigPatchRequest ¶ added in v0.11.0
type ConfigPatchRequest struct {
Revision string `json:"revision"`
Set map[string]json.RawMessage `json:"set"`
Unset []string `json:"unset"`
}
ConfigPatchRequest is the dashboard's field-level mutation contract. Set values stay as raw JSON so the configuration authority performs all typing and validation; Unset removes values from the file layer.
type ConfigRequestError ¶ added in v0.11.0
type ConfigRequestError struct {
Kind ConfigRequestErrorKind
Message string
Issues []ConfigPatchIssue
}
ConfigRequestError lets the configuration authority report stable field issues while the HTTP layer owns status codes and envelope formatting.
func (ConfigRequestError) Error ¶ added in v0.11.0
func (e ConfigRequestError) Error() string
type ConfigRequestErrorKind ¶ added in v0.11.0
type ConfigRequestErrorKind string
const ( ConfigRequestErrorKindValidation ConfigRequestErrorKind = "validation" ConfigRequestErrorKindConflict ConfigRequestErrorKind = "conflict" ConfigRequestErrorKindUnsupported ConfigRequestErrorKind = "unsupported" ConfigRequestErrorKindTooLarge ConfigRequestErrorKind = "too_large" )
type Context ¶
type Context struct {
Config config.Config
ConfigMetadata func() ConfigMetadata
ConfigSnapshot func() (config.Config, ConfigMetadata)
PatchConfig func(context.Context, ConfigPatchRequest) error
Runtime RuntimeState
WebhookForwarder webhookforward.Forwarder
ProjectsService projectService
Now func() time.Time
RecoverySummary func() any
ReconcileStaleRuns func(context.Context) (looperdruntime.StaleRunReconcileSummary, error)
StopLoop func(context.Context, string, string) (any, error)
CloseLoop func(context.Context, string, string) (any, error)
StopAll func(context.Context, string) (any, error)
// TakeoverLoop parks a loop for interactive human takeover: stops the daemon's
// in-flight run (session id preserved on disk) and transitions the loop to
// human_takeover, returning what a human needs to resume the exact session.
TakeoverLoop func(context.Context, string, string) (TakeoverResult, error)
RepairReviewer func(context.Context, reviewer.RepairInput) (reviewer.RepairResult, error)
TriggerSchedulerTick func()
}
type RuntimeState ¶
type RuntimeState interface {
Services() looperdruntime.Services
StartedAt() (time.Time, bool)
}