Documentation
¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.
Index ¶
- Constants
- func DevEcho(secret []byte, logger *slog.Logger) http.Handler
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler
- func LimitError(status int, code, message string) error
- func NewHandler(opts Options) http.Handler
- func QueueSettings(in QueueConfig) (store.QueueConfig, error)
- func Reserved(queue string) bool
- func ScheduleSettings(in ScheduleConfig, maxBody int64) (store.ScheduleConfig, error)
- func SystemQueue(queue string) bool
- func ValidateName(kind, name string) error
- func WorkflowSettings(in WorkflowConfig, maxBody int64) (store.WorkflowConfig, error)
- type Activity
- type ActivityBucket
- type ActivityRange
- type Admission
- type AlertChannel
- type AlertChannelID
- type AlertChannelList
- type AlertChannelType
- type Attempt
- type AttemptList
- type AutoPauseConfig
- type AutoPaused
- type BatchEnqueueRequest
- type BatchEnqueueResponse
- type BatchEnqueueResult
- type Callback
- type CancelPendingResult
- type CancelPendingTasks200JSONResponse
- type CancelPendingTasksRequestObject
- type CancelPendingTasksResponseObject
- type CancelPendingTasksdefaultJSONResponse
- type CancelRun200JSONResponse
- type CancelRunRequestObject
- type CancelRunResponseObject
- type CancelRundefaultJSONResponse
- type CancelTask200JSONResponse
- type CancelTaskRequestObject
- type CancelTaskResponseObject
- type CancelTaskdefaultJSONResponse
- type CancelWorkflowRun200JSONResponse
- type CancelWorkflowRunRequestObject
- type CancelWorkflowRunResponseObject
- type CancelWorkflowRundefaultJSONResponse
- type CloseGroup200JSONResponse
- type CloseGroupRequestObject
- type CloseGroupResponseObject
- type CloseGroupdefaultJSONResponse
- type CreateAlertChannel201JSONResponse
- type CreateAlertChannelJSONRequestBody
- type CreateAlertChannelRequestObject
- type CreateAlertChannelResponseObject
- type CreateAlertChanneldefaultJSONResponse
- type CreateGroup200JSONResponse
- type CreateGroup201JSONResponse
- type CreateGroupJSONRequestBody
- type CreateGroupRequestObject
- type CreateGroupResponseObject
- type CreateGroupdefaultJSONResponse
- type CreateTask200JSONResponse
- type CreateTask201JSONResponse
- type CreateTaskJSONRequestBody
- type CreateTaskParams
- type CreateTaskRequestObject
- type CreateTaskResponseObject
- type CreateTaskdefaultJSONResponse
- type CreateTasks200JSONResponse
- type CreateTasksJSONRequestBody
- type CreateTasksParams
- type CreateTasksRequestObject
- type CreateTasksResponseObject
- type CreateTasksdefaultJSONResponse
- type CronPreview
- type CronSpan
- type Cursor
- type DeleteAlertChannel204Response
- type DeleteAlertChannelRequestObject
- type DeleteAlertChannelResponseObject
- type DeleteAlertChanneldefaultJSONResponse
- type DeleteQueue204Response
- type DeleteQueueRequestObject
- type DeleteQueueResponseObject
- type DeleteQueuedefaultJSONResponse
- type DeleteSchedule204Response
- type DeleteScheduleRequestObject
- type DeleteScheduleResponseObject
- type DeleteScheduledefaultJSONResponse
- type DeleteWorkflow204Response
- type DeleteWorkflowRequestObject
- type DeleteWorkflowResponseObject
- type DeleteWorkflowdefaultJSONResponse
- type Delivery
- type EnqueueRequest
- type Error
- type ErrorBody
- type ErrorJSONResponse
- type FailureGroup
- type GetActivity200JSONResponse
- type GetActivityParams
- type GetActivityParamsRange
- type GetActivityRequestObject
- type GetActivityResponseObject
- type GetActivitydefaultJSONResponse
- type GetGroup200JSONResponse
- type GetGroupRequestObject
- type GetGroupResponseObject
- type GetGroupdefaultJSONResponse
- type GetHealthz200JSONResponse
- type GetHealthzRequestObject
- type GetHealthzResponseObject
- type GetQueue200JSONResponse
- type GetQueueActivity200JSONResponse
- type GetQueueActivityParams
- type GetQueueActivityRequestObject
- type GetQueueActivityResponseObject
- type GetQueueActivitydefaultJSONResponse
- type GetQueueFailures200JSONResponse
- type GetQueueFailuresParams
- type GetQueueFailuresRequestObject
- type GetQueueFailuresResponseObject
- type GetQueueFailuresdefaultJSONResponse
- type GetQueueRequestObject
- type GetQueueResponseObject
- type GetQueuedefaultJSONResponse
- type GetReadyz200JSONResponse
- type GetReadyz503JSONResponse
- type GetReadyzRequestObject
- type GetReadyzResponseObject
- type GetRun200JSONResponse
- type GetRunDelivery200JSONResponse
- type GetRunDeliveryRequestObject
- type GetRunDeliveryResponseObject
- type GetRunDeliverydefaultJSONResponse
- type GetRunRequestObject
- type GetRunResponseObject
- type GetRundefaultJSONResponse
- type GetSchedule200JSONResponse
- type GetScheduleRequestObject
- type GetScheduleResponseObject
- type GetScheduledefaultJSONResponse
- type GetTask200JSONResponse
- type GetTaskDelivery200JSONResponse
- type GetTaskDeliveryRequestObject
- type GetTaskDeliveryResponseObject
- type GetTaskDeliverydefaultJSONResponse
- type GetTaskRequestObject
- type GetTaskResponseObject
- type GetTaskdefaultJSONResponse
- type GetWorkflow200JSONResponse
- type GetWorkflowRequestObject
- type GetWorkflowResponseObject
- type GetWorkflowRun200JSONResponse
- type GetWorkflowRunRequestObject
- type GetWorkflowRunResponseObject
- type GetWorkflowRundefaultJSONResponse
- type GetWorkflowdefaultJSONResponse
- type Group
- type GroupID
- type GroupList
- type GroupStatus
- type HTTPMethod
- type Handlers
- func (h Handlers) CancelPendingTasks(ctx context.Context, req CancelPendingTasksRequestObject) (CancelPendingTasksResponseObject, error)
- func (h Handlers) CancelRun(ctx context.Context, req CancelRunRequestObject) (CancelRunResponseObject, error)
- func (h Handlers) CancelTask(ctx context.Context, req CancelTaskRequestObject) (CancelTaskResponseObject, error)
- func (h Handlers) CancelWorkflowRun(ctx context.Context, req CancelWorkflowRunRequestObject) (CancelWorkflowRunResponseObject, error)
- func (h Handlers) CloseGroup(ctx context.Context, req CloseGroupRequestObject) (CloseGroupResponseObject, error)
- func (h Handlers) CreateAlertChannel(ctx context.Context, req CreateAlertChannelRequestObject) (CreateAlertChannelResponseObject, error)
- func (h Handlers) CreateGroup(ctx context.Context, req CreateGroupRequestObject) (CreateGroupResponseObject, error)
- func (h Handlers) CreateTask(ctx context.Context, req CreateTaskRequestObject) (CreateTaskResponseObject, error)
- func (h Handlers) CreateTasks(ctx context.Context, req CreateTasksRequestObject) (CreateTasksResponseObject, error)
- func (h Handlers) DeleteAlertChannel(ctx context.Context, req DeleteAlertChannelRequestObject) (DeleteAlertChannelResponseObject, error)
- func (h Handlers) DeleteQueue(ctx context.Context, req DeleteQueueRequestObject) (DeleteQueueResponseObject, error)
- func (h Handlers) DeleteSchedule(ctx context.Context, req DeleteScheduleRequestObject) (DeleteScheduleResponseObject, error)
- func (h Handlers) DeleteWorkflow(ctx context.Context, req DeleteWorkflowRequestObject) (DeleteWorkflowResponseObject, error)
- func (h Handlers) GetActivity(ctx context.Context, req GetActivityRequestObject) (GetActivityResponseObject, error)
- func (h Handlers) GetGroup(ctx context.Context, req GetGroupRequestObject) (GetGroupResponseObject, error)
- func (h Handlers) GetHealthz(ctx context.Context, _ GetHealthzRequestObject) (GetHealthzResponseObject, error)
- func (h Handlers) GetQueue(ctx context.Context, req GetQueueRequestObject) (GetQueueResponseObject, error)
- func (h Handlers) GetQueueActivity(ctx context.Context, req GetQueueActivityRequestObject) (GetQueueActivityResponseObject, error)
- func (h Handlers) GetQueueFailures(ctx context.Context, req GetQueueFailuresRequestObject) (GetQueueFailuresResponseObject, error)
- func (h Handlers) GetReadyz(ctx context.Context, _ GetReadyzRequestObject) (GetReadyzResponseObject, error)
- func (h Handlers) GetRun(ctx context.Context, req GetRunRequestObject) (GetRunResponseObject, error)
- func (h Handlers) GetRunDelivery(ctx context.Context, req GetRunDeliveryRequestObject) (GetRunDeliveryResponseObject, error)
- func (h Handlers) GetSchedule(ctx context.Context, req GetScheduleRequestObject) (GetScheduleResponseObject, error)
- func (h Handlers) GetTask(ctx context.Context, req GetTaskRequestObject) (GetTaskResponseObject, error)
- func (h Handlers) GetTaskDelivery(ctx context.Context, req GetTaskDeliveryRequestObject) (GetTaskDeliveryResponseObject, error)
- func (h Handlers) GetWorkflow(ctx context.Context, req GetWorkflowRequestObject) (GetWorkflowResponseObject, error)
- func (h Handlers) GetWorkflowRun(ctx context.Context, req GetWorkflowRunRequestObject) (GetWorkflowRunResponseObject, error)
- func (h Handlers) ListAlertChannels(ctx context.Context, _ ListAlertChannelsRequestObject) (ListAlertChannelsResponseObject, error)
- func (h Handlers) ListAttempts(ctx context.Context, req ListAttemptsRequestObject) (ListAttemptsResponseObject, error)
- func (h Handlers) ListGroups(ctx context.Context, req ListGroupsRequestObject) (ListGroupsResponseObject, error)
- func (h Handlers) ListQueues(ctx context.Context, _ ListQueuesRequestObject) (ListQueuesResponseObject, error)
- func (h Handlers) ListRunAttempts(ctx context.Context, req ListRunAttemptsRequestObject) (ListRunAttemptsResponseObject, error)
- func (h Handlers) ListRuns(ctx context.Context, req ListRunsRequestObject) (ListRunsResponseObject, error)
- func (h Handlers) ListSchedules(ctx context.Context, _ ListSchedulesRequestObject) (ListSchedulesResponseObject, error)
- func (h Handlers) ListTasks(ctx context.Context, req ListTasksRequestObject) (ListTasksResponseObject, error)
- func (h Handlers) ListWorkflowRuns(ctx context.Context, req ListWorkflowRunsRequestObject) (ListWorkflowRunsResponseObject, error)
- func (h Handlers) ListWorkflows(ctx context.Context, _ ListWorkflowsRequestObject) (ListWorkflowsResponseObject, error)
- func (h Handlers) PauseQueue(ctx context.Context, req PauseQueueRequestObject) (PauseQueueResponseObject, error)
- func (h Handlers) PauseSchedule(ctx context.Context, req PauseScheduleRequestObject) (PauseScheduleResponseObject, error)
- func (h Handlers) PreviewCron(ctx context.Context, req PreviewCronRequestObject) (PreviewCronResponseObject, error)
- func (h Handlers) PutQueue(ctx context.Context, req PutQueueRequestObject) (PutQueueResponseObject, error)
- func (h Handlers) PutSchedule(ctx context.Context, req PutScheduleRequestObject) (PutScheduleResponseObject, error)
- func (h Handlers) PutWorkflow(ctx context.Context, req PutWorkflowRequestObject) (PutWorkflowResponseObject, error)
- func (h Handlers) ResumeQueue(ctx context.Context, req ResumeQueueRequestObject) (ResumeQueueResponseObject, error)
- func (h Handlers) ResumeSchedule(ctx context.Context, req ResumeScheduleRequestObject) (ResumeScheduleResponseObject, error)
- func (h Handlers) RetryFailedTasks(ctx context.Context, req RetryFailedTasksRequestObject) (RetryFailedTasksResponseObject, error)
- func (h Handlers) RetryRun(ctx context.Context, req RetryRunRequestObject) (RetryRunResponseObject, error)
- func (h Handlers) RetryTask(ctx context.Context, req RetryTaskRequestObject) (RetryTaskResponseObject, error)
- func (h Handlers) RetryWorkflowRun(ctx context.Context, req RetryWorkflowRunRequestObject) (RetryWorkflowRunResponseObject, error)
- func (h Handlers) SearchTasks(ctx context.Context, req SearchTasksRequestObject) (SearchTasksResponseObject, error)
- func (h Handlers) StartWorkflowRun(ctx context.Context, req StartWorkflowRunRequestObject) (StartWorkflowRunResponseObject, error)
- func (h Handlers) TestAlertChannel(ctx context.Context, req TestAlertChannelRequestObject) (TestAlertChannelResponseObject, error)
- func (h Handlers) TriggerSchedule(ctx context.Context, req TriggerScheduleRequestObject) (TriggerScheduleResponseObject, error)
- type Health
- type InvalidParamFormatError
- type LastError
- type LastRun
- type Limit
- type ListAlertChannels200JSONResponse
- type ListAlertChannelsRequestObject
- type ListAlertChannelsResponseObject
- type ListAlertChannelsdefaultJSONResponse
- type ListAttempts200JSONResponse
- type ListAttemptsRequestObject
- type ListAttemptsResponseObject
- type ListAttemptsdefaultJSONResponse
- type ListGroups200JSONResponse
- type ListGroupsParams
- type ListGroupsRequestObject
- type ListGroupsResponseObject
- type ListGroupsdefaultJSONResponse
- type ListQueues200JSONResponse
- type ListQueuesRequestObject
- type ListQueuesResponseObject
- type ListQueuesdefaultJSONResponse
- type ListRunAttempts200JSONResponse
- type ListRunAttemptsRequestObject
- type ListRunAttemptsResponseObject
- type ListRunAttemptsdefaultJSONResponse
- type ListRuns200JSONResponse
- type ListRunsParams
- type ListRunsRequestObject
- type ListRunsResponseObject
- type ListRunsdefaultJSONResponse
- type ListSchedules200JSONResponse
- type ListSchedulesRequestObject
- type ListSchedulesResponseObject
- type ListSchedulesdefaultJSONResponse
- type ListTasks200JSONResponse
- type ListTasksParams
- type ListTasksParamsOrder
- type ListTasksParamsSort
- type ListTasksRequestObject
- type ListTasksResponseObject
- type ListTasksdefaultJSONResponse
- type ListWorkflowRuns200JSONResponse
- type ListWorkflowRunsParams
- type ListWorkflowRunsRequestObject
- type ListWorkflowRunsResponseObject
- type ListWorkflowRunsdefaultJSONResponse
- type ListWorkflows200JSONResponse
- type ListWorkflowsRequestObject
- type ListWorkflowsResponseObject
- type ListWorkflowsdefaultJSONResponse
- type MiddlewareFunc
- type MissedPolicy
- type NewAlertChannel
- type NewGroup
- type Options
- type Outcome
- type OverlapPolicy
- type PauseQueue200JSONResponse
- type PauseQueueRequestObject
- type PauseQueueResponseObject
- type PauseQueuedefaultJSONResponse
- type PauseSchedule200JSONResponse
- type PauseScheduleRequestObject
- type PauseScheduleResponseObject
- type PauseScheduledefaultJSONResponse
- type PreviewCron200JSONResponse
- type PreviewCronParams
- type PreviewCronRequestObject
- type PreviewCronResponseObject
- type PreviewCrondefaultJSONResponse
- type PutQueue200JSONResponse
- type PutQueue201JSONResponse
- type PutQueueJSONRequestBody
- type PutQueueRequestObject
- type PutQueueResponseObject
- type PutQueuedefaultJSONResponse
- type PutSchedule200JSONResponse
- type PutSchedule201JSONResponse
- type PutScheduleJSONRequestBody
- type PutScheduleRequestObject
- type PutScheduleResponseObject
- type PutScheduledefaultJSONResponse
- type PutWorkflow200JSONResponse
- type PutWorkflow201JSONResponse
- type PutWorkflowJSONRequestBody
- type PutWorkflowRequestObject
- type PutWorkflowResponseObject
- type PutWorkflowdefaultJSONResponse
- type Queue
- type QueueActivity
- type QueueConfig
- type QueueFailures
- type QueueList
- type QueueName
- type QueueStats
- type RequiredHeaderError
- type RequiredParamError
- type ResumeQueue200JSONResponse
- type ResumeQueueRequestObject
- type ResumeQueueResponseObject
- type ResumeQueuedefaultJSONResponse
- type ResumeSchedule200JSONResponse
- type ResumeScheduleRequestObject
- type ResumeScheduleResponseObject
- type ResumeScheduledefaultJSONResponse
- type RetryFailedResult
- type RetryFailedTasks200JSONResponse
- type RetryFailedTasksParams
- type RetryFailedTasksRequestObject
- type RetryFailedTasksResponseObject
- type RetryFailedTasksdefaultJSONResponse
- type RetryRun200JSONResponse
- type RetryRunRequestObject
- type RetryRunResponseObject
- type RetryRundefaultJSONResponse
- type RetryTask200JSONResponse
- type RetryTaskRequestObject
- type RetryTaskResponseObject
- type RetryTaskdefaultJSONResponse
- type RetryWorkflowRun200JSONResponse
- type RetryWorkflowRunRequestObject
- type RetryWorkflowRunResponseObject
- type RetryWorkflowRundefaultJSONResponse
- type Run
- type RunID
- type RunList
- type RunState
- type RunTrigger
- type Schedule
- type ScheduleAdmission
- type ScheduleConfig
- type ScheduleList
- type ScheduleName
- type SearchTasks200JSONResponse
- type SearchTasksParams
- type SearchTasksParamsOrder
- type SearchTasksParamsSort
- type SearchTasksRequestObject
- type SearchTasksResponseObject
- type SearchTasksdefaultJSONResponse
- type ServeMux
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) CancelPendingTasks(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CancelRun(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CancelTask(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CancelWorkflowRun(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CloseGroup(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CreateAlertChannel(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CreateGroup(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CreateTask(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CreateTasks(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteAlertChannel(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteQueue(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteSchedule(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteWorkflow(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetActivity(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetGroup(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetHealthz(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetQueue(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetQueueActivity(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetQueueFailures(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetReadyz(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetRun(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetRunDelivery(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetSchedule(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetTask(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetTaskDelivery(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetWorkflow(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetWorkflowRun(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListAlertChannels(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListAttempts(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListGroups(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListQueues(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListRunAttempts(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListRuns(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListSchedules(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListTasks(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListWorkflowRuns(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListWorkflows(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PauseQueue(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PauseSchedule(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PreviewCron(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PutQueue(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PutSchedule(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PutWorkflow(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ResumeQueue(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ResumeSchedule(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) RetryFailedTasks(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) RetryRun(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) RetryTask(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) RetryWorkflowRun(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) SearchTasks(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) StartWorkflowRun(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) TestAlertChannel(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) TriggerSchedule(w http.ResponseWriter, r *http.Request)
- type SkipReason
- type SortOrder
- type StartWorkflowRun
- type StartWorkflowRun200JSONResponse
- type StartWorkflowRun201JSONResponse
- type StartWorkflowRunJSONRequestBody
- type StartWorkflowRunRequestObject
- type StartWorkflowRunResponseObject
- type StartWorkflowRundefaultJSONResponse
- type StdHTTPServerOptions
- type StepStatus
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type Task
- type TaskID
- type TaskList
- type TaskSort
- type TaskState
- type TaskWorkflowStep
- type TestAlertChannel204Response
- type TestAlertChannelRequestObject
- type TestAlertChannelResponseObject
- type TestAlertChanneldefaultJSONResponse
- type TooManyValuesForParamError
- type TriggerSchedule201JSONResponse
- type TriggerScheduleRequestObject
- type TriggerScheduleResponseObject
- type TriggerScheduledefaultJSONResponse
- type UnescapedCookieParamError
- type UnmarshalingParamError
- type WaitFor
- type WaitForType
- type Workflow
- type WorkflowConfig
- type WorkflowList
- type WorkflowName
- type WorkflowRun
- type WorkflowRunID
- type WorkflowRunList
- type WorkflowRunStatus
- type WorkflowRunSummary
- type WorkflowStep
- type WorkflowStepConfig
- type WorkflowStepTask
Constants ¶
const CallbackQueue = store.CallbackQueue
CallbackQueue is the queue every callback goes to. Only Workly enqueues into it.
const WorkflowQueue = store.WorkflowQueue
WorkflowQueue is the queue workflow steps go to unless they name one.
Variables ¶
This section is empty.
Functions ¶
func DevEcho ¶
DevEcho is a built-in delivery target for `workly dev`, so the quickstart and demos work without writing an endpoint first. Query parameters shape its response:
status=503 respond with this status (default 200) fail_rate=0.3 respond 500 with this probability delay_ms=2000 wait before responding
It verifies the delivery signature and echoes the request back.
func Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerFromMuxWithBaseURL ¶
func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
func LimitError ¶
LimitError is an error an Admission returns to refuse a request; the client gets it as is, in the API's error shape.
func NewHandler ¶
NewHandler builds the full HTTP handler: operational endpoints, the /v1 API and the dashboard.
func QueueSettings ¶ added in v0.2.0
func QueueSettings(in QueueConfig) (store.QueueConfig, error)
func Reserved ¶ added in v0.2.1
Reserved reports whether a queue name is reserved for Workly's own queues. Queues with such names that users created before they were reserved keep working, but no new ones can be created.
func ScheduleSettings ¶ added in v0.2.0
func ScheduleSettings(in ScheduleConfig, maxBody int64) (store.ScheduleConfig, error)
func SystemQueue ¶ added in v0.4.0
SystemQueue reports whether a queue is one of Workly's own, which users can configure but only Workly enqueues into: _callbacks and _workflows.
func ValidateName ¶ added in v0.2.0
func WorkflowSettings ¶ added in v0.4.0
func WorkflowSettings(in WorkflowConfig, maxBody int64) (store.WorkflowConfig, error)
WorkflowSettings validates a workflow definition as PutWorkflow does.
Types ¶
type Activity ¶
type Activity struct {
BucketSeconds int `json:"bucket_seconds"`
Buckets []ActivityBucket `json:"buckets"`
Range ActivityRange `json:"range"`
// RetentionSeconds How long the server keeps finished tasks (`WORKLY_RETENTION`).
// Absent if it keeps them forever.
RetentionSeconds *float64 `json:"retention_seconds,omitempty"`
}
Activity defines model for Activity.
type ActivityBucket ¶
type ActivityBucket struct {
// Counts Tasks created in the bucket, by queue; queues with none are left out.
Counts map[string]int `json:"counts"`
// Failed Tasks of every queue that finished in the bucket and failed.
Failed int `json:"failed"`
Start time.Time `json:"start"`
// Succeeded Tasks of every queue that finished in the bucket and succeeded.
Succeeded int `json:"succeeded"`
}
ActivityBucket defines model for ActivityBucket.
type ActivityRange ¶
type ActivityRange string
ActivityRange defines model for Activity.Range.
const ( ActivityRangeN1h ActivityRange = "1h" ActivityRangeN24h ActivityRange = "24h" ActivityRangeN7d ActivityRange = "7d" )
Defines values for ActivityRange.
func (ActivityRange) Valid ¶
func (e ActivityRange) Valid() bool
Valid indicates whether the value is a known member of the ActivityRange enum.
type Admission ¶
type Admission interface {
// AdmitTasks is called before up to n tasks are enqueued.
AdmitTasks(ctx context.Context, ws workspace.ID, n int) error
// AdmitSchedule is called before a schedule is created or replaced.
AdmitSchedule(ctx context.Context, ws workspace.ID, s ScheduleAdmission) error
}
Admission lets a wrapping server limit what workspaces add, e.g. quotas on a hosted service. Workly itself sets no limits.
type AlertChannel ¶
type AlertChannel struct {
CreatedAt time.Time `json:"created_at"`
// Id Example: ach_01J9ZK3M5Q8R2T4V6W8X0Y2Z4A
Id string `json:"id"`
// Target The email address, or the Slack webhook URL with its secret part
// hidden.
Target string `json:"target"`
Type AlertChannelType `json:"type"`
}
AlertChannel defines model for AlertChannel.
type AlertChannelList ¶
type AlertChannelList struct {
Channels []AlertChannel `json:"channels"`
// EmailEnabled Whether this server can send email, so email channels can be added.
EmailEnabled bool `json:"email_enabled"`
}
AlertChannelList defines model for AlertChannelList.
type AlertChannelType ¶
type AlertChannelType string
AlertChannelType defines model for AlertChannelType.
const ( Email AlertChannelType = "email" Slack AlertChannelType = "slack" )
Defines values for AlertChannelType.
func (AlertChannelType) Valid ¶
func (e AlertChannelType) Valid() bool
Valid indicates whether the value is a known member of the AlertChannelType enum.
type Attempt ¶
type Attempt struct {
DurationMs int `json:"duration_ms"`
Error *string `json:"error,omitempty"`
FinishedAt time.Time `json:"finished_at"`
Id string `json:"id"`
Number int `json:"number"`
// Outcome How a delivery attempt ended. `lost` means the result is unknown: the
// dispatcher crashed or shut down mid-delivery, and the endpoint may
// have processed the request.
Outcome Outcome `json:"outcome"`
// ResponseBody The first 4 KB of the response body.
ResponseBody *string `json:"response_body,omitempty"`
// ResponseHeaders Selected response headers (Content-Type, Retry-After, Location).
ResponseHeaders map[string]string `json:"response_headers"`
// RetriedAt Set when the task or run was retried by hand between the previous
// attempt and this one: when that happened. Absent for automatic
// retries.
RetriedAt *time.Time `json:"retried_at,omitempty"`
StartedAt time.Time `json:"started_at"`
// StatusCode Absent if there was no response.
StatusCode *int `json:"status_code,omitempty"`
}
Attempt defines model for Attempt.
type AttemptList ¶
type AttemptList struct {
Attempts []Attempt `json:"attempts"`
}
AttemptList defines model for AttemptList.
type AutoPauseConfig ¶ added in v0.5.0
type AutoPauseConfig struct {
AfterFailures int `json:"after_failures"`
}
AutoPauseConfig Pause the queue by itself when its endpoint looks down: after `after_failures` attempts in a row end with a 5xx, a timeout or a network error. Other 4xx responses, 429 and lost attempts don't count, and only a success resets the count. While auto-paused, tasks wait without using attempts, and one task at a time goes as a probe: 30 seconds after the pause, then after twice as long each time it fails, up to every 10 minutes. The first success resumes the queue. Resuming it by hand does too. Omit for no auto-pause. Not for queues whose tasks go to many endpoints, where one being down would hold up the rest; Workly's own queues can't have it.
type AutoPaused ¶ added in v0.5.0
type AutoPaused struct {
// Error The error of the attempt that paused it, or of the latest failed probe.
Error string `json:"error"`
// NextProbeAt When the next probe goes, unless one is in flight, in which case
// its result sets the next. No probes go while the queue is also
// paused by hand.
NextProbeAt time.Time `json:"next_probe_at"`
// Probes Probes that failed since it paused.
Probes int `json:"probes"`
// Since When it paused.
Since time.Time `json:"since"`
}
AutoPaused The queue paused itself after failures in a row (see `auto_pause`). Absent when it hasn't, or once it resumed.
type BatchEnqueueRequest ¶
type BatchEnqueueRequest struct {
Tasks []EnqueueRequest `json:"tasks"`
}
BatchEnqueueRequest defines model for BatchEnqueueRequest.
type BatchEnqueueResponse ¶
type BatchEnqueueResponse struct {
Results []BatchEnqueueResult `json:"results"`
}
BatchEnqueueResponse defines model for BatchEnqueueResponse.
type BatchEnqueueResult ¶
type BatchEnqueueResult struct {
// Created False if a task with the same idempotency key already existed.
Created bool `json:"created"`
Task Task `json:"task"`
}
BatchEnqueueResult defines model for BatchEnqueueResult.
type Callback ¶ added in v0.2.1
type Callback struct {
// Headers Headers sent with the callback. `Workly-*` headers are reserved.
Headers *map[string]string `json:"headers,omitempty"`
// Url The http(s) URL to deliver the callback to.
//
// Example: https://api.example.com/jobs/refresh-views
Url string `json:"url"`
}
Callback A task Workly enqueues when something completes: a `POST` to `url` whose JSON body says what completed (`TaskSummary` for a task, `RunSummary` for a schedule's run, `GroupSummary` for a group). Callbacks go to `_callbacks`, a queue Workly creates for them, and are delivered like any task in it, with its retries; its settings can be changed like any queue's.
A task's or a schedule's callback is called each time the task or a run succeeds, fails or is cancelled, and again if it is retried by hand and finishes again; skipped runs don't call it. A group's is called once, when the group completes.
type CancelPendingResult ¶
type CancelPendingResult struct {
// Cancelled How many pending tasks were cancelled.
Cancelled int `json:"cancelled"`
}
CancelPendingResult defines model for CancelPendingResult.
type CancelPendingTasks200JSONResponse ¶
type CancelPendingTasks200JSONResponse CancelPendingResult
func (CancelPendingTasks200JSONResponse) VisitCancelPendingTasksResponse ¶
func (response CancelPendingTasks200JSONResponse) VisitCancelPendingTasksResponse(w http.ResponseWriter) error
type CancelPendingTasksRequestObject ¶
type CancelPendingTasksRequestObject struct {
Queue QueueName `json:"queue"`
}
type CancelPendingTasksResponseObject ¶
type CancelPendingTasksResponseObject interface {
VisitCancelPendingTasksResponse(w http.ResponseWriter) error
}
type CancelPendingTasksdefaultJSONResponse ¶
func (CancelPendingTasksdefaultJSONResponse) VisitCancelPendingTasksResponse ¶
func (response CancelPendingTasksdefaultJSONResponse) VisitCancelPendingTasksResponse(w http.ResponseWriter) error
type CancelRun200JSONResponse ¶
type CancelRun200JSONResponse Run
func (CancelRun200JSONResponse) VisitCancelRunResponse ¶
func (response CancelRun200JSONResponse) VisitCancelRunResponse(w http.ResponseWriter) error
type CancelRunRequestObject ¶
type CancelRunRequestObject struct {
Id RunID `json:"id"`
}
type CancelRunResponseObject ¶
type CancelRunResponseObject interface {
VisitCancelRunResponse(w http.ResponseWriter) error
}
type CancelRundefaultJSONResponse ¶
func (CancelRundefaultJSONResponse) VisitCancelRunResponse ¶
func (response CancelRundefaultJSONResponse) VisitCancelRunResponse(w http.ResponseWriter) error
type CancelTask200JSONResponse ¶
type CancelTask200JSONResponse Task
func (CancelTask200JSONResponse) VisitCancelTaskResponse ¶
func (response CancelTask200JSONResponse) VisitCancelTaskResponse(w http.ResponseWriter) error
type CancelTaskRequestObject ¶
type CancelTaskRequestObject struct {
Id TaskID `json:"id"`
}
type CancelTaskResponseObject ¶
type CancelTaskResponseObject interface {
VisitCancelTaskResponse(w http.ResponseWriter) error
}
type CancelTaskdefaultJSONResponse ¶
func (CancelTaskdefaultJSONResponse) VisitCancelTaskResponse ¶
func (response CancelTaskdefaultJSONResponse) VisitCancelTaskResponse(w http.ResponseWriter) error
type CancelWorkflowRun200JSONResponse ¶ added in v0.4.0
type CancelWorkflowRun200JSONResponse WorkflowRun
func (CancelWorkflowRun200JSONResponse) VisitCancelWorkflowRunResponse ¶ added in v0.4.0
func (response CancelWorkflowRun200JSONResponse) VisitCancelWorkflowRunResponse(w http.ResponseWriter) error
type CancelWorkflowRunRequestObject ¶ added in v0.4.0
type CancelWorkflowRunRequestObject struct {
Id WorkflowRunID `json:"id"`
}
type CancelWorkflowRunResponseObject ¶ added in v0.4.0
type CancelWorkflowRunResponseObject interface {
VisitCancelWorkflowRunResponse(w http.ResponseWriter) error
}
type CancelWorkflowRundefaultJSONResponse ¶ added in v0.4.0
func (CancelWorkflowRundefaultJSONResponse) VisitCancelWorkflowRunResponse ¶ added in v0.4.0
func (response CancelWorkflowRundefaultJSONResponse) VisitCancelWorkflowRunResponse(w http.ResponseWriter) error
type CloseGroup200JSONResponse ¶ added in v0.2.0
type CloseGroup200JSONResponse Group
func (CloseGroup200JSONResponse) VisitCloseGroupResponse ¶ added in v0.2.0
func (response CloseGroup200JSONResponse) VisitCloseGroupResponse(w http.ResponseWriter) error
type CloseGroupRequestObject ¶ added in v0.2.0
type CloseGroupRequestObject struct {
Id GroupID `json:"id"`
}
type CloseGroupResponseObject ¶ added in v0.2.0
type CloseGroupResponseObject interface {
VisitCloseGroupResponse(w http.ResponseWriter) error
}
type CloseGroupdefaultJSONResponse ¶ added in v0.2.0
func (CloseGroupdefaultJSONResponse) VisitCloseGroupResponse ¶ added in v0.2.0
func (response CloseGroupdefaultJSONResponse) VisitCloseGroupResponse(w http.ResponseWriter) error
type CreateAlertChannel201JSONResponse ¶
type CreateAlertChannel201JSONResponse AlertChannel
func (CreateAlertChannel201JSONResponse) VisitCreateAlertChannelResponse ¶
func (response CreateAlertChannel201JSONResponse) VisitCreateAlertChannelResponse(w http.ResponseWriter) error
type CreateAlertChannelJSONRequestBody ¶
type CreateAlertChannelJSONRequestBody = NewAlertChannel
CreateAlertChannelJSONRequestBody defines body for CreateAlertChannel for application/json ContentType.
type CreateAlertChannelRequestObject ¶
type CreateAlertChannelRequestObject struct {
Body *CreateAlertChannelJSONRequestBody
}
type CreateAlertChannelResponseObject ¶
type CreateAlertChannelResponseObject interface {
VisitCreateAlertChannelResponse(w http.ResponseWriter) error
}
type CreateAlertChanneldefaultJSONResponse ¶
func (CreateAlertChanneldefaultJSONResponse) VisitCreateAlertChannelResponse ¶
func (response CreateAlertChanneldefaultJSONResponse) VisitCreateAlertChannelResponse(w http.ResponseWriter) error
type CreateGroup200JSONResponse ¶ added in v0.2.0
type CreateGroup200JSONResponse Group
func (CreateGroup200JSONResponse) VisitCreateGroupResponse ¶ added in v0.2.0
func (response CreateGroup200JSONResponse) VisitCreateGroupResponse(w http.ResponseWriter) error
type CreateGroup201JSONResponse ¶ added in v0.2.0
type CreateGroup201JSONResponse Group
func (CreateGroup201JSONResponse) VisitCreateGroupResponse ¶ added in v0.2.0
func (response CreateGroup201JSONResponse) VisitCreateGroupResponse(w http.ResponseWriter) error
type CreateGroupJSONRequestBody ¶ added in v0.2.0
type CreateGroupJSONRequestBody = NewGroup
CreateGroupJSONRequestBody defines body for CreateGroup for application/json ContentType.
type CreateGroupRequestObject ¶ added in v0.2.0
type CreateGroupRequestObject struct {
Body *CreateGroupJSONRequestBody
}
type CreateGroupResponseObject ¶ added in v0.2.0
type CreateGroupResponseObject interface {
VisitCreateGroupResponse(w http.ResponseWriter) error
}
type CreateGroupdefaultJSONResponse ¶ added in v0.2.0
func (CreateGroupdefaultJSONResponse) VisitCreateGroupResponse ¶ added in v0.2.0
func (response CreateGroupdefaultJSONResponse) VisitCreateGroupResponse(w http.ResponseWriter) error
type CreateTask200JSONResponse ¶
type CreateTask200JSONResponse Task
func (CreateTask200JSONResponse) VisitCreateTaskResponse ¶
func (response CreateTask200JSONResponse) VisitCreateTaskResponse(w http.ResponseWriter) error
type CreateTask201JSONResponse ¶
type CreateTask201JSONResponse Task
func (CreateTask201JSONResponse) VisitCreateTaskResponse ¶
func (response CreateTask201JSONResponse) VisitCreateTaskResponse(w http.ResponseWriter) error
type CreateTaskJSONRequestBody ¶
type CreateTaskJSONRequestBody = EnqueueRequest
CreateTaskJSONRequestBody defines body for CreateTask for application/json ContentType.
type CreateTaskParams ¶
type CreateTaskParams struct {
// Traceparent W3C trace context, propagated on delivery.
Traceparent *string `json:"traceparent,omitempty"`
}
CreateTaskParams defines parameters for CreateTask.
type CreateTaskRequestObject ¶
type CreateTaskRequestObject struct {
Queue QueueName `json:"queue"`
Params CreateTaskParams
Body *CreateTaskJSONRequestBody
}
type CreateTaskResponseObject ¶
type CreateTaskResponseObject interface {
VisitCreateTaskResponse(w http.ResponseWriter) error
}
type CreateTaskdefaultJSONResponse ¶
func (CreateTaskdefaultJSONResponse) VisitCreateTaskResponse ¶
func (response CreateTaskdefaultJSONResponse) VisitCreateTaskResponse(w http.ResponseWriter) error
type CreateTasks200JSONResponse ¶
type CreateTasks200JSONResponse BatchEnqueueResponse
func (CreateTasks200JSONResponse) VisitCreateTasksResponse ¶
func (response CreateTasks200JSONResponse) VisitCreateTasksResponse(w http.ResponseWriter) error
type CreateTasksJSONRequestBody ¶
type CreateTasksJSONRequestBody = BatchEnqueueRequest
CreateTasksJSONRequestBody defines body for CreateTasks for application/json ContentType.
type CreateTasksParams ¶
type CreateTasksParams struct {
// Traceparent W3C trace context, propagated on delivery of every task.
Traceparent *string `json:"traceparent,omitempty"`
}
CreateTasksParams defines parameters for CreateTasks.
type CreateTasksRequestObject ¶
type CreateTasksRequestObject struct {
Queue QueueName `json:"queue"`
Params CreateTasksParams
Body *CreateTasksJSONRequestBody
}
type CreateTasksResponseObject ¶
type CreateTasksResponseObject interface {
VisitCreateTasksResponse(w http.ResponseWriter) error
}
type CreateTasksdefaultJSONResponse ¶
func (CreateTasksdefaultJSONResponse) VisitCreateTasksResponse ¶
func (response CreateTasksdefaultJSONResponse) VisitCreateTasksResponse(w http.ResponseWriter) error
type CronPreview ¶
type CronPreview struct {
// IntervalSeconds The shortest time between two of its runs.
IntervalSeconds int `json:"interval_seconds"`
// NextRuns The next 5 runs, from now.
NextRuns []time.Time `json:"next_runs"`
// Spans With `from` and `until`: every run in the window, earliest first,
// as runs at a fixed interval, so a schedule running every minute is
// one span rather than thousands of times.
Spans *[]CronSpan `json:"spans,omitempty"`
}
CronPreview defines model for CronPreview.
type CronSpan ¶ added in v0.4.0
type CronSpan struct {
Count int `json:"count"`
// EverySeconds 0 when `count` is 1.
EverySeconds int `json:"every_seconds"`
Start time.Time `json:"start"`
}
CronSpan `count` runs, `every_seconds` apart, the first at `start`.
type DeleteAlertChannel204Response ¶
type DeleteAlertChannel204Response struct {
}
func (DeleteAlertChannel204Response) VisitDeleteAlertChannelResponse ¶
func (response DeleteAlertChannel204Response) VisitDeleteAlertChannelResponse(w http.ResponseWriter) error
type DeleteAlertChannelRequestObject ¶
type DeleteAlertChannelRequestObject struct {
Id AlertChannelID `json:"id"`
}
type DeleteAlertChannelResponseObject ¶
type DeleteAlertChannelResponseObject interface {
VisitDeleteAlertChannelResponse(w http.ResponseWriter) error
}
type DeleteAlertChanneldefaultJSONResponse ¶
func (DeleteAlertChanneldefaultJSONResponse) VisitDeleteAlertChannelResponse ¶
func (response DeleteAlertChanneldefaultJSONResponse) VisitDeleteAlertChannelResponse(w http.ResponseWriter) error
type DeleteQueue204Response ¶
type DeleteQueue204Response struct {
}
func (DeleteQueue204Response) VisitDeleteQueueResponse ¶
func (response DeleteQueue204Response) VisitDeleteQueueResponse(w http.ResponseWriter) error
type DeleteQueueRequestObject ¶
type DeleteQueueRequestObject struct {
Queue QueueName `json:"queue"`
}
type DeleteQueueResponseObject ¶
type DeleteQueueResponseObject interface {
VisitDeleteQueueResponse(w http.ResponseWriter) error
}
type DeleteQueuedefaultJSONResponse ¶
func (DeleteQueuedefaultJSONResponse) VisitDeleteQueueResponse ¶
func (response DeleteQueuedefaultJSONResponse) VisitDeleteQueueResponse(w http.ResponseWriter) error
type DeleteSchedule204Response ¶
type DeleteSchedule204Response struct {
}
func (DeleteSchedule204Response) VisitDeleteScheduleResponse ¶
func (response DeleteSchedule204Response) VisitDeleteScheduleResponse(w http.ResponseWriter) error
type DeleteScheduleRequestObject ¶
type DeleteScheduleRequestObject struct {
Schedule ScheduleName `json:"schedule"`
}
type DeleteScheduleResponseObject ¶
type DeleteScheduleResponseObject interface {
VisitDeleteScheduleResponse(w http.ResponseWriter) error
}
type DeleteScheduledefaultJSONResponse ¶
func (DeleteScheduledefaultJSONResponse) VisitDeleteScheduleResponse ¶
func (response DeleteScheduledefaultJSONResponse) VisitDeleteScheduleResponse(w http.ResponseWriter) error
type DeleteWorkflow204Response ¶ added in v0.4.0
type DeleteWorkflow204Response struct {
}
func (DeleteWorkflow204Response) VisitDeleteWorkflowResponse ¶ added in v0.4.0
func (response DeleteWorkflow204Response) VisitDeleteWorkflowResponse(w http.ResponseWriter) error
type DeleteWorkflowRequestObject ¶ added in v0.4.0
type DeleteWorkflowRequestObject struct {
Workflow WorkflowName `json:"workflow"`
}
type DeleteWorkflowResponseObject ¶ added in v0.4.0
type DeleteWorkflowResponseObject interface {
VisitDeleteWorkflowResponse(w http.ResponseWriter) error
}
type DeleteWorkflowdefaultJSONResponse ¶ added in v0.4.0
func (DeleteWorkflowdefaultJSONResponse) VisitDeleteWorkflowResponse ¶ added in v0.4.0
func (response DeleteWorkflowdefaultJSONResponse) VisitDeleteWorkflowResponse(w http.ResponseWriter) error
type Delivery ¶
type Delivery struct {
// Body The body exactly as sent; the signature covers these bytes.
Body string `json:"body"`
// Headers Every header Workly sets, including the task's own.
Headers map[string]string `json:"headers"`
Method HTTPMethod `json:"method"`
Url string `json:"url"`
}
Delivery defines model for Delivery.
type EnqueueRequest ¶
type EnqueueRequest struct {
// Body A raw text body. Use this or `payload`.
Body *string `json:"body,omitempty"`
// ContentType Content type of `body`. Defaults to `text/plain; charset=utf-8`.
ContentType *string `json:"content_type,omitempty"`
// DelaySeconds Deliver after this delay. Use this or `run_at`.
DelaySeconds *float64 `json:"delay_seconds,omitempty"`
// GroupId Adds the task to this group, which must be open (`group_closed`
// otherwise). A task enqueued again with the same
// `idempotency_key` isn't added twice.
GroupId *string `json:"group_id,omitempty"`
// Headers Headers sent with every delivery. `Workly-*` headers are reserved.
Headers *map[string]string `json:"headers,omitempty"`
// IdempotencyKey Deduplicates enqueues within the queue.
IdempotencyKey *string `json:"idempotency_key,omitempty"`
// MaxAttempts Overrides the queue's `max_attempts`.
MaxAttempts *int `json:"max_attempts,omitempty"`
Method *HTTPMethod `json:"method,omitempty"`
// OnComplete A task Workly enqueues when something completes: a `POST` to `url`
// whose JSON body says what completed (`TaskSummary` for a task,
// `RunSummary` for a schedule's run, `GroupSummary` for a group).
// Callbacks go to `_callbacks`, a queue Workly creates for them,
// and are delivered like any task in it, with its retries; its
// settings can be changed like any queue's.
//
// A task's or a schedule's callback is called each time the task or
// a run succeeds, fails or is cancelled, and again if it is retried
// by hand and finishes again; skipped runs don't call it. A group's
// is called once, when the group completes.
OnComplete *Callback `json:"on_complete,omitempty"`
// Payload A JSON body, sent with `Content-Type: application/json`. Use this or `body`.
Payload *json.RawMessage `json:"payload,omitempty"`
// RunAt Deliver at this time. Use this or `delay_seconds`.
RunAt *time.Time `json:"run_at,omitempty"`
// TimeoutSeconds Overrides the queue's `timeout_seconds`.
TimeoutSeconds *float64 `json:"timeout_seconds,omitempty"`
// Url The http(s) URL to deliver the task to.
//
// Example: https://api.example.com/send-email
Url string `json:"url"`
}
EnqueueRequest defines model for EnqueueRequest.
type ErrorBody ¶
type ErrorBody struct {
// Code Stable, machine-readable error code.
//
// Example: queue_not_found
Code string `json:"code"`
// Message Human-readable description.
Message string `json:"message"`
}
ErrorBody defines model for ErrorBody.
type ErrorJSONResponse ¶
type ErrorJSONResponse Error
type FailureGroup ¶
type FailureGroup struct {
Count int `json:"count"`
// Error The tasks' `last_error`. Pass it as `last_error` to list or retry them.
Error string `json:"error"`
LastFailedAt time.Time `json:"last_failed_at"`
// LatestTaskId The most recently failed task in the group.
LatestTaskId string `json:"latest_task_id"`
// Outcome How a delivery attempt ended. `lost` means the result is unknown: the
// dispatcher crashed or shut down mid-delivery, and the endpoint may
// have processed the request.
Outcome *Outcome `json:"outcome,omitempty"`
// ResponseBody The start (500 bytes) of the latest task's last response body, if it had one.
ResponseBody *string `json:"response_body,omitempty"`
// StatusCode Absent if there was no response.
StatusCode *int `json:"status_code,omitempty"`
}
FailureGroup Failed tasks whose latest attempt ended the same way.
type GetActivity200JSONResponse ¶
type GetActivity200JSONResponse Activity
func (GetActivity200JSONResponse) VisitGetActivityResponse ¶
func (response GetActivity200JSONResponse) VisitGetActivityResponse(w http.ResponseWriter) error
type GetActivityParams ¶
type GetActivityParams struct {
Range *GetActivityParamsRange `form:"range,omitempty" json:"range,omitempty"`
}
GetActivityParams defines parameters for GetActivity.
type GetActivityParamsRange ¶
type GetActivityParamsRange string
GetActivityParamsRange defines parameters for GetActivity.
const ( GetActivityParamsRangeN1h GetActivityParamsRange = "1h" GetActivityParamsRangeN24h GetActivityParamsRange = "24h" GetActivityParamsRangeN7d GetActivityParamsRange = "7d" )
Defines values for GetActivityParamsRange.
func (GetActivityParamsRange) Valid ¶
func (e GetActivityParamsRange) Valid() bool
Valid indicates whether the value is a known member of the GetActivityParamsRange enum.
type GetActivityRequestObject ¶
type GetActivityRequestObject struct {
Params GetActivityParams
}
type GetActivityResponseObject ¶
type GetActivityResponseObject interface {
VisitGetActivityResponse(w http.ResponseWriter) error
}
type GetActivitydefaultJSONResponse ¶
func (GetActivitydefaultJSONResponse) VisitGetActivityResponse ¶
func (response GetActivitydefaultJSONResponse) VisitGetActivityResponse(w http.ResponseWriter) error
type GetGroup200JSONResponse ¶ added in v0.2.0
type GetGroup200JSONResponse Group
func (GetGroup200JSONResponse) VisitGetGroupResponse ¶ added in v0.2.0
func (response GetGroup200JSONResponse) VisitGetGroupResponse(w http.ResponseWriter) error
type GetGroupRequestObject ¶ added in v0.2.0
type GetGroupRequestObject struct {
Id GroupID `json:"id"`
}
type GetGroupResponseObject ¶ added in v0.2.0
type GetGroupResponseObject interface {
VisitGetGroupResponse(w http.ResponseWriter) error
}
type GetGroupdefaultJSONResponse ¶ added in v0.2.0
func (GetGroupdefaultJSONResponse) VisitGetGroupResponse ¶ added in v0.2.0
func (response GetGroupdefaultJSONResponse) VisitGetGroupResponse(w http.ResponseWriter) error
type GetHealthz200JSONResponse ¶
type GetHealthz200JSONResponse Health
func (GetHealthz200JSONResponse) VisitGetHealthzResponse ¶
func (response GetHealthz200JSONResponse) VisitGetHealthzResponse(w http.ResponseWriter) error
type GetHealthzRequestObject ¶
type GetHealthzRequestObject struct {
}
type GetHealthzResponseObject ¶
type GetHealthzResponseObject interface {
VisitGetHealthzResponse(w http.ResponseWriter) error
}
type GetQueue200JSONResponse ¶
type GetQueue200JSONResponse Queue
func (GetQueue200JSONResponse) VisitGetQueueResponse ¶
func (response GetQueue200JSONResponse) VisitGetQueueResponse(w http.ResponseWriter) error
type GetQueueActivity200JSONResponse ¶
type GetQueueActivity200JSONResponse QueueActivity
func (GetQueueActivity200JSONResponse) VisitGetQueueActivityResponse ¶
func (response GetQueueActivity200JSONResponse) VisitGetQueueActivityResponse(w http.ResponseWriter) error
type GetQueueActivityParams ¶
type GetQueueActivityParams struct {
// Since Defaults to 7 days ago.
Since *time.Time `form:"since,omitempty" json:"since,omitempty"`
}
GetQueueActivityParams defines parameters for GetQueueActivity.
type GetQueueActivityRequestObject ¶
type GetQueueActivityRequestObject struct {
Queue QueueName `json:"queue"`
Params GetQueueActivityParams
}
type GetQueueActivityResponseObject ¶
type GetQueueActivityResponseObject interface {
VisitGetQueueActivityResponse(w http.ResponseWriter) error
}
type GetQueueActivitydefaultJSONResponse ¶
func (GetQueueActivitydefaultJSONResponse) VisitGetQueueActivityResponse ¶
func (response GetQueueActivitydefaultJSONResponse) VisitGetQueueActivityResponse(w http.ResponseWriter) error
type GetQueueFailures200JSONResponse ¶
type GetQueueFailures200JSONResponse QueueFailures
func (GetQueueFailures200JSONResponse) VisitGetQueueFailuresResponse ¶
func (response GetQueueFailures200JSONResponse) VisitGetQueueFailuresResponse(w http.ResponseWriter) error
type GetQueueFailuresParams ¶
type GetQueueFailuresParams struct {
// Limit How many groups to return.
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}
GetQueueFailuresParams defines parameters for GetQueueFailures.
type GetQueueFailuresRequestObject ¶
type GetQueueFailuresRequestObject struct {
Queue QueueName `json:"queue"`
Params GetQueueFailuresParams
}
type GetQueueFailuresResponseObject ¶
type GetQueueFailuresResponseObject interface {
VisitGetQueueFailuresResponse(w http.ResponseWriter) error
}
type GetQueueFailuresdefaultJSONResponse ¶
func (GetQueueFailuresdefaultJSONResponse) VisitGetQueueFailuresResponse ¶
func (response GetQueueFailuresdefaultJSONResponse) VisitGetQueueFailuresResponse(w http.ResponseWriter) error
type GetQueueRequestObject ¶
type GetQueueRequestObject struct {
Queue QueueName `json:"queue"`
}
type GetQueueResponseObject ¶
type GetQueueResponseObject interface {
VisitGetQueueResponse(w http.ResponseWriter) error
}
type GetQueuedefaultJSONResponse ¶
func (GetQueuedefaultJSONResponse) VisitGetQueueResponse ¶
func (response GetQueuedefaultJSONResponse) VisitGetQueueResponse(w http.ResponseWriter) error
type GetReadyz200JSONResponse ¶
type GetReadyz200JSONResponse Health
func (GetReadyz200JSONResponse) VisitGetReadyzResponse ¶
func (response GetReadyz200JSONResponse) VisitGetReadyzResponse(w http.ResponseWriter) error
type GetReadyz503JSONResponse ¶
type GetReadyz503JSONResponse Error
func (GetReadyz503JSONResponse) VisitGetReadyzResponse ¶
func (response GetReadyz503JSONResponse) VisitGetReadyzResponse(w http.ResponseWriter) error
type GetReadyzRequestObject ¶
type GetReadyzRequestObject struct {
}
type GetReadyzResponseObject ¶
type GetReadyzResponseObject interface {
VisitGetReadyzResponse(w http.ResponseWriter) error
}
type GetRun200JSONResponse ¶
type GetRun200JSONResponse Run
func (GetRun200JSONResponse) VisitGetRunResponse ¶
func (response GetRun200JSONResponse) VisitGetRunResponse(w http.ResponseWriter) error
type GetRunDelivery200JSONResponse ¶
type GetRunDelivery200JSONResponse Delivery
func (GetRunDelivery200JSONResponse) VisitGetRunDeliveryResponse ¶
func (response GetRunDelivery200JSONResponse) VisitGetRunDeliveryResponse(w http.ResponseWriter) error
type GetRunDeliveryRequestObject ¶
type GetRunDeliveryRequestObject struct {
Id RunID `json:"id"`
}
type GetRunDeliveryResponseObject ¶
type GetRunDeliveryResponseObject interface {
VisitGetRunDeliveryResponse(w http.ResponseWriter) error
}
type GetRunDeliverydefaultJSONResponse ¶
func (GetRunDeliverydefaultJSONResponse) VisitGetRunDeliveryResponse ¶
func (response GetRunDeliverydefaultJSONResponse) VisitGetRunDeliveryResponse(w http.ResponseWriter) error
type GetRunRequestObject ¶
type GetRunRequestObject struct {
Id RunID `json:"id"`
}
type GetRunResponseObject ¶
type GetRunResponseObject interface {
VisitGetRunResponse(w http.ResponseWriter) error
}
type GetRundefaultJSONResponse ¶
func (GetRundefaultJSONResponse) VisitGetRunResponse ¶
func (response GetRundefaultJSONResponse) VisitGetRunResponse(w http.ResponseWriter) error
type GetSchedule200JSONResponse ¶
type GetSchedule200JSONResponse Schedule
func (GetSchedule200JSONResponse) VisitGetScheduleResponse ¶
func (response GetSchedule200JSONResponse) VisitGetScheduleResponse(w http.ResponseWriter) error
type GetScheduleRequestObject ¶
type GetScheduleRequestObject struct {
Schedule ScheduleName `json:"schedule"`
}
type GetScheduleResponseObject ¶
type GetScheduleResponseObject interface {
VisitGetScheduleResponse(w http.ResponseWriter) error
}
type GetScheduledefaultJSONResponse ¶
func (GetScheduledefaultJSONResponse) VisitGetScheduleResponse ¶
func (response GetScheduledefaultJSONResponse) VisitGetScheduleResponse(w http.ResponseWriter) error
type GetTask200JSONResponse ¶
type GetTask200JSONResponse Task
func (GetTask200JSONResponse) VisitGetTaskResponse ¶
func (response GetTask200JSONResponse) VisitGetTaskResponse(w http.ResponseWriter) error
type GetTaskDelivery200JSONResponse ¶
type GetTaskDelivery200JSONResponse Delivery
func (GetTaskDelivery200JSONResponse) VisitGetTaskDeliveryResponse ¶
func (response GetTaskDelivery200JSONResponse) VisitGetTaskDeliveryResponse(w http.ResponseWriter) error
type GetTaskDeliveryRequestObject ¶
type GetTaskDeliveryRequestObject struct {
Id TaskID `json:"id"`
}
type GetTaskDeliveryResponseObject ¶
type GetTaskDeliveryResponseObject interface {
VisitGetTaskDeliveryResponse(w http.ResponseWriter) error
}
type GetTaskDeliverydefaultJSONResponse ¶
func (GetTaskDeliverydefaultJSONResponse) VisitGetTaskDeliveryResponse ¶
func (response GetTaskDeliverydefaultJSONResponse) VisitGetTaskDeliveryResponse(w http.ResponseWriter) error
type GetTaskRequestObject ¶
type GetTaskRequestObject struct {
Id TaskID `json:"id"`
}
type GetTaskResponseObject ¶
type GetTaskResponseObject interface {
VisitGetTaskResponse(w http.ResponseWriter) error
}
type GetTaskdefaultJSONResponse ¶
func (GetTaskdefaultJSONResponse) VisitGetTaskResponse ¶
func (response GetTaskdefaultJSONResponse) VisitGetTaskResponse(w http.ResponseWriter) error
type GetWorkflow200JSONResponse ¶ added in v0.4.0
type GetWorkflow200JSONResponse Workflow
func (GetWorkflow200JSONResponse) VisitGetWorkflowResponse ¶ added in v0.4.0
func (response GetWorkflow200JSONResponse) VisitGetWorkflowResponse(w http.ResponseWriter) error
type GetWorkflowRequestObject ¶ added in v0.4.0
type GetWorkflowRequestObject struct {
Workflow WorkflowName `json:"workflow"`
}
type GetWorkflowResponseObject ¶ added in v0.4.0
type GetWorkflowResponseObject interface {
VisitGetWorkflowResponse(w http.ResponseWriter) error
}
type GetWorkflowRun200JSONResponse ¶ added in v0.4.0
type GetWorkflowRun200JSONResponse WorkflowRun
func (GetWorkflowRun200JSONResponse) VisitGetWorkflowRunResponse ¶ added in v0.4.0
func (response GetWorkflowRun200JSONResponse) VisitGetWorkflowRunResponse(w http.ResponseWriter) error
type GetWorkflowRunRequestObject ¶ added in v0.4.0
type GetWorkflowRunRequestObject struct {
Id WorkflowRunID `json:"id"`
}
type GetWorkflowRunResponseObject ¶ added in v0.4.0
type GetWorkflowRunResponseObject interface {
VisitGetWorkflowRunResponse(w http.ResponseWriter) error
}
type GetWorkflowRundefaultJSONResponse ¶ added in v0.4.0
func (GetWorkflowRundefaultJSONResponse) VisitGetWorkflowRunResponse ¶ added in v0.4.0
func (response GetWorkflowRundefaultJSONResponse) VisitGetWorkflowRunResponse(w http.ResponseWriter) error
type GetWorkflowdefaultJSONResponse ¶ added in v0.4.0
func (GetWorkflowdefaultJSONResponse) VisitGetWorkflowResponse ¶ added in v0.4.0
func (response GetWorkflowdefaultJSONResponse) VisitGetWorkflowResponse(w http.ResponseWriter) error
type Group ¶ added in v0.2.0
type Group struct {
// CallbackTaskId The callback task, once the group has completed.
CallbackTaskId *string `json:"callback_task_id,omitempty"`
Cancelled int `json:"cancelled"`
ClosedAt *time.Time `json:"closed_at,omitempty"`
CreatedAt time.Time `json:"created_at"`
Failed int `json:"failed"`
// FinishedAt When the group completed.
FinishedAt *time.Time `json:"finished_at,omitempty"`
// Id Example: grp_01J9ZK3M5Q8R2T4V6W8X0Y2Z4A
Id string `json:"id"`
IdempotencyKey *string `json:"idempotency_key,omitempty"`
Name *string `json:"name,omitempty"`
// OnComplete A task Workly enqueues when something completes: a `POST` to `url`
// whose JSON body says what completed (`TaskSummary` for a task,
// `RunSummary` for a schedule's run, `GroupSummary` for a group).
// Callbacks go to `_callbacks`, a queue Workly creates for them,
// and are delivered like any task in it, with its retries; its
// settings can be changed like any queue's.
//
// A task's or a schedule's callback is called each time the task or
// a run succeeds, fails or is cancelled, and again if it is retried
// by hand and finishes again; skipped runs don't call it. A group's
// is called once, when the group completes.
OnComplete *Callback `json:"on_complete,omitempty"`
// Remaining Tasks still pending or running.
Remaining int `json:"remaining"`
// Status `open`: accepting tasks. `running`: closed, with tasks still to
// finish. `succeeded`: every task succeeded. `failed`: every task
// finished and at least one failed or was cancelled. Completed groups
// (`succeeded` and `failed`) don't change again, even if a task in
// them is retried.
Status GroupStatus `json:"status"`
Succeeded int `json:"succeeded"`
// Total Tasks enqueued into the group (less those whose queue was deleted).
Total int `json:"total"`
}
Group defines model for Group.
type GroupList ¶ added in v0.2.0
type GroupList struct {
Groups []Group `json:"groups"`
// NextCursor Pass as `cursor` to get the next page. Absent on the last page.
NextCursor *string `json:"next_cursor,omitempty"`
}
GroupList defines model for GroupList.
type GroupStatus ¶ added in v0.2.0
type GroupStatus string
GroupStatus `open`: accepting tasks. `running`: closed, with tasks still to finish. `succeeded`: every task succeeded. `failed`: every task finished and at least one failed or was cancelled. Completed groups (`succeeded` and `failed`) don't change again, even if a task in them is retried.
const ( GroupStatusFailed GroupStatus = "failed" GroupStatusOpen GroupStatus = "open" GroupStatusRunning GroupStatus = "running" GroupStatusSucceeded GroupStatus = "succeeded" )
Defines values for GroupStatus.
func (GroupStatus) Valid ¶ added in v0.2.0
func (e GroupStatus) Valid() bool
Valid indicates whether the value is a known member of the GroupStatus enum.
type HTTPMethod ¶
type HTTPMethod string
HTTPMethod defines model for HTTPMethod.
const ( DELETE HTTPMethod = "DELETE" GET HTTPMethod = "GET" PATCH HTTPMethod = "PATCH" POST HTTPMethod = "POST" PUT HTTPMethod = "PUT" )
Defines values for HTTPMethod.
func (HTTPMethod) Valid ¶
func (e HTTPMethod) Valid() bool
Valid indicates whether the value is a known member of the HTTPMethod enum.
type Handlers ¶
type Handlers struct {
Store store.Store
AutoCreateQueues bool
MaxPayloadBytes int64
Metrics *metrics.Workly
Signer dispatch.Signer
Retention time.Duration
// WorkspaceRetention, if set, gives some workspaces their own retention.
WorkspaceRetention func(ctx context.Context) (map[workspace.ID]time.Duration, error)
// Admission, if set, may refuse new tasks and schedules.
Admission Admission
// Alerts sends test alerts and says whether email can be sent.
Alerts *alert.Sender
}
Handlers implements StrictServerInterface, generated from api/openapi.yaml.
func (Handlers) CancelPendingTasks ¶
func (h Handlers) CancelPendingTasks(ctx context.Context, req CancelPendingTasksRequestObject) (CancelPendingTasksResponseObject, error)
func (Handlers) CancelRun ¶
func (h Handlers) CancelRun(ctx context.Context, req CancelRunRequestObject) (CancelRunResponseObject, error)
func (Handlers) CancelTask ¶
func (h Handlers) CancelTask(ctx context.Context, req CancelTaskRequestObject) (CancelTaskResponseObject, error)
func (Handlers) CancelWorkflowRun ¶ added in v0.4.0
func (h Handlers) CancelWorkflowRun(ctx context.Context, req CancelWorkflowRunRequestObject) (CancelWorkflowRunResponseObject, error)
func (Handlers) CloseGroup ¶ added in v0.2.0
func (h Handlers) CloseGroup(ctx context.Context, req CloseGroupRequestObject) (CloseGroupResponseObject, error)
func (Handlers) CreateAlertChannel ¶
func (h Handlers) CreateAlertChannel(ctx context.Context, req CreateAlertChannelRequestObject) (CreateAlertChannelResponseObject, error)
func (Handlers) CreateGroup ¶ added in v0.2.0
func (h Handlers) CreateGroup(ctx context.Context, req CreateGroupRequestObject) (CreateGroupResponseObject, error)
func (Handlers) CreateTask ¶
func (h Handlers) CreateTask(ctx context.Context, req CreateTaskRequestObject) (CreateTaskResponseObject, error)
func (Handlers) CreateTasks ¶
func (h Handlers) CreateTasks(ctx context.Context, req CreateTasksRequestObject) (CreateTasksResponseObject, error)
func (Handlers) DeleteAlertChannel ¶
func (h Handlers) DeleteAlertChannel(ctx context.Context, req DeleteAlertChannelRequestObject) (DeleteAlertChannelResponseObject, error)
func (Handlers) DeleteQueue ¶
func (h Handlers) DeleteQueue(ctx context.Context, req DeleteQueueRequestObject) (DeleteQueueResponseObject, error)
func (Handlers) DeleteSchedule ¶
func (h Handlers) DeleteSchedule(ctx context.Context, req DeleteScheduleRequestObject) (DeleteScheduleResponseObject, error)
func (Handlers) DeleteWorkflow ¶ added in v0.4.0
func (h Handlers) DeleteWorkflow(ctx context.Context, req DeleteWorkflowRequestObject) (DeleteWorkflowResponseObject, error)
func (Handlers) GetActivity ¶
func (h Handlers) GetActivity(ctx context.Context, req GetActivityRequestObject) (GetActivityResponseObject, error)
func (Handlers) GetGroup ¶ added in v0.2.0
func (h Handlers) GetGroup(ctx context.Context, req GetGroupRequestObject) (GetGroupResponseObject, error)
func (Handlers) GetHealthz ¶
func (h Handlers) GetHealthz(ctx context.Context, _ GetHealthzRequestObject) (GetHealthzResponseObject, error)
func (Handlers) GetQueue ¶
func (h Handlers) GetQueue(ctx context.Context, req GetQueueRequestObject) (GetQueueResponseObject, error)
func (Handlers) GetQueueActivity ¶
func (h Handlers) GetQueueActivity(ctx context.Context, req GetQueueActivityRequestObject) (GetQueueActivityResponseObject, error)
func (Handlers) GetQueueFailures ¶
func (h Handlers) GetQueueFailures(ctx context.Context, req GetQueueFailuresRequestObject) (GetQueueFailuresResponseObject, error)
func (Handlers) GetReadyz ¶
func (h Handlers) GetReadyz(ctx context.Context, _ GetReadyzRequestObject) (GetReadyzResponseObject, error)
func (Handlers) GetRun ¶
func (h Handlers) GetRun(ctx context.Context, req GetRunRequestObject) (GetRunResponseObject, error)
func (Handlers) GetRunDelivery ¶
func (h Handlers) GetRunDelivery(ctx context.Context, req GetRunDeliveryRequestObject) (GetRunDeliveryResponseObject, error)
func (Handlers) GetSchedule ¶
func (h Handlers) GetSchedule(ctx context.Context, req GetScheduleRequestObject) (GetScheduleResponseObject, error)
func (Handlers) GetTask ¶
func (h Handlers) GetTask(ctx context.Context, req GetTaskRequestObject) (GetTaskResponseObject, error)
func (Handlers) GetTaskDelivery ¶
func (h Handlers) GetTaskDelivery(ctx context.Context, req GetTaskDeliveryRequestObject) (GetTaskDeliveryResponseObject, error)
func (Handlers) GetWorkflow ¶ added in v0.4.0
func (h Handlers) GetWorkflow(ctx context.Context, req GetWorkflowRequestObject) (GetWorkflowResponseObject, error)
func (Handlers) GetWorkflowRun ¶ added in v0.4.0
func (h Handlers) GetWorkflowRun(ctx context.Context, req GetWorkflowRunRequestObject) (GetWorkflowRunResponseObject, error)
func (Handlers) ListAlertChannels ¶
func (h Handlers) ListAlertChannels(ctx context.Context, _ ListAlertChannelsRequestObject) (ListAlertChannelsResponseObject, error)
func (Handlers) ListAttempts ¶
func (h Handlers) ListAttempts(ctx context.Context, req ListAttemptsRequestObject) (ListAttemptsResponseObject, error)
func (Handlers) ListGroups ¶ added in v0.2.0
func (h Handlers) ListGroups(ctx context.Context, req ListGroupsRequestObject) (ListGroupsResponseObject, error)
func (Handlers) ListQueues ¶
func (h Handlers) ListQueues(ctx context.Context, _ ListQueuesRequestObject) (ListQueuesResponseObject, error)
func (Handlers) ListRunAttempts ¶
func (h Handlers) ListRunAttempts(ctx context.Context, req ListRunAttemptsRequestObject) (ListRunAttemptsResponseObject, error)
func (Handlers) ListRuns ¶
func (h Handlers) ListRuns(ctx context.Context, req ListRunsRequestObject) (ListRunsResponseObject, error)
func (Handlers) ListSchedules ¶
func (h Handlers) ListSchedules(ctx context.Context, _ ListSchedulesRequestObject) (ListSchedulesResponseObject, error)
func (Handlers) ListTasks ¶
func (h Handlers) ListTasks(ctx context.Context, req ListTasksRequestObject) (ListTasksResponseObject, error)
func (Handlers) ListWorkflowRuns ¶ added in v0.4.0
func (h Handlers) ListWorkflowRuns(ctx context.Context, req ListWorkflowRunsRequestObject) (ListWorkflowRunsResponseObject, error)
func (Handlers) ListWorkflows ¶ added in v0.4.0
func (h Handlers) ListWorkflows(ctx context.Context, _ ListWorkflowsRequestObject) (ListWorkflowsResponseObject, error)
func (Handlers) PauseQueue ¶
func (h Handlers) PauseQueue(ctx context.Context, req PauseQueueRequestObject) (PauseQueueResponseObject, error)
func (Handlers) PauseSchedule ¶
func (h Handlers) PauseSchedule(ctx context.Context, req PauseScheduleRequestObject) (PauseScheduleResponseObject, error)
func (Handlers) PreviewCron ¶
func (h Handlers) PreviewCron(ctx context.Context, req PreviewCronRequestObject) (PreviewCronResponseObject, error)
func (Handlers) PutQueue ¶
func (h Handlers) PutQueue(ctx context.Context, req PutQueueRequestObject) (PutQueueResponseObject, error)
func (Handlers) PutSchedule ¶
func (h Handlers) PutSchedule(ctx context.Context, req PutScheduleRequestObject) (PutScheduleResponseObject, error)
func (Handlers) PutWorkflow ¶ added in v0.4.0
func (h Handlers) PutWorkflow(ctx context.Context, req PutWorkflowRequestObject) (PutWorkflowResponseObject, error)
func (Handlers) ResumeQueue ¶
func (h Handlers) ResumeQueue(ctx context.Context, req ResumeQueueRequestObject) (ResumeQueueResponseObject, error)
func (Handlers) ResumeSchedule ¶
func (h Handlers) ResumeSchedule(ctx context.Context, req ResumeScheduleRequestObject) (ResumeScheduleResponseObject, error)
func (Handlers) RetryFailedTasks ¶
func (h Handlers) RetryFailedTasks(ctx context.Context, req RetryFailedTasksRequestObject) (RetryFailedTasksResponseObject, error)
func (Handlers) RetryRun ¶
func (h Handlers) RetryRun(ctx context.Context, req RetryRunRequestObject) (RetryRunResponseObject, error)
func (Handlers) RetryTask ¶
func (h Handlers) RetryTask(ctx context.Context, req RetryTaskRequestObject) (RetryTaskResponseObject, error)
func (Handlers) RetryWorkflowRun ¶ added in v0.4.0
func (h Handlers) RetryWorkflowRun(ctx context.Context, req RetryWorkflowRunRequestObject) (RetryWorkflowRunResponseObject, error)
RetryWorkflowRun reopens a stopped run. It reuses the steps' tasks, as retrying a task does, so like that it isn't subject to admission.
func (Handlers) SearchTasks ¶
func (h Handlers) SearchTasks(ctx context.Context, req SearchTasksRequestObject) (SearchTasksResponseObject, error)
func (Handlers) StartWorkflowRun ¶ added in v0.4.0
func (h Handlers) StartWorkflowRun(ctx context.Context, req StartWorkflowRunRequestObject) (StartWorkflowRunResponseObject, error)
func (Handlers) TestAlertChannel ¶
func (h Handlers) TestAlertChannel(ctx context.Context, req TestAlertChannelRequestObject) (TestAlertChannelResponseObject, error)
func (Handlers) TriggerSchedule ¶
func (h Handlers) TriggerSchedule(ctx context.Context, req TriggerScheduleRequestObject) (TriggerScheduleResponseObject, error)
type Health ¶
type Health struct {
// Status Example: ok
Status string `json:"status"`
}
Health defines model for Health.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type LastRun ¶
type LastRun struct {
FinishedAt *time.Time `json:"finished_at,omitempty"`
Id string `json:"id"`
LastError *string `json:"last_error,omitempty"`
LastStatus *int `json:"last_status,omitempty"`
ScheduledFor time.Time `json:"scheduled_for"`
// State A `skipped` run was never delivered: see `skip_reason`. It can be
// retried to deliver it now.
State RunState `json:"state"`
// Trigger `schedule` for a cron slot, `manual` for "run now".
Trigger RunTrigger `json:"trigger"`
// WorkflowRunId The workflow run it started, for a schedule that starts a workflow.
WorkflowRunId *string `json:"workflow_run_id,omitempty"`
WorkflowRunStatus *WorkflowRunStatus `json:"workflow_run_status,omitempty"`
}
LastRun The schedule's most recent run. Absent before the first.
type ListAlertChannels200JSONResponse ¶
type ListAlertChannels200JSONResponse AlertChannelList
func (ListAlertChannels200JSONResponse) VisitListAlertChannelsResponse ¶
func (response ListAlertChannels200JSONResponse) VisitListAlertChannelsResponse(w http.ResponseWriter) error
type ListAlertChannelsRequestObject ¶
type ListAlertChannelsRequestObject struct {
}
type ListAlertChannelsResponseObject ¶
type ListAlertChannelsResponseObject interface {
VisitListAlertChannelsResponse(w http.ResponseWriter) error
}
type ListAlertChannelsdefaultJSONResponse ¶
func (ListAlertChannelsdefaultJSONResponse) VisitListAlertChannelsResponse ¶
func (response ListAlertChannelsdefaultJSONResponse) VisitListAlertChannelsResponse(w http.ResponseWriter) error
type ListAttempts200JSONResponse ¶
type ListAttempts200JSONResponse AttemptList
func (ListAttempts200JSONResponse) VisitListAttemptsResponse ¶
func (response ListAttempts200JSONResponse) VisitListAttemptsResponse(w http.ResponseWriter) error
type ListAttemptsRequestObject ¶
type ListAttemptsRequestObject struct {
Id TaskID `json:"id"`
}
type ListAttemptsResponseObject ¶
type ListAttemptsResponseObject interface {
VisitListAttemptsResponse(w http.ResponseWriter) error
}
type ListAttemptsdefaultJSONResponse ¶
func (ListAttemptsdefaultJSONResponse) VisitListAttemptsResponse ¶
func (response ListAttemptsdefaultJSONResponse) VisitListAttemptsResponse(w http.ResponseWriter) error
type ListGroups200JSONResponse ¶ added in v0.2.0
type ListGroups200JSONResponse GroupList
func (ListGroups200JSONResponse) VisitListGroupsResponse ¶ added in v0.2.0
func (response ListGroups200JSONResponse) VisitListGroupsResponse(w http.ResponseWriter) error
type ListGroupsParams ¶ added in v0.2.0
type ListGroupsParams struct {
Status *GroupStatus `form:"status,omitempty" json:"status,omitempty"`
Name *string `form:"name,omitempty" json:"name,omitempty"`
// Cursor The `next_cursor` of the previous page, requested with the same
// filters and order.
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
}
ListGroupsParams defines parameters for ListGroups.
type ListGroupsRequestObject ¶ added in v0.2.0
type ListGroupsRequestObject struct {
Params ListGroupsParams
}
type ListGroupsResponseObject ¶ added in v0.2.0
type ListGroupsResponseObject interface {
VisitListGroupsResponse(w http.ResponseWriter) error
}
type ListGroupsdefaultJSONResponse ¶ added in v0.2.0
func (ListGroupsdefaultJSONResponse) VisitListGroupsResponse ¶ added in v0.2.0
func (response ListGroupsdefaultJSONResponse) VisitListGroupsResponse(w http.ResponseWriter) error
type ListQueues200JSONResponse ¶
type ListQueues200JSONResponse QueueList
func (ListQueues200JSONResponse) VisitListQueuesResponse ¶
func (response ListQueues200JSONResponse) VisitListQueuesResponse(w http.ResponseWriter) error
type ListQueuesRequestObject ¶
type ListQueuesRequestObject struct {
}
type ListQueuesResponseObject ¶
type ListQueuesResponseObject interface {
VisitListQueuesResponse(w http.ResponseWriter) error
}
type ListQueuesdefaultJSONResponse ¶
func (ListQueuesdefaultJSONResponse) VisitListQueuesResponse ¶
func (response ListQueuesdefaultJSONResponse) VisitListQueuesResponse(w http.ResponseWriter) error
type ListRunAttempts200JSONResponse ¶
type ListRunAttempts200JSONResponse AttemptList
func (ListRunAttempts200JSONResponse) VisitListRunAttemptsResponse ¶
func (response ListRunAttempts200JSONResponse) VisitListRunAttemptsResponse(w http.ResponseWriter) error
type ListRunAttemptsRequestObject ¶
type ListRunAttemptsRequestObject struct {
Id RunID `json:"id"`
}
type ListRunAttemptsResponseObject ¶
type ListRunAttemptsResponseObject interface {
VisitListRunAttemptsResponse(w http.ResponseWriter) error
}
type ListRunAttemptsdefaultJSONResponse ¶
func (ListRunAttemptsdefaultJSONResponse) VisitListRunAttemptsResponse ¶
func (response ListRunAttemptsdefaultJSONResponse) VisitListRunAttemptsResponse(w http.ResponseWriter) error
type ListRuns200JSONResponse ¶
type ListRuns200JSONResponse RunList
func (ListRuns200JSONResponse) VisitListRunsResponse ¶
func (response ListRuns200JSONResponse) VisitListRunsResponse(w http.ResponseWriter) error
type ListRunsParams ¶
type ListRunsParams struct {
// Schedule Only this schedule's runs.
Schedule *string `form:"schedule,omitempty" json:"schedule,omitempty"`
State *RunState `form:"state,omitempty" json:"state,omitempty"`
// Cursor The `next_cursor` of the previous page, requested with the same
// filters and order.
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
}
ListRunsParams defines parameters for ListRuns.
type ListRunsRequestObject ¶
type ListRunsRequestObject struct {
Params ListRunsParams
}
type ListRunsResponseObject ¶
type ListRunsResponseObject interface {
VisitListRunsResponse(w http.ResponseWriter) error
}
type ListRunsdefaultJSONResponse ¶
func (ListRunsdefaultJSONResponse) VisitListRunsResponse ¶
func (response ListRunsdefaultJSONResponse) VisitListRunsResponse(w http.ResponseWriter) error
type ListSchedules200JSONResponse ¶
type ListSchedules200JSONResponse ScheduleList
func (ListSchedules200JSONResponse) VisitListSchedulesResponse ¶
func (response ListSchedules200JSONResponse) VisitListSchedulesResponse(w http.ResponseWriter) error
type ListSchedulesRequestObject ¶
type ListSchedulesRequestObject struct {
}
type ListSchedulesResponseObject ¶
type ListSchedulesResponseObject interface {
VisitListSchedulesResponse(w http.ResponseWriter) error
}
type ListSchedulesdefaultJSONResponse ¶
func (ListSchedulesdefaultJSONResponse) VisitListSchedulesResponse ¶
func (response ListSchedulesdefaultJSONResponse) VisitListSchedulesResponse(w http.ResponseWriter) error
type ListTasks200JSONResponse ¶
type ListTasks200JSONResponse TaskList
func (ListTasks200JSONResponse) VisitListTasksResponse ¶
func (response ListTasks200JSONResponse) VisitListTasksResponse(w http.ResponseWriter) error
type ListTasksParams ¶
type ListTasksParams struct {
State *TaskState `form:"state,omitempty" json:"state,omitempty"`
// LastError Only tasks whose latest error is exactly this.
LastError *LastError `form:"last_error,omitempty" json:"last_error,omitempty"`
// Sort What to order tasks by:
//
// - `created_at` (the default): when the task was enqueued.
// - `run_at`: when it runs next. Pending tasks are delivered in this
// order, so ascending lists them as they'll run.
// - `last_attempt_at`: when its latest attempt finished. Tasks never
// attempted count as oldest.
// - `attempt_count`: how many attempts it has had.
//
// Ties are broken by task ID.
Sort *ListTasksParamsSort `form:"sort,omitempty" json:"sort,omitempty"`
// Order `asc` or `desc`. Defaults to `asc` (soonest first) for `run_at` and
// to `desc` (newest or most first) for the rest.
Order *ListTasksParamsOrder `form:"order,omitempty" json:"order,omitempty"`
// Cursor The `next_cursor` of the previous page, requested with the same
// filters and order.
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
}
ListTasksParams defines parameters for ListTasks.
type ListTasksParamsOrder ¶ added in v0.2.0
type ListTasksParamsOrder string
ListTasksParamsOrder defines parameters for ListTasks.
const ( ListTasksParamsOrderAsc ListTasksParamsOrder = "asc" ListTasksParamsOrderDesc ListTasksParamsOrder = "desc" )
Defines values for ListTasksParamsOrder.
func (ListTasksParamsOrder) Valid ¶ added in v0.2.0
func (e ListTasksParamsOrder) Valid() bool
Valid indicates whether the value is a known member of the ListTasksParamsOrder enum.
type ListTasksParamsSort ¶ added in v0.2.0
type ListTasksParamsSort string
ListTasksParamsSort defines parameters for ListTasks.
const ( ListTasksParamsSortAttemptCount ListTasksParamsSort = "attempt_count" ListTasksParamsSortCreatedAt ListTasksParamsSort = "created_at" ListTasksParamsSortLastAttemptAt ListTasksParamsSort = "last_attempt_at" ListTasksParamsSortRunAt ListTasksParamsSort = "run_at" )
Defines values for ListTasksParamsSort.
func (ListTasksParamsSort) Valid ¶ added in v0.2.0
func (e ListTasksParamsSort) Valid() bool
Valid indicates whether the value is a known member of the ListTasksParamsSort enum.
type ListTasksRequestObject ¶
type ListTasksRequestObject struct {
Queue QueueName `json:"queue"`
Params ListTasksParams
}
type ListTasksResponseObject ¶
type ListTasksResponseObject interface {
VisitListTasksResponse(w http.ResponseWriter) error
}
type ListTasksdefaultJSONResponse ¶
func (ListTasksdefaultJSONResponse) VisitListTasksResponse ¶
func (response ListTasksdefaultJSONResponse) VisitListTasksResponse(w http.ResponseWriter) error
type ListWorkflowRuns200JSONResponse ¶ added in v0.4.0
type ListWorkflowRuns200JSONResponse WorkflowRunList
func (ListWorkflowRuns200JSONResponse) VisitListWorkflowRunsResponse ¶ added in v0.4.0
func (response ListWorkflowRuns200JSONResponse) VisitListWorkflowRunsResponse(w http.ResponseWriter) error
type ListWorkflowRunsParams ¶ added in v0.4.0
type ListWorkflowRunsParams struct {
// Workflow Only this workflow's runs.
Workflow *string `form:"workflow,omitempty" json:"workflow,omitempty"`
Status *WorkflowRunStatus `form:"status,omitempty" json:"status,omitempty"`
// Cursor The `next_cursor` of the previous page, requested with the same
// filters and order.
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
}
ListWorkflowRunsParams defines parameters for ListWorkflowRuns.
type ListWorkflowRunsRequestObject ¶ added in v0.4.0
type ListWorkflowRunsRequestObject struct {
Params ListWorkflowRunsParams
}
type ListWorkflowRunsResponseObject ¶ added in v0.4.0
type ListWorkflowRunsResponseObject interface {
VisitListWorkflowRunsResponse(w http.ResponseWriter) error
}
type ListWorkflowRunsdefaultJSONResponse ¶ added in v0.4.0
func (ListWorkflowRunsdefaultJSONResponse) VisitListWorkflowRunsResponse ¶ added in v0.4.0
func (response ListWorkflowRunsdefaultJSONResponse) VisitListWorkflowRunsResponse(w http.ResponseWriter) error
type ListWorkflows200JSONResponse ¶ added in v0.4.0
type ListWorkflows200JSONResponse WorkflowList
func (ListWorkflows200JSONResponse) VisitListWorkflowsResponse ¶ added in v0.4.0
func (response ListWorkflows200JSONResponse) VisitListWorkflowsResponse(w http.ResponseWriter) error
type ListWorkflowsRequestObject ¶ added in v0.4.0
type ListWorkflowsRequestObject struct {
}
type ListWorkflowsResponseObject ¶ added in v0.4.0
type ListWorkflowsResponseObject interface {
VisitListWorkflowsResponse(w http.ResponseWriter) error
}
type ListWorkflowsdefaultJSONResponse ¶ added in v0.4.0
func (ListWorkflowsdefaultJSONResponse) VisitListWorkflowsResponse ¶ added in v0.4.0
func (response ListWorkflowsdefaultJSONResponse) VisitListWorkflowsResponse(w http.ResponseWriter) error
type MissedPolicy ¶
type MissedPolicy string
MissedPolicy What happens to slots missed while the server was down (a slot is missed if it can't fire within a minute). `skip` records the most recent missed slot as a `skipped` run; `catch_up` runs it. Either way, at most one run is created for the missed slots.
const ( MissedPolicyCatchUp MissedPolicy = "catch_up" MissedPolicySkip MissedPolicy = "skip" )
Defines values for MissedPolicy.
func (MissedPolicy) Valid ¶
func (e MissedPolicy) Valid() bool
Valid indicates whether the value is a known member of the MissedPolicy enum.
type NewAlertChannel ¶
type NewAlertChannel struct {
// Target An email address, or a Slack incoming webhook URL.
//
// Example: oncall@example.com
Target string `json:"target"`
Type AlertChannelType `json:"type"`
}
NewAlertChannel defines model for NewAlertChannel.
type NewGroup ¶ added in v0.2.0
type NewGroup struct {
// IdempotencyKey Deduplicates group creation within the workspace.
IdempotencyKey *string `json:"idempotency_key,omitempty"`
// Name A label, e.g. the job the group is one run of. Names needn't be unique.
//
// Example: daily-stock-prices
Name *string `json:"name,omitempty"`
// OnComplete A task Workly enqueues when something completes: a `POST` to `url`
// whose JSON body says what completed (`TaskSummary` for a task,
// `RunSummary` for a schedule's run, `GroupSummary` for a group).
// Callbacks go to `_callbacks`, a queue Workly creates for them,
// and are delivered like any task in it, with its retries; its
// settings can be changed like any queue's.
//
// A task's or a schedule's callback is called each time the task or
// a run succeeds, fails or is cancelled, and again if it is retried
// by hand and finishes again; skipped runs don't call it. A group's
// is called once, when the group completes.
OnComplete *Callback `json:"on_complete,omitempty"`
}
NewGroup defines model for NewGroup.
type Options ¶
type Options struct {
Store store.Store
Resolver workspace.Resolver
Logger *slog.Logger
Dashboard http.Handler
AutoCreateQueues bool
// MaxPayloadBytes limits task bodies.
MaxPayloadBytes int64
// DevEcho, if set, is served at /_dev/echo (`workly dev` only).
DevEcho http.Handler
// Metrics counts enqueues; it defaults to a private set.
Metrics *metrics.Workly
// ServeMetrics serves Metrics at /metrics, behind the same credentials
// as /v1.
ServeMetrics bool
// Retention is how long finished tasks are kept; 0 is forever.
Retention time.Duration
// WorkspaceRetention, if set, gives some workspaces their own retention.
WorkspaceRetention func(ctx context.Context) (map[workspace.ID]time.Duration, error)
// Signer builds the requests shown by GET /v1/tasks/{id}/delivery.
Signer dispatch.Signer
// MCP sets which tools /mcp serves; mcp.Off doesn't serve it.
MCP mcp.Mode
// MCPModeFor, if set, can make an /mcp request read-only (see mcp.Options).
MCPModeFor func(*http.Request) mcp.Mode
// MCPResourceMetadata, if set, is the URL of /mcp's OAuth protected
// resource metadata (RFC 9728), named in the WWW-Authenticate header of
// its 401s so MCP clients can find where to get a token.
MCPResourceMetadata string
// Version is reported to MCP clients.
Version string
// Admission, if set, may refuse new tasks and schedules.
Admission Admission
// Alerts sends test alerts; it defaults to one that can't send email.
Alerts *alert.Sender
// Live is told about changes and serves /v1/events; it defaults to a hub
// that only sees this handler's own changes, and only while it runs.
Live *live.Hub
}
type Outcome ¶
type Outcome string
Outcome How a delivery attempt ended. `lost` means the result is unknown: the dispatcher crashed or shut down mid-delivery, and the endpoint may have processed the request.
type OverlapPolicy ¶
type OverlapPolicy string
OverlapPolicy What happens when a slot comes up while the previous run is still pending or running, or, for a schedule with `workflow`, while the workflow run it started is still running. `skip` records the slot as a `skipped` run; `allow` runs it alongside.
const ( OverlapPolicyAllow OverlapPolicy = "allow" OverlapPolicySkip OverlapPolicy = "skip" )
Defines values for OverlapPolicy.
func (OverlapPolicy) Valid ¶
func (e OverlapPolicy) Valid() bool
Valid indicates whether the value is a known member of the OverlapPolicy enum.
type PauseQueue200JSONResponse ¶
type PauseQueue200JSONResponse Queue
func (PauseQueue200JSONResponse) VisitPauseQueueResponse ¶
func (response PauseQueue200JSONResponse) VisitPauseQueueResponse(w http.ResponseWriter) error
type PauseQueueRequestObject ¶
type PauseQueueRequestObject struct {
Queue QueueName `json:"queue"`
}
type PauseQueueResponseObject ¶
type PauseQueueResponseObject interface {
VisitPauseQueueResponse(w http.ResponseWriter) error
}
type PauseQueuedefaultJSONResponse ¶
func (PauseQueuedefaultJSONResponse) VisitPauseQueueResponse ¶
func (response PauseQueuedefaultJSONResponse) VisitPauseQueueResponse(w http.ResponseWriter) error
type PauseSchedule200JSONResponse ¶
type PauseSchedule200JSONResponse Schedule
func (PauseSchedule200JSONResponse) VisitPauseScheduleResponse ¶
func (response PauseSchedule200JSONResponse) VisitPauseScheduleResponse(w http.ResponseWriter) error
type PauseScheduleRequestObject ¶
type PauseScheduleRequestObject struct {
Schedule ScheduleName `json:"schedule"`
}
type PauseScheduleResponseObject ¶
type PauseScheduleResponseObject interface {
VisitPauseScheduleResponse(w http.ResponseWriter) error
}
type PauseScheduledefaultJSONResponse ¶
func (PauseScheduledefaultJSONResponse) VisitPauseScheduleResponse ¶
func (response PauseScheduledefaultJSONResponse) VisitPauseScheduleResponse(w http.ResponseWriter) error
type PreviewCron200JSONResponse ¶
type PreviewCron200JSONResponse CronPreview
func (PreviewCron200JSONResponse) VisitPreviewCronResponse ¶
func (response PreviewCron200JSONResponse) VisitPreviewCronResponse(w http.ResponseWriter) error
type PreviewCronParams ¶
type PreviewCronParams struct {
Cron string `form:"cron" json:"cron"`
// Timezone IANA name. Defaults to UTC.
Timezone *string `form:"timezone,omitempty" json:"timezone,omitempty"`
// From The start of the window to list runs in. Requires `until`.
From *time.Time `form:"from,omitempty" json:"from,omitempty"`
// Until The end of the window, exclusive. Requires `from`.
Until *time.Time `form:"until,omitempty" json:"until,omitempty"`
}
PreviewCronParams defines parameters for PreviewCron.
type PreviewCronRequestObject ¶
type PreviewCronRequestObject struct {
Params PreviewCronParams
}
type PreviewCronResponseObject ¶
type PreviewCronResponseObject interface {
VisitPreviewCronResponse(w http.ResponseWriter) error
}
type PreviewCrondefaultJSONResponse ¶
func (PreviewCrondefaultJSONResponse) VisitPreviewCronResponse ¶
func (response PreviewCrondefaultJSONResponse) VisitPreviewCronResponse(w http.ResponseWriter) error
type PutQueue200JSONResponse ¶
type PutQueue200JSONResponse Queue
func (PutQueue200JSONResponse) VisitPutQueueResponse ¶
func (response PutQueue200JSONResponse) VisitPutQueueResponse(w http.ResponseWriter) error
type PutQueue201JSONResponse ¶
type PutQueue201JSONResponse Queue
func (PutQueue201JSONResponse) VisitPutQueueResponse ¶
func (response PutQueue201JSONResponse) VisitPutQueueResponse(w http.ResponseWriter) error
type PutQueueJSONRequestBody ¶
type PutQueueJSONRequestBody = QueueConfig
PutQueueJSONRequestBody defines body for PutQueue for application/json ContentType.
type PutQueueRequestObject ¶
type PutQueueRequestObject struct {
Queue QueueName `json:"queue"`
Body *PutQueueJSONRequestBody
}
type PutQueueResponseObject ¶
type PutQueueResponseObject interface {
VisitPutQueueResponse(w http.ResponseWriter) error
}
type PutQueuedefaultJSONResponse ¶
func (PutQueuedefaultJSONResponse) VisitPutQueueResponse ¶
func (response PutQueuedefaultJSONResponse) VisitPutQueueResponse(w http.ResponseWriter) error
type PutSchedule200JSONResponse ¶
type PutSchedule200JSONResponse Schedule
func (PutSchedule200JSONResponse) VisitPutScheduleResponse ¶
func (response PutSchedule200JSONResponse) VisitPutScheduleResponse(w http.ResponseWriter) error
type PutSchedule201JSONResponse ¶
type PutSchedule201JSONResponse Schedule
func (PutSchedule201JSONResponse) VisitPutScheduleResponse ¶
func (response PutSchedule201JSONResponse) VisitPutScheduleResponse(w http.ResponseWriter) error
type PutScheduleJSONRequestBody ¶
type PutScheduleJSONRequestBody = ScheduleConfig
PutScheduleJSONRequestBody defines body for PutSchedule for application/json ContentType.
type PutScheduleRequestObject ¶
type PutScheduleRequestObject struct {
Schedule ScheduleName `json:"schedule"`
Body *PutScheduleJSONRequestBody
}
type PutScheduleResponseObject ¶
type PutScheduleResponseObject interface {
VisitPutScheduleResponse(w http.ResponseWriter) error
}
type PutScheduledefaultJSONResponse ¶
func (PutScheduledefaultJSONResponse) VisitPutScheduleResponse ¶
func (response PutScheduledefaultJSONResponse) VisitPutScheduleResponse(w http.ResponseWriter) error
type PutWorkflow200JSONResponse ¶ added in v0.4.0
type PutWorkflow200JSONResponse Workflow
func (PutWorkflow200JSONResponse) VisitPutWorkflowResponse ¶ added in v0.4.0
func (response PutWorkflow200JSONResponse) VisitPutWorkflowResponse(w http.ResponseWriter) error
type PutWorkflow201JSONResponse ¶ added in v0.4.0
type PutWorkflow201JSONResponse Workflow
func (PutWorkflow201JSONResponse) VisitPutWorkflowResponse ¶ added in v0.4.0
func (response PutWorkflow201JSONResponse) VisitPutWorkflowResponse(w http.ResponseWriter) error
type PutWorkflowJSONRequestBody ¶ added in v0.4.0
type PutWorkflowJSONRequestBody = WorkflowConfig
PutWorkflowJSONRequestBody defines body for PutWorkflow for application/json ContentType.
type PutWorkflowRequestObject ¶ added in v0.4.0
type PutWorkflowRequestObject struct {
Workflow WorkflowName `json:"workflow"`
Body *PutWorkflowJSONRequestBody
}
type PutWorkflowResponseObject ¶ added in v0.4.0
type PutWorkflowResponseObject interface {
VisitPutWorkflowResponse(w http.ResponseWriter) error
}
type PutWorkflowdefaultJSONResponse ¶ added in v0.4.0
func (PutWorkflowdefaultJSONResponse) VisitPutWorkflowResponse ¶ added in v0.4.0
func (response PutWorkflowdefaultJSONResponse) VisitPutWorkflowResponse(w http.ResponseWriter) error
type Queue ¶
type Queue struct {
// AutoPause Pause the queue by itself when its endpoint looks down: after
// `after_failures` attempts in a row end with a 5xx, a timeout or a
// network error. Other 4xx responses, 429 and lost attempts don't
// count, and only a success resets the count. While auto-paused, tasks
// wait without using attempts, and one task at a time goes as a probe:
// 30 seconds after the pause, then after twice as long each time it
// fails, up to every 10 minutes. The first success resumes the queue.
// Resuming it by hand does too. Omit for no auto-pause. Not for queues
// whose tasks go to many endpoints, where one being down would hold up
// the rest; Workly's own queues can't have it.
AutoPause *AutoPauseConfig `json:"auto_pause,omitempty"`
// AutoPaused The queue paused itself after failures in a row (see `auto_pause`).
// Absent when it hasn't, or once it resumed.
AutoPaused *AutoPaused `json:"auto_paused,omitempty"`
// BackoffMultiplier Retry n waits a random time between `min_backoff_seconds` and
// `min_backoff_seconds * backoff_multiplier^(n-1)`, capped at
// `max_backoff_seconds`. `Retry-After` response headers are honoured.
BackoffMultiplier float64 `json:"backoff_multiplier"`
CreatedAt time.Time `json:"created_at"`
// MaxAttempts Total delivery attempts before a task fails. Tasks can override it.
MaxAttempts int `json:"max_attempts"`
MaxBackoffSeconds float64 `json:"max_backoff_seconds"`
// MaxConcurrency Most deliveries in flight at once. There is always a limit; the
// default is low so a new queue can't overwhelm its endpoint.
MaxConcurrency int `json:"max_concurrency"`
MinBackoffSeconds float64 `json:"min_backoff_seconds"`
Name string `json:"name"`
// Paused Paused by hand. See `auto_paused` for a pause the queue made itself.
Paused bool `json:"paused"`
// RatePerSecond Most deliveries started per second. Omit for no limit. Retries
// count; recovering a lost attempt does too. Deliveries are spread
// out evenly: after an idle spell, at most a tenth of a second's
// worth (at least 1) start at once.
RatePerSecond *float64 `json:"rate_per_second,omitempty"`
// RetryOn4xx Retry 4xx responses. By default only 408 and 429 are retried, as
// other client errors usually fail again.
RetryOn4xx bool `json:"retry_on_4xx"`
// Stats The queue's current work. Returned when getting or listing queues.
// Counts stop at 10,000, so 10000 means "10,000 or more".
Stats *QueueStats `json:"stats,omitempty"`
// TimeoutSeconds How long to wait for a response. Tasks can override it.
TimeoutSeconds float64 `json:"timeout_seconds"`
UpdatedAt time.Time `json:"updated_at"`
}
Queue defines model for Queue.
type QueueActivity ¶
type QueueActivity struct {
Cancelled int `json:"cancelled"`
// DurationSamples How many latest attempts with a recorded duration the percentiles
// are taken over (at most 2,000). 0 when there are no percentiles.
DurationSamples int `json:"duration_samples"`
Failed int `json:"failed"`
// P50DurationMs Median duration of the latest attempt of the succeeded and failed
// tasks counted (at most the last 1,000 of each). Absent if none
// has one.
P50DurationMs *int `json:"p50_duration_ms,omitempty"`
// P95DurationMs 95th percentile of the same durations.
P95DurationMs *int `json:"p95_duration_ms,omitempty"`
// RetentionSeconds How long the server keeps finished tasks (`WORKLY_RETENTION`).
// Absent if it keeps them forever.
RetentionSeconds *float64 `json:"retention_seconds,omitempty"`
// Since The start of the period counted.
Since time.Time `json:"since"`
Succeeded int `json:"succeeded"`
}
QueueActivity Counts stop at 10,000, so 10000 means "10,000 or more".
type QueueConfig ¶
type QueueConfig struct {
// AutoPause Pause the queue by itself when its endpoint looks down: after
// `after_failures` attempts in a row end with a 5xx, a timeout or a
// network error. Other 4xx responses, 429 and lost attempts don't
// count, and only a success resets the count. While auto-paused, tasks
// wait without using attempts, and one task at a time goes as a probe:
// 30 seconds after the pause, then after twice as long each time it
// fails, up to every 10 minutes. The first success resumes the queue.
// Resuming it by hand does too. Omit for no auto-pause. Not for queues
// whose tasks go to many endpoints, where one being down would hold up
// the rest; Workly's own queues can't have it.
AutoPause *AutoPauseConfig `json:"auto_pause,omitempty"`
// BackoffMultiplier Retry n waits a random time between `min_backoff_seconds` and
// `min_backoff_seconds * backoff_multiplier^(n-1)`, capped at
// `max_backoff_seconds`. `Retry-After` response headers are honoured.
BackoffMultiplier *float64 `json:"backoff_multiplier,omitempty"`
// MaxAttempts Total delivery attempts before a task fails. Tasks can override it.
MaxAttempts *int `json:"max_attempts,omitempty"`
MaxBackoffSeconds *float64 `json:"max_backoff_seconds,omitempty"`
// MaxConcurrency Most deliveries in flight at once. There is always a limit; the
// default is low so a new queue can't overwhelm its endpoint.
MaxConcurrency *int `json:"max_concurrency,omitempty"`
MinBackoffSeconds *float64 `json:"min_backoff_seconds,omitempty"`
// RatePerSecond Most deliveries started per second. Omit for no limit. Retries
// count; recovering a lost attempt does too. Deliveries are spread
// out evenly: after an idle spell, at most a tenth of a second's
// worth (at least 1) start at once.
RatePerSecond *float64 `json:"rate_per_second,omitempty"`
// RetryOn4xx Retry 4xx responses. By default only 408 and 429 are retried, as
// other client errors usually fail again.
RetryOn4xx *bool `json:"retry_on_4xx,omitempty"`
// TimeoutSeconds How long to wait for a response. Tasks can override it.
TimeoutSeconds *float64 `json:"timeout_seconds,omitempty"`
}
QueueConfig A queue's delivery policy. Omitted fields take the default.
type QueueFailures ¶
type QueueFailures struct {
Groups []FailureGroup `json:"groups"`
}
QueueFailures defines model for QueueFailures.
type QueueList ¶
type QueueList struct {
Queues []Queue `json:"queues"`
}
QueueList defines model for QueueList.
type QueueStats ¶
type QueueStats struct {
// Due Pending tasks that are due now.
Due int `json:"due"`
// Failed Failed tasks still retained (see `WORKLY_RETENTION`). Retry them
// with `POST /v1/queues/{queue}/retry-failed`.
Failed int `json:"failed"`
// OldestDueAt When the longest-waiting due task became due, i.e. how far behind
// the queue is. Absent when nothing is due.
OldestDueAt *time.Time `json:"oldest_due_at,omitempty"`
// Running Tasks with a delivery in flight.
Running int `json:"running"`
// Scheduled Pending tasks due later, including ones waiting to retry.
Scheduled int `json:"scheduled"`
}
QueueStats The queue's current work. Returned when getting or listing queues. Counts stop at 10,000, so 10000 means "10,000 or more".
type RequiredHeaderError ¶
func (*RequiredHeaderError) Error ¶
func (e *RequiredHeaderError) Error() string
func (*RequiredHeaderError) Unwrap ¶
func (e *RequiredHeaderError) Unwrap() error
type RequiredParamError ¶
type RequiredParamError struct {
ParamName string
}
func (*RequiredParamError) Error ¶
func (e *RequiredParamError) Error() string
type ResumeQueue200JSONResponse ¶
type ResumeQueue200JSONResponse Queue
func (ResumeQueue200JSONResponse) VisitResumeQueueResponse ¶
func (response ResumeQueue200JSONResponse) VisitResumeQueueResponse(w http.ResponseWriter) error
type ResumeQueueRequestObject ¶
type ResumeQueueRequestObject struct {
Queue QueueName `json:"queue"`
}
type ResumeQueueResponseObject ¶
type ResumeQueueResponseObject interface {
VisitResumeQueueResponse(w http.ResponseWriter) error
}
type ResumeQueuedefaultJSONResponse ¶
func (ResumeQueuedefaultJSONResponse) VisitResumeQueueResponse ¶
func (response ResumeQueuedefaultJSONResponse) VisitResumeQueueResponse(w http.ResponseWriter) error
type ResumeSchedule200JSONResponse ¶
type ResumeSchedule200JSONResponse Schedule
func (ResumeSchedule200JSONResponse) VisitResumeScheduleResponse ¶
func (response ResumeSchedule200JSONResponse) VisitResumeScheduleResponse(w http.ResponseWriter) error
type ResumeScheduleRequestObject ¶
type ResumeScheduleRequestObject struct {
Schedule ScheduleName `json:"schedule"`
}
type ResumeScheduleResponseObject ¶
type ResumeScheduleResponseObject interface {
VisitResumeScheduleResponse(w http.ResponseWriter) error
}
type ResumeScheduledefaultJSONResponse ¶
func (ResumeScheduledefaultJSONResponse) VisitResumeScheduleResponse ¶
func (response ResumeScheduledefaultJSONResponse) VisitResumeScheduleResponse(w http.ResponseWriter) error
type RetryFailedResult ¶
type RetryFailedResult struct {
// Retried How many failed tasks were made pending again.
Retried int `json:"retried"`
}
RetryFailedResult defines model for RetryFailedResult.
type RetryFailedTasks200JSONResponse ¶
type RetryFailedTasks200JSONResponse RetryFailedResult
func (RetryFailedTasks200JSONResponse) VisitRetryFailedTasksResponse ¶
func (response RetryFailedTasks200JSONResponse) VisitRetryFailedTasksResponse(w http.ResponseWriter) error
type RetryFailedTasksParams ¶
type RetryFailedTasksParams struct {
// LastError Only tasks whose latest error is exactly this.
LastError *LastError `form:"last_error,omitempty" json:"last_error,omitempty"`
}
RetryFailedTasksParams defines parameters for RetryFailedTasks.
type RetryFailedTasksRequestObject ¶
type RetryFailedTasksRequestObject struct {
Queue QueueName `json:"queue"`
Params RetryFailedTasksParams
}
type RetryFailedTasksResponseObject ¶
type RetryFailedTasksResponseObject interface {
VisitRetryFailedTasksResponse(w http.ResponseWriter) error
}
type RetryFailedTasksdefaultJSONResponse ¶
func (RetryFailedTasksdefaultJSONResponse) VisitRetryFailedTasksResponse ¶
func (response RetryFailedTasksdefaultJSONResponse) VisitRetryFailedTasksResponse(w http.ResponseWriter) error
type RetryRun200JSONResponse ¶
type RetryRun200JSONResponse Run
func (RetryRun200JSONResponse) VisitRetryRunResponse ¶
func (response RetryRun200JSONResponse) VisitRetryRunResponse(w http.ResponseWriter) error
type RetryRunRequestObject ¶
type RetryRunRequestObject struct {
Id RunID `json:"id"`
}
type RetryRunResponseObject ¶
type RetryRunResponseObject interface {
VisitRetryRunResponse(w http.ResponseWriter) error
}
type RetryRundefaultJSONResponse ¶
func (RetryRundefaultJSONResponse) VisitRetryRunResponse ¶
func (response RetryRundefaultJSONResponse) VisitRetryRunResponse(w http.ResponseWriter) error
type RetryTask200JSONResponse ¶
type RetryTask200JSONResponse Task
func (RetryTask200JSONResponse) VisitRetryTaskResponse ¶
func (response RetryTask200JSONResponse) VisitRetryTaskResponse(w http.ResponseWriter) error
type RetryTaskRequestObject ¶
type RetryTaskRequestObject struct {
Id TaskID `json:"id"`
}
type RetryTaskResponseObject ¶
type RetryTaskResponseObject interface {
VisitRetryTaskResponse(w http.ResponseWriter) error
}
type RetryTaskdefaultJSONResponse ¶
func (RetryTaskdefaultJSONResponse) VisitRetryTaskResponse ¶
func (response RetryTaskdefaultJSONResponse) VisitRetryTaskResponse(w http.ResponseWriter) error
type RetryWorkflowRun200JSONResponse ¶ added in v0.4.0
type RetryWorkflowRun200JSONResponse WorkflowRun
func (RetryWorkflowRun200JSONResponse) VisitRetryWorkflowRunResponse ¶ added in v0.4.0
func (response RetryWorkflowRun200JSONResponse) VisitRetryWorkflowRunResponse(w http.ResponseWriter) error
type RetryWorkflowRunRequestObject ¶ added in v0.4.0
type RetryWorkflowRunRequestObject struct {
Id WorkflowRunID `json:"id"`
}
type RetryWorkflowRunResponseObject ¶ added in v0.4.0
type RetryWorkflowRunResponseObject interface {
VisitRetryWorkflowRunResponse(w http.ResponseWriter) error
}
type RetryWorkflowRundefaultJSONResponse ¶ added in v0.4.0
func (RetryWorkflowRundefaultJSONResponse) VisitRetryWorkflowRunResponse ¶ added in v0.4.0
func (response RetryWorkflowRundefaultJSONResponse) VisitRetryWorkflowRunResponse(w http.ResponseWriter) error
type Run ¶
type Run struct {
AttemptCount int `json:"attempt_count"`
// Body The body, when it is not JSON.
Body *string `json:"body,omitempty"`
// CallbackState A `pending` task with `run_at` in the future is scheduled. A `failed`
// task has exhausted its attempts or got a non-retryable response.
CallbackState *TaskState `json:"callback_state,omitempty"`
// CallbackTaskId The callback task enqueued when the run last finished, if its schedule has `on_complete`.
CallbackTaskId *string `json:"callback_task_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
// FinishedAt When the run succeeded, failed, was cancelled or was skipped.
FinishedAt *time.Time `json:"finished_at,omitempty"`
Headers map[string]string `json:"headers"`
// Id Example: run_01J9ZK3M5Q8R2T4V6W8X0Y2Z4A
Id string `json:"id"`
LastAttemptAt *time.Time `json:"last_attempt_at,omitempty"`
// LastDurationMs How long the latest finished attempt took. Absent before the first attempt finishes.
LastDurationMs *int `json:"last_duration_ms,omitempty"`
LastError *string `json:"last_error,omitempty"`
// LastOutcome How a delivery attempt ended. `lost` means the result is unknown: the
// dispatcher crashed or shut down mid-delivery, and the endpoint may
// have processed the request.
LastOutcome *Outcome `json:"last_outcome,omitempty"`
// LastStatus HTTP status of the latest attempt, if it got a response.
LastStatus *int `json:"last_status,omitempty"`
Method HTTPMethod `json:"method"`
// Payload The body, when it is JSON.
Payload *json.RawMessage `json:"payload,omitempty"`
// RetriedAt When the run was last retried by hand. Absent if never.
RetriedAt *time.Time `json:"retried_at,omitempty"`
// RunAt When the run is next eligible for delivery.
RunAt time.Time `json:"run_at"`
Schedule string `json:"schedule"`
// ScheduledFor The cron slot, or when a manual run was triggered. Sent as `Workly-Scheduled-For`.
ScheduledFor time.Time `json:"scheduled_for"`
// SkipReason `overlap`: the previous run, or the workflow run it started, was
// still going (overlap policy `skip`). `missed`: the server was down at the slot (missed
// policy `skip`).
SkipReason *SkipReason `json:"skip_reason,omitempty"`
// StartedAt When the first delivery attempt started. Retries by hand don't change it. Absent before the first attempt.
StartedAt *time.Time `json:"started_at,omitempty"`
// State A `skipped` run was never delivered: see `skip_reason`. It can be
// retried to deliver it now.
State RunState `json:"state"`
// Trigger `schedule` for a cron slot, `manual` for "run now".
Trigger RunTrigger `json:"trigger"`
UpdatedAt time.Time `json:"updated_at"`
Url string `json:"url"`
// WorkflowRunId The workflow run this run started, for a schedule that starts a workflow.
WorkflowRunId *string `json:"workflow_run_id,omitempty"`
WorkflowRunStatus *WorkflowRunStatus `json:"workflow_run_status,omitempty"`
}
Run defines model for Run.
type RunList ¶
type RunList struct {
// NextCursor Pass as `cursor` to get the next page. Absent on the last page.
NextCursor *string `json:"next_cursor,omitempty"`
Runs []Run `json:"runs"`
}
RunList defines model for RunList.
type RunState ¶
type RunState string
RunState A `skipped` run was never delivered: see `skip_reason`. It can be retried to deliver it now.
type RunTrigger ¶
type RunTrigger string
RunTrigger `schedule` for a cron slot, `manual` for "run now".
const ( RunTriggerManual RunTrigger = "manual" RunTriggerSchedule RunTrigger = "schedule" )
Defines values for RunTrigger.
func (RunTrigger) Valid ¶
func (e RunTrigger) Valid() bool
Valid indicates whether the value is a known member of the RunTrigger enum.
type Schedule ¶
type Schedule struct {
BackoffMultiplier float64 `json:"backoff_multiplier"`
// Body The body, when it is not JSON.
Body *string `json:"body,omitempty"`
CreatedAt time.Time `json:"created_at"`
Cron string `json:"cron"`
Headers map[string]string `json:"headers"`
// LastRun The schedule's most recent run. Absent before the first.
LastRun *LastRun `json:"last_run,omitempty"`
MaxAttempts int `json:"max_attempts"`
MaxBackoffSeconds float64 `json:"max_backoff_seconds"`
Method HTTPMethod `json:"method"`
MinBackoffSeconds float64 `json:"min_backoff_seconds"`
// Missed What happens to slots missed while the server was down (a slot is
// missed if it can't fire within a minute). `skip` records the most
// recent missed slot as a `skipped` run; `catch_up` runs it. Either
// way, at most one run is created for the missed slots.
Missed MissedPolicy `json:"missed"`
Name string `json:"name"`
// NextRunAt When the schedule next fires. Absent while paused.
NextRunAt *time.Time `json:"next_run_at,omitempty"`
// NextRuns The next five slots. Empty while paused; see `next_runs_if_resumed`.
NextRuns []time.Time `json:"next_runs"`
// NextRunsIfResumed While paused, the five slots the schedule would run at if resumed
// now, to check its cron expression. Absent while it runs.
NextRunsIfResumed *[]time.Time `json:"next_runs_if_resumed,omitempty"`
// OnComplete A task Workly enqueues when something completes: a `POST` to `url`
// whose JSON body says what completed (`TaskSummary` for a task,
// `RunSummary` for a schedule's run, `GroupSummary` for a group).
// Callbacks go to `_callbacks`, a queue Workly creates for them,
// and are delivered like any task in it, with its retries; its
// settings can be changed like any queue's.
//
// A task's or a schedule's callback is called each time the task or
// a run succeeds, fails or is cancelled, and again if it is retried
// by hand and finishes again; skipped runs don't call it. A group's
// is called once, when the group completes.
OnComplete *Callback `json:"on_complete,omitempty"`
// Overlap What happens when a slot comes up while the previous run is still
// pending or running, or, for a schedule with `workflow`, while the
// workflow run it started is still running. `skip` records the slot as
// a `skipped` run; `allow` runs it alongside.
Overlap OverlapPolicy `json:"overlap"`
Paused bool `json:"paused"`
// PausedAt When a paused schedule was paused. Absent while it runs.
PausedAt *time.Time `json:"paused_at,omitempty"`
// Payload The body, when it is JSON.
Payload *json.RawMessage `json:"payload,omitempty"`
RetryOn4xx bool `json:"retry_on_4xx"`
TimeoutSeconds float64 `json:"timeout_seconds"`
Timezone string `json:"timezone"`
UpdatedAt time.Time `json:"updated_at"`
Url string `json:"url"`
// Workflow The workflow each run starts, for a schedule that starts one. `url` is then empty.
Workflow *string `json:"workflow,omitempty"`
}
Schedule defines model for Schedule.
type ScheduleAdmission ¶
type ScheduleAdmission struct {
Name string
// Exists is true when the schedule is being replaced.
Exists bool
// Interval is the shortest time between two of its runs.
Interval time.Duration
// PreviousInterval is the replaced schedule's Interval (zero for a new
// one), so a limit can let a schedule keep the timetable it has.
PreviousInterval time.Duration
}
type ScheduleConfig ¶
type ScheduleConfig struct {
// BackoffMultiplier Retries back off as for queues (see `QueueConfig`).
BackoffMultiplier *float64 `json:"backoff_multiplier,omitempty"`
// Body A raw text body. Use this or `payload`.
Body *string `json:"body,omitempty"`
// ContentType Content type of `body`. Defaults to `text/plain; charset=utf-8`.
ContentType *string `json:"content_type,omitempty"`
// Cron When to run: five fields (minute, hour, day of month, month, day
// of week) with `*`, lists, ranges, steps and names (`jan`, `mon`),
// or `@yearly`, `@monthly`, `@weekly`, `@daily` or `@hourly`. When
// both day fields are restricted, a day matches either.
//
//
// Example: 0 3 * * *
Cron string `json:"cron"`
// Headers Headers sent with every run. `Workly-*` headers are reserved.
Headers *map[string]string `json:"headers,omitempty"`
// MaxAttempts Total delivery attempts before a run fails.
MaxAttempts *int `json:"max_attempts,omitempty"`
MaxBackoffSeconds *float64 `json:"max_backoff_seconds,omitempty"`
Method *HTTPMethod `json:"method,omitempty"`
MinBackoffSeconds *float64 `json:"min_backoff_seconds,omitempty"`
// Missed What happens to slots missed while the server was down (a slot is
// missed if it can't fire within a minute). `skip` records the most
// recent missed slot as a `skipped` run; `catch_up` runs it. Either
// way, at most one run is created for the missed slots.
Missed *MissedPolicy `json:"missed,omitempty"`
// OnComplete A task Workly enqueues when something completes: a `POST` to `url`
// whose JSON body says what completed (`TaskSummary` for a task,
// `RunSummary` for a schedule's run, `GroupSummary` for a group).
// Callbacks go to `_callbacks`, a queue Workly creates for them,
// and are delivered like any task in it, with its retries; its
// settings can be changed like any queue's.
//
// A task's or a schedule's callback is called each time the task or
// a run succeeds, fails or is cancelled, and again if it is retried
// by hand and finishes again; skipped runs don't call it. A group's
// is called once, when the group completes.
OnComplete *Callback `json:"on_complete,omitempty"`
// Overlap What happens when a slot comes up while the previous run is still
// pending or running, or, for a schedule with `workflow`, while the
// workflow run it started is still running. `skip` records the slot as
// a `skipped` run; `allow` runs it alongside.
Overlap *OverlapPolicy `json:"overlap,omitempty"`
// Payload A JSON body, sent with `Content-Type: application/json`. Use this or `body`.
Payload *json.RawMessage `json:"payload,omitempty"`
// RetryOn4xx Retry 4xx responses. By default only 408 and 429 are retried.
RetryOn4xx *bool `json:"retry_on_4xx,omitempty"`
// TimeoutSeconds How long to wait for a response.
TimeoutSeconds *float64 `json:"timeout_seconds,omitempty"`
// Timezone IANA timezone the cron expression is read in, e.g.
// `Europe/Stockholm`. A slot in the hour skipped by a daylight
// saving change runs right after it; a slot in a repeated hour runs
// once.
Timezone *string `json:"timezone,omitempty"`
// Url The http(s) URL to call. Use this or `workflow`.
//
// Example: https://api.example.com/reports/nightly
Url *string `json:"url,omitempty"`
// Workflow A workflow to start a run of instead of calling a URL. The
// `payload`, if any, is the run's `input`; `method`, `headers` and
// `body` don't apply. Each run's attempt starts the workflow run
// (`workflow_run_id`), which then goes on independently: the run
// succeeding means the workflow started, not that it succeeded.
//
//
// Example: daily-refresh
Workflow *string `json:"workflow,omitempty"`
}
ScheduleConfig A schedule's settings. Omitted fields take the default. The request fields (`url` to `content_type`) work as in `EnqueueRequest`. Set `url` to call an endpoint, or `workflow` to start a run of that workflow instead.
type ScheduleList ¶
type ScheduleList struct {
Schedules []Schedule `json:"schedules"`
}
ScheduleList defines model for ScheduleList.
type SearchTasks200JSONResponse ¶
type SearchTasks200JSONResponse TaskList
func (SearchTasks200JSONResponse) VisitSearchTasksResponse ¶
func (response SearchTasks200JSONResponse) VisitSearchTasksResponse(w http.ResponseWriter) error
type SearchTasksParams ¶
type SearchTasksParams struct {
Queue *string `form:"queue,omitempty" json:"queue,omitempty"`
State *TaskState `form:"state,omitempty" json:"state,omitempty"`
IdempotencyKey *string `form:"idempotency_key,omitempty" json:"idempotency_key,omitempty"`
// GroupId Only the tasks of this group.
GroupId *string `form:"group_id,omitempty" json:"group_id,omitempty"`
// LastError Only tasks whose latest error is exactly this.
LastError *LastError `form:"last_error,omitempty" json:"last_error,omitempty"`
// CreatedAfter Only tasks created at or after this time.
CreatedAfter *time.Time `form:"created_after,omitempty" json:"created_after,omitempty"`
// CreatedBefore Only tasks created before this time.
CreatedBefore *time.Time `form:"created_before,omitempty" json:"created_before,omitempty"`
// Sort What to order tasks by:
//
// - `created_at` (the default): when the task was enqueued.
// - `run_at`: when it runs next. Pending tasks are delivered in this
// order, so ascending lists them as they'll run.
// - `last_attempt_at`: when its latest attempt finished. Tasks never
// attempted count as oldest.
// - `attempt_count`: how many attempts it has had.
//
// Ties are broken by task ID.
Sort *SearchTasksParamsSort `form:"sort,omitempty" json:"sort,omitempty"`
// Order `asc` or `desc`. Defaults to `asc` (soonest first) for `run_at` and
// to `desc` (newest or most first) for the rest.
Order *SearchTasksParamsOrder `form:"order,omitempty" json:"order,omitempty"`
// Cursor The `next_cursor` of the previous page, requested with the same
// filters and order.
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
}
SearchTasksParams defines parameters for SearchTasks.
type SearchTasksParamsOrder ¶ added in v0.2.0
type SearchTasksParamsOrder string
SearchTasksParamsOrder defines parameters for SearchTasks.
const ( SearchTasksParamsOrderAsc SearchTasksParamsOrder = "asc" SearchTasksParamsOrderDesc SearchTasksParamsOrder = "desc" )
Defines values for SearchTasksParamsOrder.
func (SearchTasksParamsOrder) Valid ¶ added in v0.2.0
func (e SearchTasksParamsOrder) Valid() bool
Valid indicates whether the value is a known member of the SearchTasksParamsOrder enum.
type SearchTasksParamsSort ¶ added in v0.2.0
type SearchTasksParamsSort string
SearchTasksParamsSort defines parameters for SearchTasks.
const ( SearchTasksParamsSortAttemptCount SearchTasksParamsSort = "attempt_count" SearchTasksParamsSortCreatedAt SearchTasksParamsSort = "created_at" SearchTasksParamsSortLastAttemptAt SearchTasksParamsSort = "last_attempt_at" SearchTasksParamsSortRunAt SearchTasksParamsSort = "run_at" )
Defines values for SearchTasksParamsSort.
func (SearchTasksParamsSort) Valid ¶ added in v0.2.0
func (e SearchTasksParamsSort) Valid() bool
Valid indicates whether the value is a known member of the SearchTasksParamsSort enum.
type SearchTasksRequestObject ¶
type SearchTasksRequestObject struct {
Params SearchTasksParams
}
type SearchTasksResponseObject ¶
type SearchTasksResponseObject interface {
VisitSearchTasksResponse(w http.ResponseWriter) error
}
type SearchTasksdefaultJSONResponse ¶
func (SearchTasksdefaultJSONResponse) VisitSearchTasksResponse ¶
func (response SearchTasksdefaultJSONResponse) VisitSearchTasksResponse(w http.ResponseWriter) error
type ServeMux ¶
type ServeMux interface {
HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
http.Handler
}
ServeMux is an abstraction of http.ServeMux.
type ServerInterface ¶
type ServerInterface interface {
// GetHealthz Liveness probe
// (GET /healthz)
GetHealthz(w http.ResponseWriter, r *http.Request)
// GetReadyz Readiness probe
// (GET /readyz)
GetReadyz(w http.ResponseWriter, r *http.Request)
// GetActivity Count tasks created and finished over time
// (GET /v1/activity)
GetActivity(w http.ResponseWriter, r *http.Request, params GetActivityParams)
// ListAlertChannels List alert channels
// (GET /v1/alert-channels)
ListAlertChannels(w http.ResponseWriter, r *http.Request)
// CreateAlertChannel Add an alert channel
// (POST /v1/alert-channels)
CreateAlertChannel(w http.ResponseWriter, r *http.Request)
// DeleteAlertChannel Remove an alert channel
// (DELETE /v1/alert-channels/{id})
DeleteAlertChannel(w http.ResponseWriter, r *http.Request, id AlertChannelID)
// TestAlertChannel Send a test alert
// (POST /v1/alert-channels/{id}/test)
TestAlertChannel(w http.ResponseWriter, r *http.Request, id AlertChannelID)
// PreviewCron Preview a cron timetable
// (GET /v1/cron/preview)
PreviewCron(w http.ResponseWriter, r *http.Request, params PreviewCronParams)
// ListGroups List task groups
// (GET /v1/groups)
ListGroups(w http.ResponseWriter, r *http.Request, params ListGroupsParams)
// CreateGroup Create a task group
// (POST /v1/groups)
CreateGroup(w http.ResponseWriter, r *http.Request)
// GetGroup Get a task group
// (GET /v1/groups/{id})
GetGroup(w http.ResponseWriter, r *http.Request, id GroupID)
// CloseGroup Close a task group
// (POST /v1/groups/{id}/close)
CloseGroup(w http.ResponseWriter, r *http.Request, id GroupID)
// ListQueues List queues
// (GET /v1/queues)
ListQueues(w http.ResponseWriter, r *http.Request)
// DeleteQueue Delete a queue and all its tasks
// (DELETE /v1/queues/{queue})
DeleteQueue(w http.ResponseWriter, r *http.Request, queue QueueName)
// GetQueue Get a queue
// (GET /v1/queues/{queue})
GetQueue(w http.ResponseWriter, r *http.Request, queue QueueName)
// PutQueue Create or update a queue
// (PUT /v1/queues/{queue})
PutQueue(w http.ResponseWriter, r *http.Request, queue QueueName)
// GetQueueActivity Count a queue's finished tasks
// (GET /v1/queues/{queue}/activity)
GetQueueActivity(w http.ResponseWriter, r *http.Request, queue QueueName, params GetQueueActivityParams)
// CancelPendingTasks Cancel a queue's pending tasks
// (POST /v1/queues/{queue}/cancel-pending)
CancelPendingTasks(w http.ResponseWriter, r *http.Request, queue QueueName)
// GetQueueFailures Group a queue's failed tasks by error
// (GET /v1/queues/{queue}/failures)
GetQueueFailures(w http.ResponseWriter, r *http.Request, queue QueueName, params GetQueueFailuresParams)
// PauseQueue Pause a queue
// (POST /v1/queues/{queue}/pause)
PauseQueue(w http.ResponseWriter, r *http.Request, queue QueueName)
// ResumeQueue Resume a paused queue
// (POST /v1/queues/{queue}/resume)
ResumeQueue(w http.ResponseWriter, r *http.Request, queue QueueName)
// RetryFailedTasks Retry every failed task in a queue
// (POST /v1/queues/{queue}/retry-failed)
RetryFailedTasks(w http.ResponseWriter, r *http.Request, queue QueueName, params RetryFailedTasksParams)
// ListTasks List a queue's tasks
// (GET /v1/queues/{queue}/tasks)
ListTasks(w http.ResponseWriter, r *http.Request, queue QueueName, params ListTasksParams)
// CreateTask Enqueue a task
// (POST /v1/queues/{queue}/tasks)
CreateTask(w http.ResponseWriter, r *http.Request, queue QueueName, params CreateTaskParams)
// CreateTasks Enqueue up to 100 tasks at once
// (POST /v1/queues/{queue}/tasks:batch)
CreateTasks(w http.ResponseWriter, r *http.Request, queue QueueName, params CreateTasksParams)
// ListRuns List runs, newest first
// (GET /v1/runs)
ListRuns(w http.ResponseWriter, r *http.Request, params ListRunsParams)
// GetRun Get a run
// (GET /v1/runs/{id})
GetRun(w http.ResponseWriter, r *http.Request, id RunID)
// ListRunAttempts List a run's delivery attempts, oldest first
// (GET /v1/runs/{id}/attempts)
ListRunAttempts(w http.ResponseWriter, r *http.Request, id RunID)
// CancelRun Cancel a run
// (POST /v1/runs/{id}/cancel)
CancelRun(w http.ResponseWriter, r *http.Request, id RunID)
// GetRunDelivery Get the request that delivers a run
// (GET /v1/runs/{id}/delivery)
GetRunDelivery(w http.ResponseWriter, r *http.Request, id RunID)
// RetryRun Retry a run now
// (POST /v1/runs/{id}/retry)
RetryRun(w http.ResponseWriter, r *http.Request, id RunID)
// ListSchedules List schedules
// (GET /v1/schedules)
ListSchedules(w http.ResponseWriter, r *http.Request)
// DeleteSchedule Delete a schedule and all its runs
// (DELETE /v1/schedules/{schedule})
DeleteSchedule(w http.ResponseWriter, r *http.Request, schedule ScheduleName)
// GetSchedule Get a schedule
// (GET /v1/schedules/{schedule})
GetSchedule(w http.ResponseWriter, r *http.Request, schedule ScheduleName)
// PutSchedule Create or update a schedule
// (PUT /v1/schedules/{schedule})
PutSchedule(w http.ResponseWriter, r *http.Request, schedule ScheduleName)
// PauseSchedule Pause a schedule
// (POST /v1/schedules/{schedule}/pause)
PauseSchedule(w http.ResponseWriter, r *http.Request, schedule ScheduleName)
// ResumeSchedule Resume a paused schedule
// (POST /v1/schedules/{schedule}/resume)
ResumeSchedule(w http.ResponseWriter, r *http.Request, schedule ScheduleName)
// TriggerSchedule Run a schedule now
// (POST /v1/schedules/{schedule}/trigger)
TriggerSchedule(w http.ResponseWriter, r *http.Request, schedule ScheduleName)
// SearchTasks Search tasks across queues
// (GET /v1/tasks)
SearchTasks(w http.ResponseWriter, r *http.Request, params SearchTasksParams)
// GetTask Get a task
// (GET /v1/tasks/{id})
GetTask(w http.ResponseWriter, r *http.Request, id TaskID)
// ListAttempts List a task's delivery attempts, oldest first
// (GET /v1/tasks/{id}/attempts)
ListAttempts(w http.ResponseWriter, r *http.Request, id TaskID)
// CancelTask Cancel a task
// (POST /v1/tasks/{id}/cancel)
CancelTask(w http.ResponseWriter, r *http.Request, id TaskID)
// GetTaskDelivery Get the request that delivers a task
// (GET /v1/tasks/{id}/delivery)
GetTaskDelivery(w http.ResponseWriter, r *http.Request, id TaskID)
// RetryTask Retry a task now
// (POST /v1/tasks/{id}/retry)
RetryTask(w http.ResponseWriter, r *http.Request, id TaskID)
// ListWorkflowRuns List workflow runs, newest first
// (GET /v1/workflow-runs)
ListWorkflowRuns(w http.ResponseWriter, r *http.Request, params ListWorkflowRunsParams)
// GetWorkflowRun Get a workflow run with its steps
// (GET /v1/workflow-runs/{id})
GetWorkflowRun(w http.ResponseWriter, r *http.Request, id WorkflowRunID)
// CancelWorkflowRun Cancel a workflow run
// (POST /v1/workflow-runs/{id}/cancel)
CancelWorkflowRun(w http.ResponseWriter, r *http.Request, id WorkflowRunID)
// RetryWorkflowRun Retry a workflow run
// (POST /v1/workflow-runs/{id}/retry)
RetryWorkflowRun(w http.ResponseWriter, r *http.Request, id WorkflowRunID)
// ListWorkflows List workflows
// (GET /v1/workflows)
ListWorkflows(w http.ResponseWriter, r *http.Request)
// DeleteWorkflow Delete a workflow
// (DELETE /v1/workflows/{workflow})
DeleteWorkflow(w http.ResponseWriter, r *http.Request, workflow WorkflowName)
// GetWorkflow Get a workflow
// (GET /v1/workflows/{workflow})
GetWorkflow(w http.ResponseWriter, r *http.Request, workflow WorkflowName)
// PutWorkflow Create or update a workflow
// (PUT /v1/workflows/{workflow})
PutWorkflow(w http.ResponseWriter, r *http.Request, workflow WorkflowName)
// StartWorkflowRun Start a workflow run
// (POST /v1/workflows/{workflow}/runs)
StartWorkflowRun(w http.ResponseWriter, r *http.Request, workflow WorkflowName)
}
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
func NewStrictHandlerWithOptions ¶
func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) CancelPendingTasks ¶
func (siw *ServerInterfaceWrapper) CancelPendingTasks(w http.ResponseWriter, r *http.Request)
CancelPendingTasks operation middleware
func (*ServerInterfaceWrapper) CancelRun ¶
func (siw *ServerInterfaceWrapper) CancelRun(w http.ResponseWriter, r *http.Request)
CancelRun operation middleware
func (*ServerInterfaceWrapper) CancelTask ¶
func (siw *ServerInterfaceWrapper) CancelTask(w http.ResponseWriter, r *http.Request)
CancelTask operation middleware
func (*ServerInterfaceWrapper) CancelWorkflowRun ¶ added in v0.4.0
func (siw *ServerInterfaceWrapper) CancelWorkflowRun(w http.ResponseWriter, r *http.Request)
CancelWorkflowRun operation middleware
func (*ServerInterfaceWrapper) CloseGroup ¶ added in v0.2.0
func (siw *ServerInterfaceWrapper) CloseGroup(w http.ResponseWriter, r *http.Request)
CloseGroup operation middleware
func (*ServerInterfaceWrapper) CreateAlertChannel ¶
func (siw *ServerInterfaceWrapper) CreateAlertChannel(w http.ResponseWriter, r *http.Request)
CreateAlertChannel operation middleware
func (*ServerInterfaceWrapper) CreateGroup ¶ added in v0.2.0
func (siw *ServerInterfaceWrapper) CreateGroup(w http.ResponseWriter, r *http.Request)
CreateGroup operation middleware
func (*ServerInterfaceWrapper) CreateTask ¶
func (siw *ServerInterfaceWrapper) CreateTask(w http.ResponseWriter, r *http.Request)
CreateTask operation middleware
func (*ServerInterfaceWrapper) CreateTasks ¶
func (siw *ServerInterfaceWrapper) CreateTasks(w http.ResponseWriter, r *http.Request)
CreateTasks operation middleware
func (*ServerInterfaceWrapper) DeleteAlertChannel ¶
func (siw *ServerInterfaceWrapper) DeleteAlertChannel(w http.ResponseWriter, r *http.Request)
DeleteAlertChannel operation middleware
func (*ServerInterfaceWrapper) DeleteQueue ¶
func (siw *ServerInterfaceWrapper) DeleteQueue(w http.ResponseWriter, r *http.Request)
DeleteQueue operation middleware
func (*ServerInterfaceWrapper) DeleteSchedule ¶
func (siw *ServerInterfaceWrapper) DeleteSchedule(w http.ResponseWriter, r *http.Request)
DeleteSchedule operation middleware
func (*ServerInterfaceWrapper) DeleteWorkflow ¶ added in v0.4.0
func (siw *ServerInterfaceWrapper) DeleteWorkflow(w http.ResponseWriter, r *http.Request)
DeleteWorkflow operation middleware
func (*ServerInterfaceWrapper) GetActivity ¶
func (siw *ServerInterfaceWrapper) GetActivity(w http.ResponseWriter, r *http.Request)
GetActivity operation middleware
func (*ServerInterfaceWrapper) GetGroup ¶ added in v0.2.0
func (siw *ServerInterfaceWrapper) GetGroup(w http.ResponseWriter, r *http.Request)
GetGroup operation middleware
func (*ServerInterfaceWrapper) GetHealthz ¶
func (siw *ServerInterfaceWrapper) GetHealthz(w http.ResponseWriter, r *http.Request)
GetHealthz operation middleware
func (*ServerInterfaceWrapper) GetQueue ¶
func (siw *ServerInterfaceWrapper) GetQueue(w http.ResponseWriter, r *http.Request)
GetQueue operation middleware
func (*ServerInterfaceWrapper) GetQueueActivity ¶
func (siw *ServerInterfaceWrapper) GetQueueActivity(w http.ResponseWriter, r *http.Request)
GetQueueActivity operation middleware
func (*ServerInterfaceWrapper) GetQueueFailures ¶
func (siw *ServerInterfaceWrapper) GetQueueFailures(w http.ResponseWriter, r *http.Request)
GetQueueFailures operation middleware
func (*ServerInterfaceWrapper) GetReadyz ¶
func (siw *ServerInterfaceWrapper) GetReadyz(w http.ResponseWriter, r *http.Request)
GetReadyz operation middleware
func (*ServerInterfaceWrapper) GetRun ¶
func (siw *ServerInterfaceWrapper) GetRun(w http.ResponseWriter, r *http.Request)
GetRun operation middleware
func (*ServerInterfaceWrapper) GetRunDelivery ¶
func (siw *ServerInterfaceWrapper) GetRunDelivery(w http.ResponseWriter, r *http.Request)
GetRunDelivery operation middleware
func (*ServerInterfaceWrapper) GetSchedule ¶
func (siw *ServerInterfaceWrapper) GetSchedule(w http.ResponseWriter, r *http.Request)
GetSchedule operation middleware
func (*ServerInterfaceWrapper) GetTask ¶
func (siw *ServerInterfaceWrapper) GetTask(w http.ResponseWriter, r *http.Request)
GetTask operation middleware
func (*ServerInterfaceWrapper) GetTaskDelivery ¶
func (siw *ServerInterfaceWrapper) GetTaskDelivery(w http.ResponseWriter, r *http.Request)
GetTaskDelivery operation middleware
func (*ServerInterfaceWrapper) GetWorkflow ¶ added in v0.4.0
func (siw *ServerInterfaceWrapper) GetWorkflow(w http.ResponseWriter, r *http.Request)
GetWorkflow operation middleware
func (*ServerInterfaceWrapper) GetWorkflowRun ¶ added in v0.4.0
func (siw *ServerInterfaceWrapper) GetWorkflowRun(w http.ResponseWriter, r *http.Request)
GetWorkflowRun operation middleware
func (*ServerInterfaceWrapper) ListAlertChannels ¶
func (siw *ServerInterfaceWrapper) ListAlertChannels(w http.ResponseWriter, r *http.Request)
ListAlertChannels operation middleware
func (*ServerInterfaceWrapper) ListAttempts ¶
func (siw *ServerInterfaceWrapper) ListAttempts(w http.ResponseWriter, r *http.Request)
ListAttempts operation middleware
func (*ServerInterfaceWrapper) ListGroups ¶ added in v0.2.0
func (siw *ServerInterfaceWrapper) ListGroups(w http.ResponseWriter, r *http.Request)
ListGroups operation middleware
func (*ServerInterfaceWrapper) ListQueues ¶
func (siw *ServerInterfaceWrapper) ListQueues(w http.ResponseWriter, r *http.Request)
ListQueues operation middleware
func (*ServerInterfaceWrapper) ListRunAttempts ¶
func (siw *ServerInterfaceWrapper) ListRunAttempts(w http.ResponseWriter, r *http.Request)
ListRunAttempts operation middleware
func (*ServerInterfaceWrapper) ListRuns ¶
func (siw *ServerInterfaceWrapper) ListRuns(w http.ResponseWriter, r *http.Request)
ListRuns operation middleware
func (*ServerInterfaceWrapper) ListSchedules ¶
func (siw *ServerInterfaceWrapper) ListSchedules(w http.ResponseWriter, r *http.Request)
ListSchedules operation middleware
func (*ServerInterfaceWrapper) ListTasks ¶
func (siw *ServerInterfaceWrapper) ListTasks(w http.ResponseWriter, r *http.Request)
ListTasks operation middleware
func (*ServerInterfaceWrapper) ListWorkflowRuns ¶ added in v0.4.0
func (siw *ServerInterfaceWrapper) ListWorkflowRuns(w http.ResponseWriter, r *http.Request)
ListWorkflowRuns operation middleware
func (*ServerInterfaceWrapper) ListWorkflows ¶ added in v0.4.0
func (siw *ServerInterfaceWrapper) ListWorkflows(w http.ResponseWriter, r *http.Request)
ListWorkflows operation middleware
func (*ServerInterfaceWrapper) PauseQueue ¶
func (siw *ServerInterfaceWrapper) PauseQueue(w http.ResponseWriter, r *http.Request)
PauseQueue operation middleware
func (*ServerInterfaceWrapper) PauseSchedule ¶
func (siw *ServerInterfaceWrapper) PauseSchedule(w http.ResponseWriter, r *http.Request)
PauseSchedule operation middleware
func (*ServerInterfaceWrapper) PreviewCron ¶
func (siw *ServerInterfaceWrapper) PreviewCron(w http.ResponseWriter, r *http.Request)
PreviewCron operation middleware
func (*ServerInterfaceWrapper) PutQueue ¶
func (siw *ServerInterfaceWrapper) PutQueue(w http.ResponseWriter, r *http.Request)
PutQueue operation middleware
func (*ServerInterfaceWrapper) PutSchedule ¶
func (siw *ServerInterfaceWrapper) PutSchedule(w http.ResponseWriter, r *http.Request)
PutSchedule operation middleware
func (*ServerInterfaceWrapper) PutWorkflow ¶ added in v0.4.0
func (siw *ServerInterfaceWrapper) PutWorkflow(w http.ResponseWriter, r *http.Request)
PutWorkflow operation middleware
func (*ServerInterfaceWrapper) ResumeQueue ¶
func (siw *ServerInterfaceWrapper) ResumeQueue(w http.ResponseWriter, r *http.Request)
ResumeQueue operation middleware
func (*ServerInterfaceWrapper) ResumeSchedule ¶
func (siw *ServerInterfaceWrapper) ResumeSchedule(w http.ResponseWriter, r *http.Request)
ResumeSchedule operation middleware
func (*ServerInterfaceWrapper) RetryFailedTasks ¶
func (siw *ServerInterfaceWrapper) RetryFailedTasks(w http.ResponseWriter, r *http.Request)
RetryFailedTasks operation middleware
func (*ServerInterfaceWrapper) RetryRun ¶
func (siw *ServerInterfaceWrapper) RetryRun(w http.ResponseWriter, r *http.Request)
RetryRun operation middleware
func (*ServerInterfaceWrapper) RetryTask ¶
func (siw *ServerInterfaceWrapper) RetryTask(w http.ResponseWriter, r *http.Request)
RetryTask operation middleware
func (*ServerInterfaceWrapper) RetryWorkflowRun ¶ added in v0.4.0
func (siw *ServerInterfaceWrapper) RetryWorkflowRun(w http.ResponseWriter, r *http.Request)
RetryWorkflowRun operation middleware
func (*ServerInterfaceWrapper) SearchTasks ¶
func (siw *ServerInterfaceWrapper) SearchTasks(w http.ResponseWriter, r *http.Request)
SearchTasks operation middleware
func (*ServerInterfaceWrapper) StartWorkflowRun ¶ added in v0.4.0
func (siw *ServerInterfaceWrapper) StartWorkflowRun(w http.ResponseWriter, r *http.Request)
StartWorkflowRun operation middleware
func (*ServerInterfaceWrapper) TestAlertChannel ¶
func (siw *ServerInterfaceWrapper) TestAlertChannel(w http.ResponseWriter, r *http.Request)
TestAlertChannel operation middleware
func (*ServerInterfaceWrapper) TriggerSchedule ¶
func (siw *ServerInterfaceWrapper) TriggerSchedule(w http.ResponseWriter, r *http.Request)
TriggerSchedule operation middleware
type SkipReason ¶
type SkipReason string
SkipReason `overlap`: the previous run, or the workflow run it started, was still going (overlap policy `skip`). `missed`: the server was down at the slot (missed policy `skip`).
const ( Missed SkipReason = "missed" Overlap SkipReason = "overlap" )
Defines values for SkipReason.
func (SkipReason) Valid ¶
func (e SkipReason) Valid() bool
Valid indicates whether the value is a known member of the SkipReason enum.
type SortOrder ¶ added in v0.2.0
type SortOrder string
SortOrder defines model for SortOrder.
Defines values for SortOrder.
type StartWorkflowRun ¶ added in v0.4.0
type StartWorkflowRun struct {
// IdempotencyKey Deduplicates runs of the workflow.
IdempotencyKey *string `json:"idempotency_key,omitempty"`
// Input JSON passed to every step that has no body of its own.
Input *json.RawMessage `json:"input,omitempty"`
}
StartWorkflowRun defines model for StartWorkflowRun.
type StartWorkflowRun200JSONResponse ¶ added in v0.4.0
type StartWorkflowRun200JSONResponse WorkflowRun
func (StartWorkflowRun200JSONResponse) VisitStartWorkflowRunResponse ¶ added in v0.4.0
func (response StartWorkflowRun200JSONResponse) VisitStartWorkflowRunResponse(w http.ResponseWriter) error
type StartWorkflowRun201JSONResponse ¶ added in v0.4.0
type StartWorkflowRun201JSONResponse WorkflowRun
func (StartWorkflowRun201JSONResponse) VisitStartWorkflowRunResponse ¶ added in v0.4.0
func (response StartWorkflowRun201JSONResponse) VisitStartWorkflowRunResponse(w http.ResponseWriter) error
type StartWorkflowRunJSONRequestBody ¶ added in v0.4.0
type StartWorkflowRunJSONRequestBody = StartWorkflowRun
StartWorkflowRunJSONRequestBody defines body for StartWorkflowRun for application/json ContentType.
type StartWorkflowRunRequestObject ¶ added in v0.4.0
type StartWorkflowRunRequestObject struct {
Workflow WorkflowName `json:"workflow"`
Body *StartWorkflowRunJSONRequestBody
}
type StartWorkflowRunResponseObject ¶ added in v0.4.0
type StartWorkflowRunResponseObject interface {
VisitStartWorkflowRunResponse(w http.ResponseWriter) error
}
type StartWorkflowRundefaultJSONResponse ¶ added in v0.4.0
func (StartWorkflowRundefaultJSONResponse) VisitStartWorkflowRunResponse ¶ added in v0.4.0
func (response StartWorkflowRundefaultJSONResponse) VisitStartWorkflowRunResponse(w http.ResponseWriter) error
type StdHTTPServerOptions ¶
type StdHTTPServerOptions struct {
BaseURL string
BaseRouter ServeMux
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type StepStatus ¶ added in v0.4.0
type StepStatus string
StepStatus `blocked` waits for its dependencies; `pending` has its task enqueued (or retrying); `running` is being delivered; `waiting` succeeded and waits for the resource its response named in `Workly-Wait-For`; `skipped` never ran, or stopped waiting, because the run stopped.
const ( StepStatusBlocked StepStatus = "blocked" StepStatusFailed StepStatus = "failed" StepStatusPending StepStatus = "pending" StepStatusRunning StepStatus = "running" StepStatusSkipped StepStatus = "skipped" StepStatusSucceeded StepStatus = "succeeded" StepStatusWaiting StepStatus = "waiting" )
Defines values for StepStatus.
func (StepStatus) Valid ¶ added in v0.4.0
func (e StepStatus) Valid() bool
Valid indicates whether the value is a known member of the StepStatus enum.
type StrictHTTPServerOptions ¶
type StrictHTTPServerOptions struct {
RequestErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type StrictHandlerFunc ¶
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// GetHealthz Liveness probe
// (GET /healthz)
GetHealthz(ctx context.Context, request GetHealthzRequestObject) (GetHealthzResponseObject, error)
// GetReadyz Readiness probe
// (GET /readyz)
GetReadyz(ctx context.Context, request GetReadyzRequestObject) (GetReadyzResponseObject, error)
// GetActivity Count tasks created and finished over time
// (GET /v1/activity)
GetActivity(ctx context.Context, request GetActivityRequestObject) (GetActivityResponseObject, error)
// ListAlertChannels List alert channels
// (GET /v1/alert-channels)
ListAlertChannels(ctx context.Context, request ListAlertChannelsRequestObject) (ListAlertChannelsResponseObject, error)
// CreateAlertChannel Add an alert channel
// (POST /v1/alert-channels)
CreateAlertChannel(ctx context.Context, request CreateAlertChannelRequestObject) (CreateAlertChannelResponseObject, error)
// DeleteAlertChannel Remove an alert channel
// (DELETE /v1/alert-channels/{id})
DeleteAlertChannel(ctx context.Context, request DeleteAlertChannelRequestObject) (DeleteAlertChannelResponseObject, error)
// TestAlertChannel Send a test alert
// (POST /v1/alert-channels/{id}/test)
TestAlertChannel(ctx context.Context, request TestAlertChannelRequestObject) (TestAlertChannelResponseObject, error)
// PreviewCron Preview a cron timetable
// (GET /v1/cron/preview)
PreviewCron(ctx context.Context, request PreviewCronRequestObject) (PreviewCronResponseObject, error)
// ListGroups List task groups
// (GET /v1/groups)
ListGroups(ctx context.Context, request ListGroupsRequestObject) (ListGroupsResponseObject, error)
// CreateGroup Create a task group
// (POST /v1/groups)
CreateGroup(ctx context.Context, request CreateGroupRequestObject) (CreateGroupResponseObject, error)
// GetGroup Get a task group
// (GET /v1/groups/{id})
GetGroup(ctx context.Context, request GetGroupRequestObject) (GetGroupResponseObject, error)
// CloseGroup Close a task group
// (POST /v1/groups/{id}/close)
CloseGroup(ctx context.Context, request CloseGroupRequestObject) (CloseGroupResponseObject, error)
// ListQueues List queues
// (GET /v1/queues)
ListQueues(ctx context.Context, request ListQueuesRequestObject) (ListQueuesResponseObject, error)
// DeleteQueue Delete a queue and all its tasks
// (DELETE /v1/queues/{queue})
DeleteQueue(ctx context.Context, request DeleteQueueRequestObject) (DeleteQueueResponseObject, error)
// GetQueue Get a queue
// (GET /v1/queues/{queue})
GetQueue(ctx context.Context, request GetQueueRequestObject) (GetQueueResponseObject, error)
// PutQueue Create or update a queue
// (PUT /v1/queues/{queue})
PutQueue(ctx context.Context, request PutQueueRequestObject) (PutQueueResponseObject, error)
// GetQueueActivity Count a queue's finished tasks
// (GET /v1/queues/{queue}/activity)
GetQueueActivity(ctx context.Context, request GetQueueActivityRequestObject) (GetQueueActivityResponseObject, error)
// CancelPendingTasks Cancel a queue's pending tasks
// (POST /v1/queues/{queue}/cancel-pending)
CancelPendingTasks(ctx context.Context, request CancelPendingTasksRequestObject) (CancelPendingTasksResponseObject, error)
// GetQueueFailures Group a queue's failed tasks by error
// (GET /v1/queues/{queue}/failures)
GetQueueFailures(ctx context.Context, request GetQueueFailuresRequestObject) (GetQueueFailuresResponseObject, error)
// PauseQueue Pause a queue
// (POST /v1/queues/{queue}/pause)
PauseQueue(ctx context.Context, request PauseQueueRequestObject) (PauseQueueResponseObject, error)
// ResumeQueue Resume a paused queue
// (POST /v1/queues/{queue}/resume)
ResumeQueue(ctx context.Context, request ResumeQueueRequestObject) (ResumeQueueResponseObject, error)
// RetryFailedTasks Retry every failed task in a queue
// (POST /v1/queues/{queue}/retry-failed)
RetryFailedTasks(ctx context.Context, request RetryFailedTasksRequestObject) (RetryFailedTasksResponseObject, error)
// ListTasks List a queue's tasks
// (GET /v1/queues/{queue}/tasks)
ListTasks(ctx context.Context, request ListTasksRequestObject) (ListTasksResponseObject, error)
// CreateTask Enqueue a task
// (POST /v1/queues/{queue}/tasks)
CreateTask(ctx context.Context, request CreateTaskRequestObject) (CreateTaskResponseObject, error)
// CreateTasks Enqueue up to 100 tasks at once
// (POST /v1/queues/{queue}/tasks:batch)
CreateTasks(ctx context.Context, request CreateTasksRequestObject) (CreateTasksResponseObject, error)
// ListRuns List runs, newest first
// (GET /v1/runs)
ListRuns(ctx context.Context, request ListRunsRequestObject) (ListRunsResponseObject, error)
// GetRun Get a run
// (GET /v1/runs/{id})
GetRun(ctx context.Context, request GetRunRequestObject) (GetRunResponseObject, error)
// ListRunAttempts List a run's delivery attempts, oldest first
// (GET /v1/runs/{id}/attempts)
ListRunAttempts(ctx context.Context, request ListRunAttemptsRequestObject) (ListRunAttemptsResponseObject, error)
// CancelRun Cancel a run
// (POST /v1/runs/{id}/cancel)
CancelRun(ctx context.Context, request CancelRunRequestObject) (CancelRunResponseObject, error)
// GetRunDelivery Get the request that delivers a run
// (GET /v1/runs/{id}/delivery)
GetRunDelivery(ctx context.Context, request GetRunDeliveryRequestObject) (GetRunDeliveryResponseObject, error)
// RetryRun Retry a run now
// (POST /v1/runs/{id}/retry)
RetryRun(ctx context.Context, request RetryRunRequestObject) (RetryRunResponseObject, error)
// ListSchedules List schedules
// (GET /v1/schedules)
ListSchedules(ctx context.Context, request ListSchedulesRequestObject) (ListSchedulesResponseObject, error)
// DeleteSchedule Delete a schedule and all its runs
// (DELETE /v1/schedules/{schedule})
DeleteSchedule(ctx context.Context, request DeleteScheduleRequestObject) (DeleteScheduleResponseObject, error)
// GetSchedule Get a schedule
// (GET /v1/schedules/{schedule})
GetSchedule(ctx context.Context, request GetScheduleRequestObject) (GetScheduleResponseObject, error)
// PutSchedule Create or update a schedule
// (PUT /v1/schedules/{schedule})
PutSchedule(ctx context.Context, request PutScheduleRequestObject) (PutScheduleResponseObject, error)
// PauseSchedule Pause a schedule
// (POST /v1/schedules/{schedule}/pause)
PauseSchedule(ctx context.Context, request PauseScheduleRequestObject) (PauseScheduleResponseObject, error)
// ResumeSchedule Resume a paused schedule
// (POST /v1/schedules/{schedule}/resume)
ResumeSchedule(ctx context.Context, request ResumeScheduleRequestObject) (ResumeScheduleResponseObject, error)
// TriggerSchedule Run a schedule now
// (POST /v1/schedules/{schedule}/trigger)
TriggerSchedule(ctx context.Context, request TriggerScheduleRequestObject) (TriggerScheduleResponseObject, error)
// SearchTasks Search tasks across queues
// (GET /v1/tasks)
SearchTasks(ctx context.Context, request SearchTasksRequestObject) (SearchTasksResponseObject, error)
// GetTask Get a task
// (GET /v1/tasks/{id})
GetTask(ctx context.Context, request GetTaskRequestObject) (GetTaskResponseObject, error)
// ListAttempts List a task's delivery attempts, oldest first
// (GET /v1/tasks/{id}/attempts)
ListAttempts(ctx context.Context, request ListAttemptsRequestObject) (ListAttemptsResponseObject, error)
// CancelTask Cancel a task
// (POST /v1/tasks/{id}/cancel)
CancelTask(ctx context.Context, request CancelTaskRequestObject) (CancelTaskResponseObject, error)
// GetTaskDelivery Get the request that delivers a task
// (GET /v1/tasks/{id}/delivery)
GetTaskDelivery(ctx context.Context, request GetTaskDeliveryRequestObject) (GetTaskDeliveryResponseObject, error)
// RetryTask Retry a task now
// (POST /v1/tasks/{id}/retry)
RetryTask(ctx context.Context, request RetryTaskRequestObject) (RetryTaskResponseObject, error)
// ListWorkflowRuns List workflow runs, newest first
// (GET /v1/workflow-runs)
ListWorkflowRuns(ctx context.Context, request ListWorkflowRunsRequestObject) (ListWorkflowRunsResponseObject, error)
// GetWorkflowRun Get a workflow run with its steps
// (GET /v1/workflow-runs/{id})
GetWorkflowRun(ctx context.Context, request GetWorkflowRunRequestObject) (GetWorkflowRunResponseObject, error)
// CancelWorkflowRun Cancel a workflow run
// (POST /v1/workflow-runs/{id}/cancel)
CancelWorkflowRun(ctx context.Context, request CancelWorkflowRunRequestObject) (CancelWorkflowRunResponseObject, error)
// RetryWorkflowRun Retry a workflow run
// (POST /v1/workflow-runs/{id}/retry)
RetryWorkflowRun(ctx context.Context, request RetryWorkflowRunRequestObject) (RetryWorkflowRunResponseObject, error)
// ListWorkflows List workflows
// (GET /v1/workflows)
ListWorkflows(ctx context.Context, request ListWorkflowsRequestObject) (ListWorkflowsResponseObject, error)
// DeleteWorkflow Delete a workflow
// (DELETE /v1/workflows/{workflow})
DeleteWorkflow(ctx context.Context, request DeleteWorkflowRequestObject) (DeleteWorkflowResponseObject, error)
// GetWorkflow Get a workflow
// (GET /v1/workflows/{workflow})
GetWorkflow(ctx context.Context, request GetWorkflowRequestObject) (GetWorkflowResponseObject, error)
// PutWorkflow Create or update a workflow
// (PUT /v1/workflows/{workflow})
PutWorkflow(ctx context.Context, request PutWorkflowRequestObject) (PutWorkflowResponseObject, error)
// StartWorkflowRun Start a workflow run
// (POST /v1/workflows/{workflow}/runs)
StartWorkflowRun(ctx context.Context, request StartWorkflowRunRequestObject) (StartWorkflowRunResponseObject, error)
}
StrictServerInterface represents all server handlers.
type Task ¶
type Task struct {
AttemptCount int `json:"attempt_count"`
// Body The body, when it is not JSON.
Body *string `json:"body,omitempty"`
// CallbackTaskId The callback task enqueued when the task last finished, if it has `on_complete`.
CallbackTaskId *string `json:"callback_task_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
// FinishedAt When the task succeeded, failed or was cancelled.
FinishedAt *time.Time `json:"finished_at,omitempty"`
// GroupId The group the task belongs to, if any.
GroupId *string `json:"group_id,omitempty"`
Headers map[string]string `json:"headers"`
// Id Example: task_01J9ZK3M5Q8R2T4V6W8X0Y2Z4A
Id string `json:"id"`
IdempotencyKey *string `json:"idempotency_key,omitempty"`
// LastAttemptAt When the latest attempt finished. Absent before the first attempt.
LastAttemptAt *time.Time `json:"last_attempt_at,omitempty"`
// LastDurationMs How long the latest finished attempt took. Absent before the first attempt finishes.
LastDurationMs *int `json:"last_duration_ms,omitempty"`
LastError *string `json:"last_error,omitempty"`
// LastOutcome How a delivery attempt ended. `lost` means the result is unknown: the
// dispatcher crashed or shut down mid-delivery, and the endpoint may
// have processed the request.
LastOutcome *Outcome `json:"last_outcome,omitempty"`
// LastStatus HTTP status of the latest attempt, if it got a response.
LastStatus *int `json:"last_status,omitempty"`
// MaxAttempts Per-task override, if set.
MaxAttempts *int `json:"max_attempts,omitempty"`
Method HTTPMethod `json:"method"`
// OnComplete A task Workly enqueues when something completes: a `POST` to `url`
// whose JSON body says what completed (`TaskSummary` for a task,
// `RunSummary` for a schedule's run, `GroupSummary` for a group).
// Callbacks go to `_callbacks`, a queue Workly creates for them,
// and are delivered like any task in it, with its retries; its
// settings can be changed like any queue's.
//
// A task's or a schedule's callback is called each time the task or
// a run succeeds, fails or is cancelled, and again if it is retried
// by hand and finishes again; skipped runs don't call it. A group's
// is called once, when the group completes.
OnComplete *Callback `json:"on_complete,omitempty"`
// Payload The body, when it is JSON.
Payload *json.RawMessage `json:"payload,omitempty"`
Queue string `json:"queue"`
// RetriedAt When the task was last retried by hand (`POST /v1/tasks/{id}/retry`
// or `POST /v1/queues/{queue}/retry-failed`). Absent if never.
RetriedAt *time.Time `json:"retried_at,omitempty"`
// RunAt When the task is next eligible for delivery.
RunAt time.Time `json:"run_at"`
// StartedAt When the first delivery attempt started; `started_at` minus
// `created_at` is how long the task waited in the queue. Retries by
// hand don't change it. Absent before the first attempt.
StartedAt *time.Time `json:"started_at,omitempty"`
// State A `pending` task with `run_at` in the future is scheduled. A `failed`
// task has exhausted its attempts or got a non-retryable response.
State TaskState `json:"state"`
// TimeoutSeconds Per-task override, if set.
TimeoutSeconds *float64 `json:"timeout_seconds,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
Url string `json:"url"`
// WorkflowStep The workflow step a task delivers, if it is one. A step's task can't be
// retried on its own: retry its workflow run instead.
WorkflowStep *TaskWorkflowStep `json:"workflow_step,omitempty"`
}
Task defines model for Task.
type TaskList ¶
type TaskList struct {
// NextCursor Pass as `cursor` to get the next page. Absent on the last page.
NextCursor *string `json:"next_cursor,omitempty"`
Tasks []Task `json:"tasks"`
}
TaskList defines model for TaskList.
type TaskSort ¶ added in v0.2.0
type TaskSort string
TaskSort defines model for TaskSort.
type TaskState ¶
type TaskState string
TaskState A `pending` task with `run_at` in the future is scheduled. A `failed` task has exhausted its attempts or got a non-retryable response.
type TaskWorkflowStep ¶ added in v0.4.0
type TaskWorkflowStep struct {
// Id The step, `wfs_…`.
//
// Example: wfs_01M7AH8EPATE4EPK37FWTA5TBQ
Id string `json:"id"`
// Name The step's name in its workflow.
Name string `json:"name"`
// RunId The workflow run, `wfr_…`.
//
// Example: wfr_01M7AH8EP90ZQ4E9228337GGVR
RunId string `json:"run_id"`
Workflow string `json:"workflow"`
}
TaskWorkflowStep The workflow step a task delivers, if it is one. A step's task can't be retried on its own: retry its workflow run instead.
type TestAlertChannel204Response ¶
type TestAlertChannel204Response struct {
}
func (TestAlertChannel204Response) VisitTestAlertChannelResponse ¶
func (response TestAlertChannel204Response) VisitTestAlertChannelResponse(w http.ResponseWriter) error
type TestAlertChannelRequestObject ¶
type TestAlertChannelRequestObject struct {
Id AlertChannelID `json:"id"`
}
type TestAlertChannelResponseObject ¶
type TestAlertChannelResponseObject interface {
VisitTestAlertChannelResponse(w http.ResponseWriter) error
}
type TestAlertChanneldefaultJSONResponse ¶
func (TestAlertChanneldefaultJSONResponse) VisitTestAlertChannelResponse ¶
func (response TestAlertChanneldefaultJSONResponse) VisitTestAlertChannelResponse(w http.ResponseWriter) error
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type TriggerSchedule201JSONResponse ¶
type TriggerSchedule201JSONResponse Run
func (TriggerSchedule201JSONResponse) VisitTriggerScheduleResponse ¶
func (response TriggerSchedule201JSONResponse) VisitTriggerScheduleResponse(w http.ResponseWriter) error
type TriggerScheduleRequestObject ¶
type TriggerScheduleRequestObject struct {
Schedule ScheduleName `json:"schedule"`
}
type TriggerScheduleResponseObject ¶
type TriggerScheduleResponseObject interface {
VisitTriggerScheduleResponse(w http.ResponseWriter) error
}
type TriggerScheduledefaultJSONResponse ¶
func (TriggerScheduledefaultJSONResponse) VisitTriggerScheduleResponse ¶
func (response TriggerScheduledefaultJSONResponse) VisitTriggerScheduleResponse(w http.ResponseWriter) error
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error
type WaitFor ¶ added in v0.4.0
type WaitFor struct {
Id string `json:"id"`
Type WaitForType `json:"type"`
}
WaitFor The resource a step handed its completion to.
type WaitForType ¶ added in v0.4.0
type WaitForType string
WaitForType defines model for WaitFor.Type.
const (
WaitForTypeGroup WaitForType = "group"
)
Defines values for WaitForType.
func (WaitForType) Valid ¶ added in v0.4.0
func (e WaitForType) Valid() bool
Valid indicates whether the value is a known member of the WaitForType enum.
type Workflow ¶ added in v0.4.0
type Workflow struct {
CreatedAt time.Time `json:"created_at"`
LastRun *WorkflowRunSummary `json:"last_run,omitempty"`
MaxDurationSeconds float64 `json:"max_duration_seconds"`
Name string `json:"name"`
Steps []WorkflowStepConfig `json:"steps"`
UpdatedAt time.Time `json:"updated_at"`
// Version Counts changes to the definition, from 1.
Version int `json:"version"`
}
Workflow defines model for Workflow.
type WorkflowConfig ¶ added in v0.4.0
type WorkflowConfig struct {
// MaxDurationSeconds How long a run may take. A run still going after it fails, and a
// step still waiting fails with it.
MaxDurationSeconds *float64 `json:"max_duration_seconds,omitempty"`
// Steps The steps, which must form a DAG.
Steps []WorkflowStepConfig `json:"steps"`
}
WorkflowConfig defines model for WorkflowConfig.
type WorkflowList ¶ added in v0.4.0
type WorkflowList struct {
Workflows []Workflow `json:"workflows"`
}
WorkflowList defines model for WorkflowList.
type WorkflowName ¶ added in v0.4.0
type WorkflowName = string
WorkflowName defines model for WorkflowName.
type WorkflowRun ¶ added in v0.4.0
type WorkflowRun struct {
// Attempt 1, plus one for each time the run was retried. Steps are sent it
// as `Workly-Workflow-Run-Attempt`.
Attempt int `json:"attempt"`
CreatedAt time.Time `json:"created_at"`
// DeadlineAt When a run still going fails (`max_duration_seconds`).
DeadlineAt *time.Time `json:"deadline_at,omitempty"`
// DurationMs From start to finish, or to now while running.
DurationMs *int `json:"duration_ms,omitempty"`
// Error Why the run failed or was cancelled.
Error *string `json:"error,omitempty"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
// Id Example: wfr_01J9ZK3M5Q8R2T4V6W8X0Y2Z4A
Id string `json:"id"`
IdempotencyKey *string `json:"idempotency_key,omitempty"`
Input *json.RawMessage `json:"input,omitempty"`
// RetriedAt When the run was last retried. Absent if never.
RetriedAt *time.Time `json:"retried_at,omitempty"`
// ScheduleRunId The schedule run that started it, if any.
ScheduleRunId *string `json:"schedule_run_id,omitempty"`
Status WorkflowRunStatus `json:"status"`
// Steps In definition order.
Steps []WorkflowStep `json:"steps"`
Version int `json:"version"`
Workflow string `json:"workflow"`
}
WorkflowRun defines model for WorkflowRun.
type WorkflowRunID ¶ added in v0.4.0
type WorkflowRunID = string
WorkflowRunID defines model for WorkflowRunID.
type WorkflowRunList ¶ added in v0.4.0
type WorkflowRunList struct {
// NextCursor Pass as `cursor` to get the next page. Absent on the last page.
NextCursor *string `json:"next_cursor,omitempty"`
WorkflowRuns []WorkflowRunSummary `json:"workflow_runs"`
}
WorkflowRunList defines model for WorkflowRunList.
type WorkflowRunStatus ¶ added in v0.4.0
type WorkflowRunStatus string
WorkflowRunStatus defines model for WorkflowRunStatus.
const ( WorkflowRunStatusCancelled WorkflowRunStatus = "cancelled" WorkflowRunStatusFailed WorkflowRunStatus = "failed" WorkflowRunStatusRunning WorkflowRunStatus = "running" WorkflowRunStatusSucceeded WorkflowRunStatus = "succeeded" )
Defines values for WorkflowRunStatus.
func (WorkflowRunStatus) Valid ¶ added in v0.4.0
func (e WorkflowRunStatus) Valid() bool
Valid indicates whether the value is a known member of the WorkflowRunStatus enum.
type WorkflowRunSummary ¶ added in v0.4.0
type WorkflowRunSummary struct {
// Attempt 1, plus one for each time the run was retried. Steps are sent it
// as `Workly-Workflow-Run-Attempt`.
Attempt int `json:"attempt"`
CreatedAt time.Time `json:"created_at"`
// DeadlineAt When a run still going fails (`max_duration_seconds`).
DeadlineAt *time.Time `json:"deadline_at,omitempty"`
// DurationMs From start to finish, or to now while running.
DurationMs *int `json:"duration_ms,omitempty"`
// Error Why the run failed or was cancelled.
Error *string `json:"error,omitempty"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
// Id Example: wfr_01J9ZK3M5Q8R2T4V6W8X0Y2Z4A
Id string `json:"id"`
IdempotencyKey *string `json:"idempotency_key,omitempty"`
// RetriedAt When the run was last retried. Absent if never.
RetriedAt *time.Time `json:"retried_at,omitempty"`
// ScheduleRunId The schedule run that started it, if any.
ScheduleRunId *string `json:"schedule_run_id,omitempty"`
Status WorkflowRunStatus `json:"status"`
Version int `json:"version"`
Workflow string `json:"workflow"`
}
WorkflowRunSummary defines model for WorkflowRunSummary.
type WorkflowStep ¶ added in v0.4.0
type WorkflowStep struct {
// BlockedBy Dependencies that haven't succeeded yet.
BlockedBy []string `json:"blocked_by"`
// BlockedMs Time spent waiting for dependencies.
BlockedMs *int `json:"blocked_ms,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
DependsOn []string `json:"depends_on"`
// DurationMs From its task being enqueued to the step finishing (or now).
DurationMs *int `json:"duration_ms,omitempty"`
Error *string `json:"error,omitempty"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
// HttpDoneAt When its request succeeded.
HttpDoneAt *time.Time `json:"http_done_at,omitempty"`
// Id Example: wfs_01J9ZK3M5Q8R2T4V6W8X0Y2Z4A
Id string `json:"id"`
Name string `json:"name"`
// ReadyAt When its task was enqueued.
ReadyAt *time.Time `json:"ready_at,omitempty"`
// Status `blocked` waits for its dependencies; `pending` has its task
// enqueued (or retrying); `running` is being delivered; `waiting`
// succeeded and waits for the resource its response named in
// `Workly-Wait-For`; `skipped` never ran, or stopped waiting, because
// the run stopped.
Status StepStatus `json:"status"`
// Task The step's task, which records its attempts.
Task *WorkflowStepTask `json:"task,omitempty"`
TaskId *string `json:"task_id,omitempty"`
// WaitFor The resource a step handed its completion to.
WaitFor *WaitFor `json:"wait_for,omitempty"`
// WaitingMs Time spent waiting for the `wait_for` resource.
WaitingMs *int `json:"waiting_ms,omitempty"`
}
WorkflowStep defines model for WorkflowStep.
type WorkflowStepConfig ¶ added in v0.4.0
type WorkflowStepConfig struct {
// Body A raw text body. Use this or `payload`.
Body *string `json:"body,omitempty"`
// ContentType Content type of `body`. Defaults to `text/plain; charset=utf-8`.
ContentType *string `json:"content_type,omitempty"`
// DependsOn Steps that must succeed before this one starts.
DependsOn *[]string `json:"depends_on,omitempty"`
// Headers `Workly-*` headers are reserved.
Headers *map[string]string `json:"headers,omitempty"`
// MaxAttempts Overrides the queue's max attempts.
MaxAttempts *int `json:"max_attempts,omitempty"`
Method *HTTPMethod `json:"method,omitempty"`
// Name Unique within the workflow. Lowercase letters, digits, `-` and `_`; at most 64 characters.
//
// Example: prices
Name string `json:"name"`
// Payload A JSON body, sent with `Content-Type: application/json`. Use this or `body`.
Payload *json.RawMessage `json:"payload,omitempty"`
// Queue The queue the step's task goes to, for its retry policy, timeout
// and rate and concurrency limits. `_workflows` is created on
// demand; another queue must exist when the step starts.
Queue *string `json:"queue,omitempty"`
// TimeoutSeconds Overrides the queue's timeout.
TimeoutSeconds *float64 `json:"timeout_seconds,omitempty"`
// Url Example: https://api.example.com/jobs/prices
Url string `json:"url"`
}
WorkflowStepConfig A step: an HTTP request, sent as a task once every step in `depends_on` has succeeded. The request fields (`url` to `content_type`) work as in `EnqueueRequest`. A step without `payload` or `body` is sent the run's context as JSON (`workflow_run_id`, `workflow`, `step`, `step_id`, `run_attempt`, `input`); every step gets the `Workly-Workflow`, `Workly-Workflow-Run-Id`, `Workly-Workflow-Step`, `Workly-Workflow-Step-Id` and `Workly-Workflow-Run-Attempt` headers. The step ID is the same on every delivery of the step, so it can serve as an idempotency key; with the run attempt, it keys work that a retried run should redo.
type WorkflowStepTask ¶ added in v0.4.0
type WorkflowStepTask struct {
AttemptCount int `json:"attempt_count"`
Id string `json:"id"`
LastError *string `json:"last_error,omitempty"`
// LastOutcome How a delivery attempt ended. `lost` means the result is unknown: the
// dispatcher crashed or shut down mid-delivery, and the endpoint may
// have processed the request.
LastOutcome *Outcome `json:"last_outcome,omitempty"`
LastStatus *int `json:"last_status,omitempty"`
Queue string `json:"queue"`
// RunAt When a pending task is next delivered.
RunAt *time.Time `json:"run_at,omitempty"`
// State A `pending` task with `run_at` in the future is scheduled. A `failed`
// task has exhausted its attempts or got a non-retryable response.
State TaskState `json:"state"`
}
WorkflowStepTask The step's task, which records its attempts.