Documentation
¶
Overview ¶
Package hourchdapi is the generated Go client and types for the hourchd API.
Source of truth: specs/openapi/hourchd.yml. Regenerate with `just generate`; `just drift` fails if the committed output is stale.
Package hourchdapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
Index ¶
- Constants
- func GetSwagger() (swagger *openapi3.T, err error)
- func NewCancelJobRequest(server string, id JobId) (*http.Request, error)
- func NewCancelRunRequest(server string, id RunId) (*http.Request, error)
- func NewConnectWorkerRequest(server string) (*http.Request, error)
- func NewGetHealthzRequest(server string) (*http.Request, error)
- func NewGetJobArtifactRequest(server string, id JobId, path ArtifactPath) (*http.Request, error)
- func NewGetJobLogRequest(server string, id JobId, params *GetJobLogParams) (*http.Request, error)
- func NewGetJobRequest(server string, id JobId) (*http.Request, error)
- func NewGetKeyRequestDiscoveryRequest(server string) (*http.Request, error)
- func NewGetRunByNumberRequest(server string, workflow WorkflowName, number int64) (*http.Request, error)
- func NewGetRunRequest(server string, id RunId) (*http.Request, error)
- func NewGetStatsRequest(server string) (*http.Request, error)
- func NewGetWorkerJobContextRequest(server string, id JobId) (*http.Request, error)
- func NewGetWorkerJobInputRequest(server string, id JobId, upstreamJob JobName, path ArtifactPath) (*http.Request, error)
- func NewListBuildsRequest(server string, params *ListBuildsParams) (*http.Request, error)
- func NewListJobArtifactsRequest(server string, id JobId) (*http.Request, error)
- func NewListRunsRequest(server string, params *ListRunsParams) (*http.Request, error)
- func NewListWorkersRequest(server string) (*http.Request, error)
- func NewNextCounterRequest(server string, name CounterName) (*http.Request, error)
- func NewPutBuildRequest(server string, pType BuildType, flavour Flavour, num int64, ...) (*http.Request, error)
- func NewPutBuildRequestWithBody(server string, pType BuildType, flavour Flavour, num int64, contentType string, ...) (*http.Request, error)
- func NewPutWorkerJobArtifactRequestWithBody(server string, id JobId, path ArtifactPath, params *PutWorkerJobArtifactParams, ...) (*http.Request, error)
- func NewRetryRunRequest(server string, id RunId, body RetryRunJSONRequestBody) (*http.Request, error)
- func NewRetryRunRequestWithBody(server string, id RunId, contentType string, body io.Reader) (*http.Request, error)
- func NewStreamEventsRequest(server string, params *StreamEventsParams) (*http.Request, error)
- func NewStreamJobLogRequest(server string, id JobId, params *StreamJobLogParams) (*http.Request, error)
- func NewSubmitRunRequest(server string, params *SubmitRunParams, body SubmitRunJSONRequestBody) (*http.Request, error)
- func NewSubmitRunRequestWithBody(server string, params *SubmitRunParams, contentType string, body io.Reader) (*http.Request, error)
- func NewUploadContextRequestWithBody(server string, params *UploadContextParams, contentType string, body io.Reader) (*http.Request, error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type Artifact
- type ArtifactPath
- type Attempt
- type BadRequest
- type Build
- type BuildBody
- type BuildType
- type CancelJobResponse
- type CancelRunResponse
- type Client
- func (c *Client) CancelJob(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) CancelRun(ctx context.Context, id RunId, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ConnectWorker(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetHealthz(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetJob(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetJobArtifact(ctx context.Context, id JobId, path ArtifactPath, ...) (*http.Response, error)
- func (c *Client) GetJobLog(ctx context.Context, id JobId, params *GetJobLogParams, ...) (*http.Response, error)
- func (c *Client) GetKeyRequestDiscovery(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetRun(ctx context.Context, id RunId, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetRunByNumber(ctx context.Context, workflow WorkflowName, number int64, ...) (*http.Response, error)
- func (c *Client) GetStats(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetWorkerJobContext(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetWorkerJobInput(ctx context.Context, id JobId, upstreamJob JobName, path ArtifactPath, ...) (*http.Response, error)
- func (c *Client) ListBuilds(ctx context.Context, params *ListBuildsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListJobArtifacts(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListRuns(ctx context.Context, params *ListRunsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListWorkers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) NextCounter(ctx context.Context, name CounterName, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) PutBuild(ctx context.Context, pType BuildType, flavour Flavour, num int64, ...) (*http.Response, error)
- func (c *Client) PutBuildWithBody(ctx context.Context, pType BuildType, flavour Flavour, num int64, ...) (*http.Response, error)
- func (c *Client) PutWorkerJobArtifactWithBody(ctx context.Context, id JobId, path ArtifactPath, ...) (*http.Response, error)
- func (c *Client) RetryRun(ctx context.Context, id RunId, body RetryRunJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) RetryRunWithBody(ctx context.Context, id RunId, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) StreamEvents(ctx context.Context, params *StreamEventsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) StreamJobLog(ctx context.Context, id JobId, params *StreamJobLogParams, ...) (*http.Response, error)
- func (c *Client) SubmitRun(ctx context.Context, params *SubmitRunParams, body SubmitRunJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) SubmitRunWithBody(ctx context.Context, params *SubmitRunParams, contentType string, ...) (*http.Response, error)
- func (c *Client) UploadContextWithBody(ctx context.Context, params *UploadContextParams, contentType string, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) CancelJobWithResponse(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*CancelJobResponse, error)
- func (c *ClientWithResponses) CancelRunWithResponse(ctx context.Context, id RunId, reqEditors ...RequestEditorFn) (*CancelRunResponse, error)
- func (c *ClientWithResponses) ConnectWorkerWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ConnectWorkerResponse, error)
- func (c *ClientWithResponses) GetHealthzWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthzResponse, error)
- func (c *ClientWithResponses) GetJobArtifactWithResponse(ctx context.Context, id JobId, path ArtifactPath, ...) (*GetJobArtifactResponse, error)
- func (c *ClientWithResponses) GetJobLogWithResponse(ctx context.Context, id JobId, params *GetJobLogParams, ...) (*GetJobLogResponse, error)
- func (c *ClientWithResponses) GetJobWithResponse(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*GetJobResponse, error)
- func (c *ClientWithResponses) GetKeyRequestDiscoveryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetKeyRequestDiscoveryResponse, error)
- func (c *ClientWithResponses) GetRunByNumberWithResponse(ctx context.Context, workflow WorkflowName, number int64, ...) (*GetRunByNumberResponse, error)
- func (c *ClientWithResponses) GetRunWithResponse(ctx context.Context, id RunId, reqEditors ...RequestEditorFn) (*GetRunResponse, error)
- func (c *ClientWithResponses) GetStatsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatsResponse, error)
- func (c *ClientWithResponses) GetWorkerJobContextWithResponse(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*GetWorkerJobContextResponse, error)
- func (c *ClientWithResponses) GetWorkerJobInputWithResponse(ctx context.Context, id JobId, upstreamJob JobName, path ArtifactPath, ...) (*GetWorkerJobInputResponse, error)
- func (c *ClientWithResponses) ListBuildsWithResponse(ctx context.Context, params *ListBuildsParams, reqEditors ...RequestEditorFn) (*ListBuildsResponse, error)
- func (c *ClientWithResponses) ListJobArtifactsWithResponse(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*ListJobArtifactsResponse, error)
- func (c *ClientWithResponses) ListRunsWithResponse(ctx context.Context, params *ListRunsParams, reqEditors ...RequestEditorFn) (*ListRunsResponse, error)
- func (c *ClientWithResponses) ListWorkersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListWorkersResponse, error)
- func (c *ClientWithResponses) NextCounterWithResponse(ctx context.Context, name CounterName, reqEditors ...RequestEditorFn) (*NextCounterResponse, error)
- func (c *ClientWithResponses) PutBuildWithBodyWithResponse(ctx context.Context, pType BuildType, flavour Flavour, num int64, ...) (*PutBuildResponse, error)
- func (c *ClientWithResponses) PutBuildWithResponse(ctx context.Context, pType BuildType, flavour Flavour, num int64, ...) (*PutBuildResponse, error)
- func (c *ClientWithResponses) PutWorkerJobArtifactWithBodyWithResponse(ctx context.Context, id JobId, path ArtifactPath, ...) (*PutWorkerJobArtifactResponse, error)
- func (c *ClientWithResponses) RetryRunWithBodyWithResponse(ctx context.Context, id RunId, contentType string, body io.Reader, ...) (*RetryRunResponse, error)
- func (c *ClientWithResponses) RetryRunWithResponse(ctx context.Context, id RunId, body RetryRunJSONRequestBody, ...) (*RetryRunResponse, error)
- func (c *ClientWithResponses) StreamEventsWithResponse(ctx context.Context, params *StreamEventsParams, reqEditors ...RequestEditorFn) (*StreamEventsResponse, error)
- func (c *ClientWithResponses) StreamJobLogWithResponse(ctx context.Context, id JobId, params *StreamJobLogParams, ...) (*StreamJobLogResponse, error)
- func (c *ClientWithResponses) SubmitRunWithBodyWithResponse(ctx context.Context, params *SubmitRunParams, contentType string, ...) (*SubmitRunResponse, error)
- func (c *ClientWithResponses) SubmitRunWithResponse(ctx context.Context, params *SubmitRunParams, body SubmitRunJSONRequestBody, ...) (*SubmitRunResponse, error)
- func (c *ClientWithResponses) UploadContextWithBodyWithResponse(ctx context.Context, params *UploadContextParams, contentType string, ...) (*UploadContextResponse, error)
- type ClientWithResponsesInterface
- type ConnectWorkerResponse
- type ContextRef
- type ContextUpload
- type Counter
- type CounterName
- type EnvName
- type Error
- type ErrorCode
- type Event
- func (t Event) AsJobEvent() (JobEvent, error)
- func (t Event) AsResyncEvent() (ResyncEvent, error)
- func (t Event) AsRunEvent() (RunEvent, error)
- func (t Event) AsWorkerEvent() (WorkerEvent, error)
- func (t Event) Discriminator() (string, error)
- func (t *Event) FromJobEvent(v JobEvent) error
- func (t *Event) FromResyncEvent(v ResyncEvent) error
- func (t *Event) FromRunEvent(v RunEvent) error
- func (t *Event) FromWorkerEvent(v WorkerEvent) error
- func (t Event) MarshalJSON() ([]byte, error)
- func (t *Event) MergeJobEvent(v JobEvent) error
- func (t *Event) MergeResyncEvent(v ResyncEvent) error
- func (t *Event) MergeRunEvent(v RunEvent) error
- func (t *Event) MergeWorkerEvent(v WorkerEvent) error
- func (t *Event) UnmarshalJSON(b []byte) error
- func (t Event) ValueByDiscriminator() (interface{}, error)
- type Flavour
- type Forbidden
- type GetHealthzResponse
- type GetJobArtifactResponse
- type GetJobLogParams
- type GetJobLogResponse
- type GetJobResponse
- type GetKeyRequestDiscoveryResponse
- type GetRunByNumberResponse
- type GetRunResponse
- type GetStatsResponse
- type GetWorkerJobContextResponse
- type GetWorkerJobInputResponse
- type Healthz
- type HealthzMinio
- type HealthzPowerwarden
- type HealthzStatus
- type HttpRequestDoer
- type Internal
- type JobAttempt
- type JobCounts
- type JobDetail
- type JobEvent
- type JobEventType
- type JobId
- type JobInput
- type JobName
- type JobSpec
- type JobStatus
- type JobSummary
- type KeyRequestDiscovery
- type LatencyMs
- type Limit
- type ListBuildsParams
- type ListBuildsResponse
- type ListJobArtifactsResponse
- type ListRunsParams
- type ListRunsResponse
- type ListWorkersResponse
- type LogChunkEvent
- type LogEndEvent
- type LogStream
- type LogStreamEvent
- func (t LogStreamEvent) AsLogChunkEvent() (LogChunkEvent, error)
- func (t LogStreamEvent) AsLogEndEvent() (LogEndEvent, error)
- func (t *LogStreamEvent) FromLogChunkEvent(v LogChunkEvent) error
- func (t *LogStreamEvent) FromLogEndEvent(v LogEndEvent) error
- func (t LogStreamEvent) MarshalJSON() ([]byte, error)
- func (t *LogStreamEvent) MergeLogChunkEvent(v LogChunkEvent) error
- func (t *LogStreamEvent) MergeLogEndEvent(v LogEndEvent) error
- func (t *LogStreamEvent) UnmarshalJSON(b []byte) error
- type NextCounterResponse
- type NotFound
- type NotLeased
- type PersonalKeysStatus
- type PersonalKeysStatusOrigin
- type PutBuildJSONRequestBody
- type PutBuildResponse
- type PutWorkerJobArtifactParams
- type PutWorkerJobArtifactResponse
- type RequestEditorFn
- type ResyncEvent
- type ResyncEventType
- type RetryRequest
- type RetryRunJSONRequestBody
- type RetryRunResponse
- type Run
- type RunEvent
- type RunEventType
- type RunId
- type RunStatus
- type RunSubmission
- type RunSummary
- type SecretName
- type Sha256
- type Stats
- type StatsPowerwarden
- type StreamEventsParams
- type StreamEventsResponse
- type StreamJobLogParams
- type StreamJobLogResponse
- type SubmitRunJSONRequestBody
- type SubmitRunParams
- type SubmitRunResponse
- type Tag
- type Tags
- type TooLarge
- type Ulid
- type Unauthorized
- type Unavailable
- type Unprocessable
- type UploadContextParams
- type UploadContextResponse
- type ValidationResult
- type Worker
- type WorkerCapabilities
- type WorkerEvent
- type WorkerEventType
- type WorkflowName
- type XSha256Optional
Constants ¶
const ( BearerAuthScopes = "bearerAuth.Scopes" JobTokenScopes = "jobToken.Scopes" )
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func NewCancelJobRequest ¶
NewCancelJobRequest generates requests for CancelJob
func NewCancelRunRequest ¶
NewCancelRunRequest generates requests for CancelRun
func NewConnectWorkerRequest ¶
NewConnectWorkerRequest generates requests for ConnectWorker
func NewGetHealthzRequest ¶
NewGetHealthzRequest generates requests for GetHealthz
func NewGetJobArtifactRequest ¶
NewGetJobArtifactRequest generates requests for GetJobArtifact
func NewGetJobLogRequest ¶
NewGetJobLogRequest generates requests for GetJobLog
func NewGetJobRequest ¶
NewGetJobRequest generates requests for GetJob
func NewGetKeyRequestDiscoveryRequest ¶ added in v0.2.0
NewGetKeyRequestDiscoveryRequest generates requests for GetKeyRequestDiscovery
func NewGetRunByNumberRequest ¶
func NewGetRunByNumberRequest(server string, workflow WorkflowName, number int64) (*http.Request, error)
NewGetRunByNumberRequest generates requests for GetRunByNumber
func NewGetRunRequest ¶
NewGetRunRequest generates requests for GetRun
func NewGetStatsRequest ¶
NewGetStatsRequest generates requests for GetStats
func NewGetWorkerJobContextRequest ¶
NewGetWorkerJobContextRequest generates requests for GetWorkerJobContext
func NewGetWorkerJobInputRequest ¶
func NewGetWorkerJobInputRequest(server string, id JobId, upstreamJob JobName, path ArtifactPath) (*http.Request, error)
NewGetWorkerJobInputRequest generates requests for GetWorkerJobInput
func NewListBuildsRequest ¶
func NewListBuildsRequest(server string, params *ListBuildsParams) (*http.Request, error)
NewListBuildsRequest generates requests for ListBuilds
func NewListJobArtifactsRequest ¶
NewListJobArtifactsRequest generates requests for ListJobArtifacts
func NewListRunsRequest ¶
func NewListRunsRequest(server string, params *ListRunsParams) (*http.Request, error)
NewListRunsRequest generates requests for ListRuns
func NewListWorkersRequest ¶
NewListWorkersRequest generates requests for ListWorkers
func NewNextCounterRequest ¶
func NewNextCounterRequest(server string, name CounterName) (*http.Request, error)
NewNextCounterRequest generates requests for NextCounter
func NewPutBuildRequest ¶
func NewPutBuildRequest(server string, pType BuildType, flavour Flavour, num int64, body PutBuildJSONRequestBody) (*http.Request, error)
NewPutBuildRequest calls the generic PutBuild builder with application/json body
func NewPutBuildRequestWithBody ¶
func NewPutBuildRequestWithBody(server string, pType BuildType, flavour Flavour, num int64, contentType string, body io.Reader) (*http.Request, error)
NewPutBuildRequestWithBody generates requests for PutBuild with any type of body
func NewPutWorkerJobArtifactRequestWithBody ¶
func NewPutWorkerJobArtifactRequestWithBody(server string, id JobId, path ArtifactPath, params *PutWorkerJobArtifactParams, contentType string, body io.Reader) (*http.Request, error)
NewPutWorkerJobArtifactRequestWithBody generates requests for PutWorkerJobArtifact with any type of body
func NewRetryRunRequest ¶
func NewRetryRunRequest(server string, id RunId, body RetryRunJSONRequestBody) (*http.Request, error)
NewRetryRunRequest calls the generic RetryRun builder with application/json body
func NewRetryRunRequestWithBody ¶
func NewRetryRunRequestWithBody(server string, id RunId, contentType string, body io.Reader) (*http.Request, error)
NewRetryRunRequestWithBody generates requests for RetryRun with any type of body
func NewStreamEventsRequest ¶
func NewStreamEventsRequest(server string, params *StreamEventsParams) (*http.Request, error)
NewStreamEventsRequest generates requests for StreamEvents
func NewStreamJobLogRequest ¶
func NewStreamJobLogRequest(server string, id JobId, params *StreamJobLogParams) (*http.Request, error)
NewStreamJobLogRequest generates requests for StreamJobLog
func NewSubmitRunRequest ¶
func NewSubmitRunRequest(server string, params *SubmitRunParams, body SubmitRunJSONRequestBody) (*http.Request, error)
NewSubmitRunRequest calls the generic SubmitRun builder with application/json body
func NewSubmitRunRequestWithBody ¶
func NewSubmitRunRequestWithBody(server string, params *SubmitRunParams, contentType string, body io.Reader) (*http.Request, error)
NewSubmitRunRequestWithBody generates requests for SubmitRun with any type of body
func NewUploadContextRequestWithBody ¶
func NewUploadContextRequestWithBody(server string, params *UploadContextParams, contentType string, body io.Reader) (*http.Request, error)
NewUploadContextRequestWithBody generates requests for UploadContext with any type of body
Types ¶
type Artifact ¶
type Artifact struct {
// Path Relative path; a trailing `/` names a directory. No leading `/`, no `.` or `..` segments.
Path ArtifactPath `json:"path"`
Sha256 Sha256 `json:"sha256"`
Size int64 `json:"size"`
}
Artifact defines model for Artifact.
type ArtifactPath ¶
type ArtifactPath = string
ArtifactPath Relative path; a trailing `/` names a directory. No leading `/`, no `.` or `..` segments.
type Build ¶
type Build struct {
// Body Your build metadata (any JSON object); stored verbatim (at most 1 MiB).
Body BuildBody `json:"body"`
BuildNum int64 `json:"build_num"`
BuildType BuildType `json:"build_type"`
CreatedAt time.Time `json:"created_at"`
// Flavour `distro_arch[_flavour]`, as your record job builds it.
Flavour Flavour `json:"flavour"`
// JobId ULID (Crockford base32, upper case).
JobId Ulid `json:"job_id"`
// RunId ULID (Crockford base32, upper case).
RunId Ulid `json:"run_id"`
}
Build defines model for Build.
type BuildBody ¶
type BuildBody map[string]interface{}
BuildBody Your build metadata (any JSON object); stored verbatim (at most 1 MiB).
type CancelJobResponse ¶
type CancelJobResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *JobDetail
JSON401 *Unauthorized
JSON403 *Forbidden
JSON404 *NotFound
}
func ParseCancelJobResponse ¶
func ParseCancelJobResponse(rsp *http.Response) (*CancelJobResponse, error)
ParseCancelJobResponse parses an HTTP response from a CancelJobWithResponse call
func (CancelJobResponse) Status ¶
func (r CancelJobResponse) Status() string
Status returns HTTPResponse.Status
func (CancelJobResponse) StatusCode ¶
func (r CancelJobResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type CancelRunResponse ¶
type CancelRunResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Run
JSON401 *Unauthorized
JSON403 *Forbidden
JSON404 *NotFound
}
func ParseCancelRunResponse ¶
func ParseCancelRunResponse(rsp *http.Response) (*CancelRunResponse, error)
ParseCancelRunResponse parses an HTTP response from a CancelRunWithResponse call
func (CancelRunResponse) Status ¶
func (r CancelRunResponse) Status() string
Status returns HTTPResponse.Status
func (CancelRunResponse) StatusCode ¶
func (r CancelRunResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type Client ¶
type Client struct {
// The endpoint of the server conforming to this interface, with scheme,
// https://api.deepmap.com for example. This can contain a path relative
// to the server, such as https://api.deepmap.com/dev-test, and all the
// paths in the swagger spec will be appended to the server.
Server string
// Doer for performing requests, typically a *http.Client with any
// customized settings, such as certificate chains.
Client HttpRequestDoer
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []RequestEditorFn
}
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) ConnectWorker ¶
func (*Client) GetHealthz ¶
func (*Client) GetJobArtifact ¶
func (c *Client) GetJobArtifact(ctx context.Context, id JobId, path ArtifactPath, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) GetJobLog ¶
func (c *Client) GetJobLog(ctx context.Context, id JobId, params *GetJobLogParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) GetKeyRequestDiscovery ¶ added in v0.2.0
func (*Client) GetRunByNumber ¶
func (c *Client) GetRunByNumber(ctx context.Context, workflow WorkflowName, number int64, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) GetWorkerJobContext ¶
func (*Client) GetWorkerJobInput ¶
func (c *Client) GetWorkerJobInput(ctx context.Context, id JobId, upstreamJob JobName, path ArtifactPath, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) ListBuilds ¶
func (c *Client) ListBuilds(ctx context.Context, params *ListBuildsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) ListJobArtifacts ¶
func (*Client) ListRuns ¶
func (c *Client) ListRuns(ctx context.Context, params *ListRunsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) ListWorkers ¶
func (*Client) NextCounter ¶
func (c *Client) NextCounter(ctx context.Context, name CounterName, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PutBuildWithBody ¶
func (*Client) PutWorkerJobArtifactWithBody ¶
func (c *Client) PutWorkerJobArtifactWithBody(ctx context.Context, id JobId, path ArtifactPath, params *PutWorkerJobArtifactParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) RetryRun ¶
func (c *Client) RetryRun(ctx context.Context, id RunId, body RetryRunJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) RetryRunWithBody ¶
func (*Client) StreamEvents ¶
func (c *Client) StreamEvents(ctx context.Context, params *StreamEventsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) StreamJobLog ¶
func (c *Client) StreamJobLog(ctx context.Context, id JobId, params *StreamJobLogParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) SubmitRun ¶
func (c *Client) SubmitRun(ctx context.Context, params *SubmitRunParams, body SubmitRunJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) SubmitRunWithBody ¶
func (*Client) UploadContextWithBody ¶
type ClientInterface ¶
type ClientInterface interface {
// ListBuilds request
ListBuilds(ctx context.Context, params *ListBuildsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// PutBuildWithBody request with any body
PutBuildWithBody(ctx context.Context, pType BuildType, flavour Flavour, num int64, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PutBuild(ctx context.Context, pType BuildType, flavour Flavour, num int64, body PutBuildJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// UploadContextWithBody request with any body
UploadContextWithBody(ctx context.Context, params *UploadContextParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// NextCounter request
NextCounter(ctx context.Context, name CounterName, reqEditors ...RequestEditorFn) (*http.Response, error)
// StreamEvents request
StreamEvents(ctx context.Context, params *StreamEventsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetHealthz request
GetHealthz(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetJob request
GetJob(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListJobArtifacts request
ListJobArtifacts(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetJobArtifact request
GetJobArtifact(ctx context.Context, id JobId, path ArtifactPath, reqEditors ...RequestEditorFn) (*http.Response, error)
// CancelJob request
CancelJob(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetJobLog request
GetJobLog(ctx context.Context, id JobId, params *GetJobLogParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// StreamJobLog request
StreamJobLog(ctx context.Context, id JobId, params *StreamJobLogParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetKeyRequestDiscovery request
GetKeyRequestDiscovery(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListRuns request
ListRuns(ctx context.Context, params *ListRunsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// SubmitRunWithBody request with any body
SubmitRunWithBody(ctx context.Context, params *SubmitRunParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
SubmitRun(ctx context.Context, params *SubmitRunParams, body SubmitRunJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetRun request
GetRun(ctx context.Context, id RunId, reqEditors ...RequestEditorFn) (*http.Response, error)
// CancelRun request
CancelRun(ctx context.Context, id RunId, reqEditors ...RequestEditorFn) (*http.Response, error)
// RetryRunWithBody request with any body
RetryRunWithBody(ctx context.Context, id RunId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
RetryRun(ctx context.Context, id RunId, body RetryRunJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetStats request
GetStats(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// ConnectWorker request
ConnectWorker(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// PutWorkerJobArtifactWithBody request with any body
PutWorkerJobArtifactWithBody(ctx context.Context, id JobId, path ArtifactPath, params *PutWorkerJobArtifactParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetWorkerJobContext request
GetWorkerJobContext(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetWorkerJobInput request
GetWorkerJobInput(ctx context.Context, id JobId, upstreamJob JobName, path ArtifactPath, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListWorkers request
ListWorkers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetRunByNumber request
GetRunByNumber(ctx context.Context, workflow WorkflowName, number int64, reqEditors ...RequestEditorFn) (*http.Response, error)
}
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) CancelJobWithResponse ¶
func (c *ClientWithResponses) CancelJobWithResponse(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*CancelJobResponse, error)
CancelJobWithResponse request returning *CancelJobResponse
func (*ClientWithResponses) CancelRunWithResponse ¶
func (c *ClientWithResponses) CancelRunWithResponse(ctx context.Context, id RunId, reqEditors ...RequestEditorFn) (*CancelRunResponse, error)
CancelRunWithResponse request returning *CancelRunResponse
func (*ClientWithResponses) ConnectWorkerWithResponse ¶
func (c *ClientWithResponses) ConnectWorkerWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ConnectWorkerResponse, error)
ConnectWorkerWithResponse request returning *ConnectWorkerResponse
func (*ClientWithResponses) GetHealthzWithResponse ¶
func (c *ClientWithResponses) GetHealthzWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthzResponse, error)
GetHealthzWithResponse request returning *GetHealthzResponse
func (*ClientWithResponses) GetJobArtifactWithResponse ¶
func (c *ClientWithResponses) GetJobArtifactWithResponse(ctx context.Context, id JobId, path ArtifactPath, reqEditors ...RequestEditorFn) (*GetJobArtifactResponse, error)
GetJobArtifactWithResponse request returning *GetJobArtifactResponse
func (*ClientWithResponses) GetJobLogWithResponse ¶
func (c *ClientWithResponses) GetJobLogWithResponse(ctx context.Context, id JobId, params *GetJobLogParams, reqEditors ...RequestEditorFn) (*GetJobLogResponse, error)
GetJobLogWithResponse request returning *GetJobLogResponse
func (*ClientWithResponses) GetJobWithResponse ¶
func (c *ClientWithResponses) GetJobWithResponse(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*GetJobResponse, error)
GetJobWithResponse request returning *GetJobResponse
func (*ClientWithResponses) GetKeyRequestDiscoveryWithResponse ¶ added in v0.2.0
func (c *ClientWithResponses) GetKeyRequestDiscoveryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetKeyRequestDiscoveryResponse, error)
GetKeyRequestDiscoveryWithResponse request returning *GetKeyRequestDiscoveryResponse
func (*ClientWithResponses) GetRunByNumberWithResponse ¶
func (c *ClientWithResponses) GetRunByNumberWithResponse(ctx context.Context, workflow WorkflowName, number int64, reqEditors ...RequestEditorFn) (*GetRunByNumberResponse, error)
GetRunByNumberWithResponse request returning *GetRunByNumberResponse
func (*ClientWithResponses) GetRunWithResponse ¶
func (c *ClientWithResponses) GetRunWithResponse(ctx context.Context, id RunId, reqEditors ...RequestEditorFn) (*GetRunResponse, error)
GetRunWithResponse request returning *GetRunResponse
func (*ClientWithResponses) GetStatsWithResponse ¶
func (c *ClientWithResponses) GetStatsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatsResponse, error)
GetStatsWithResponse request returning *GetStatsResponse
func (*ClientWithResponses) GetWorkerJobContextWithResponse ¶
func (c *ClientWithResponses) GetWorkerJobContextWithResponse(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*GetWorkerJobContextResponse, error)
GetWorkerJobContextWithResponse request returning *GetWorkerJobContextResponse
func (*ClientWithResponses) GetWorkerJobInputWithResponse ¶
func (c *ClientWithResponses) GetWorkerJobInputWithResponse(ctx context.Context, id JobId, upstreamJob JobName, path ArtifactPath, reqEditors ...RequestEditorFn) (*GetWorkerJobInputResponse, error)
GetWorkerJobInputWithResponse request returning *GetWorkerJobInputResponse
func (*ClientWithResponses) ListBuildsWithResponse ¶
func (c *ClientWithResponses) ListBuildsWithResponse(ctx context.Context, params *ListBuildsParams, reqEditors ...RequestEditorFn) (*ListBuildsResponse, error)
ListBuildsWithResponse request returning *ListBuildsResponse
func (*ClientWithResponses) ListJobArtifactsWithResponse ¶
func (c *ClientWithResponses) ListJobArtifactsWithResponse(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*ListJobArtifactsResponse, error)
ListJobArtifactsWithResponse request returning *ListJobArtifactsResponse
func (*ClientWithResponses) ListRunsWithResponse ¶
func (c *ClientWithResponses) ListRunsWithResponse(ctx context.Context, params *ListRunsParams, reqEditors ...RequestEditorFn) (*ListRunsResponse, error)
ListRunsWithResponse request returning *ListRunsResponse
func (*ClientWithResponses) ListWorkersWithResponse ¶
func (c *ClientWithResponses) ListWorkersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListWorkersResponse, error)
ListWorkersWithResponse request returning *ListWorkersResponse
func (*ClientWithResponses) NextCounterWithResponse ¶
func (c *ClientWithResponses) NextCounterWithResponse(ctx context.Context, name CounterName, reqEditors ...RequestEditorFn) (*NextCounterResponse, error)
NextCounterWithResponse request returning *NextCounterResponse
func (*ClientWithResponses) PutBuildWithBodyWithResponse ¶
func (c *ClientWithResponses) PutBuildWithBodyWithResponse(ctx context.Context, pType BuildType, flavour Flavour, num int64, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutBuildResponse, error)
PutBuildWithBodyWithResponse request with arbitrary body returning *PutBuildResponse
func (*ClientWithResponses) PutBuildWithResponse ¶
func (c *ClientWithResponses) PutBuildWithResponse(ctx context.Context, pType BuildType, flavour Flavour, num int64, body PutBuildJSONRequestBody, reqEditors ...RequestEditorFn) (*PutBuildResponse, error)
func (*ClientWithResponses) PutWorkerJobArtifactWithBodyWithResponse ¶
func (c *ClientWithResponses) PutWorkerJobArtifactWithBodyWithResponse(ctx context.Context, id JobId, path ArtifactPath, params *PutWorkerJobArtifactParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutWorkerJobArtifactResponse, error)
PutWorkerJobArtifactWithBodyWithResponse request with arbitrary body returning *PutWorkerJobArtifactResponse
func (*ClientWithResponses) RetryRunWithBodyWithResponse ¶
func (c *ClientWithResponses) RetryRunWithBodyWithResponse(ctx context.Context, id RunId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RetryRunResponse, error)
RetryRunWithBodyWithResponse request with arbitrary body returning *RetryRunResponse
func (*ClientWithResponses) RetryRunWithResponse ¶
func (c *ClientWithResponses) RetryRunWithResponse(ctx context.Context, id RunId, body RetryRunJSONRequestBody, reqEditors ...RequestEditorFn) (*RetryRunResponse, error)
func (*ClientWithResponses) StreamEventsWithResponse ¶
func (c *ClientWithResponses) StreamEventsWithResponse(ctx context.Context, params *StreamEventsParams, reqEditors ...RequestEditorFn) (*StreamEventsResponse, error)
StreamEventsWithResponse request returning *StreamEventsResponse
func (*ClientWithResponses) StreamJobLogWithResponse ¶
func (c *ClientWithResponses) StreamJobLogWithResponse(ctx context.Context, id JobId, params *StreamJobLogParams, reqEditors ...RequestEditorFn) (*StreamJobLogResponse, error)
StreamJobLogWithResponse request returning *StreamJobLogResponse
func (*ClientWithResponses) SubmitRunWithBodyWithResponse ¶
func (c *ClientWithResponses) SubmitRunWithBodyWithResponse(ctx context.Context, params *SubmitRunParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SubmitRunResponse, error)
SubmitRunWithBodyWithResponse request with arbitrary body returning *SubmitRunResponse
func (*ClientWithResponses) SubmitRunWithResponse ¶
func (c *ClientWithResponses) SubmitRunWithResponse(ctx context.Context, params *SubmitRunParams, body SubmitRunJSONRequestBody, reqEditors ...RequestEditorFn) (*SubmitRunResponse, error)
func (*ClientWithResponses) UploadContextWithBodyWithResponse ¶
func (c *ClientWithResponses) UploadContextWithBodyWithResponse(ctx context.Context, params *UploadContextParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UploadContextResponse, error)
UploadContextWithBodyWithResponse request with arbitrary body returning *UploadContextResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// ListBuildsWithResponse request
ListBuildsWithResponse(ctx context.Context, params *ListBuildsParams, reqEditors ...RequestEditorFn) (*ListBuildsResponse, error)
// PutBuildWithBodyWithResponse request with any body
PutBuildWithBodyWithResponse(ctx context.Context, pType BuildType, flavour Flavour, num int64, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutBuildResponse, error)
PutBuildWithResponse(ctx context.Context, pType BuildType, flavour Flavour, num int64, body PutBuildJSONRequestBody, reqEditors ...RequestEditorFn) (*PutBuildResponse, error)
// UploadContextWithBodyWithResponse request with any body
UploadContextWithBodyWithResponse(ctx context.Context, params *UploadContextParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UploadContextResponse, error)
// NextCounterWithResponse request
NextCounterWithResponse(ctx context.Context, name CounterName, reqEditors ...RequestEditorFn) (*NextCounterResponse, error)
// StreamEventsWithResponse request
StreamEventsWithResponse(ctx context.Context, params *StreamEventsParams, reqEditors ...RequestEditorFn) (*StreamEventsResponse, error)
// GetHealthzWithResponse request
GetHealthzWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthzResponse, error)
// GetJobWithResponse request
GetJobWithResponse(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*GetJobResponse, error)
// ListJobArtifactsWithResponse request
ListJobArtifactsWithResponse(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*ListJobArtifactsResponse, error)
// GetJobArtifactWithResponse request
GetJobArtifactWithResponse(ctx context.Context, id JobId, path ArtifactPath, reqEditors ...RequestEditorFn) (*GetJobArtifactResponse, error)
// CancelJobWithResponse request
CancelJobWithResponse(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*CancelJobResponse, error)
// GetJobLogWithResponse request
GetJobLogWithResponse(ctx context.Context, id JobId, params *GetJobLogParams, reqEditors ...RequestEditorFn) (*GetJobLogResponse, error)
// StreamJobLogWithResponse request
StreamJobLogWithResponse(ctx context.Context, id JobId, params *StreamJobLogParams, reqEditors ...RequestEditorFn) (*StreamJobLogResponse, error)
// GetKeyRequestDiscoveryWithResponse request
GetKeyRequestDiscoveryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetKeyRequestDiscoveryResponse, error)
// ListRunsWithResponse request
ListRunsWithResponse(ctx context.Context, params *ListRunsParams, reqEditors ...RequestEditorFn) (*ListRunsResponse, error)
// SubmitRunWithBodyWithResponse request with any body
SubmitRunWithBodyWithResponse(ctx context.Context, params *SubmitRunParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SubmitRunResponse, error)
SubmitRunWithResponse(ctx context.Context, params *SubmitRunParams, body SubmitRunJSONRequestBody, reqEditors ...RequestEditorFn) (*SubmitRunResponse, error)
// GetRunWithResponse request
GetRunWithResponse(ctx context.Context, id RunId, reqEditors ...RequestEditorFn) (*GetRunResponse, error)
// CancelRunWithResponse request
CancelRunWithResponse(ctx context.Context, id RunId, reqEditors ...RequestEditorFn) (*CancelRunResponse, error)
// RetryRunWithBodyWithResponse request with any body
RetryRunWithBodyWithResponse(ctx context.Context, id RunId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RetryRunResponse, error)
RetryRunWithResponse(ctx context.Context, id RunId, body RetryRunJSONRequestBody, reqEditors ...RequestEditorFn) (*RetryRunResponse, error)
// GetStatsWithResponse request
GetStatsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatsResponse, error)
// ConnectWorkerWithResponse request
ConnectWorkerWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ConnectWorkerResponse, error)
// PutWorkerJobArtifactWithBodyWithResponse request with any body
PutWorkerJobArtifactWithBodyWithResponse(ctx context.Context, id JobId, path ArtifactPath, params *PutWorkerJobArtifactParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutWorkerJobArtifactResponse, error)
// GetWorkerJobContextWithResponse request
GetWorkerJobContextWithResponse(ctx context.Context, id JobId, reqEditors ...RequestEditorFn) (*GetWorkerJobContextResponse, error)
// GetWorkerJobInputWithResponse request
GetWorkerJobInputWithResponse(ctx context.Context, id JobId, upstreamJob JobName, path ArtifactPath, reqEditors ...RequestEditorFn) (*GetWorkerJobInputResponse, error)
// ListWorkersWithResponse request
ListWorkersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListWorkersResponse, error)
// GetRunByNumberWithResponse request
GetRunByNumberWithResponse(ctx context.Context, workflow WorkflowName, number int64, reqEditors ...RequestEditorFn) (*GetRunByNumberResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type ConnectWorkerResponse ¶
type ConnectWorkerResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *BadRequest
JSON401 *Unauthorized
JSON403 *Forbidden
}
func ParseConnectWorkerResponse ¶
func ParseConnectWorkerResponse(rsp *http.Response) (*ConnectWorkerResponse, error)
ParseConnectWorkerResponse parses an HTTP response from a ConnectWorkerWithResponse call
func (ConnectWorkerResponse) Status ¶
func (r ConnectWorkerResponse) Status() string
Status returns HTTPResponse.Status
func (ConnectWorkerResponse) StatusCode ¶
func (r ConnectWorkerResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ContextRef ¶
type ContextRef = string
ContextRef `sha256:<hex>` of the uploaded tarball, as returned by `POST /v1/contexts`.
type ContextUpload ¶
type ContextUpload struct {
// ContextRef `sha256:<hex>` of the uploaded tarball, as returned by `POST /v1/contexts`.
ContextRef ContextRef `json:"context_ref"`
// Created False when the same bytes were already stored.
Created bool `json:"created"`
Sha256 Sha256 `json:"sha256"`
Size int64 `json:"size"`
}
ContextUpload defines model for ContextUpload.
type Counter ¶
type Counter struct {
Name CounterName `json:"name"`
Value int64 `json:"value"`
}
Counter defines model for Counter.
type Error ¶
type Error struct {
// Error - `bad_request` (400): malformed request.
// - `checksum_mismatch` (400): upload body does not match `X-Sha256`.
// - `unauthorized` (401): missing, wrong or expired token.
// - `forbidden` (403): token kind not accepted on this route.
// - `not_found` (404): unknown resource.
// - `not_leased` (409): worker data route for a job not leased to the caller.
// - `too_large` (413): body over a configured limit.
// - `invalid_graph` (422): duplicate names, unknown references, cycle, too many jobs.
// - `missing_secret` (422): a job names a secret the submission did not send (on retry: that
// neither the request nor the original run's stored secrets supply; the stored secrets do
// not survive an hourchd restart).
// - `context_not_found` (422): `context_ref` is not stored.
// - `unsatisfiable` (422): some job needs tags (and the `docker` capability for an `image`)
// that no worker hourchd has ever seen offers, nor (for jobs without an `image`) any
// unlocked, non-excluded powerwarden host; the message lists each such job.
// - `internal` (500): unexpected server error.
// - `unavailable` (503): object store unreachable.
Error ErrorCode `json:"error"`
Message string `json:"message"`
}
Error Body of every 4xx and 5xx response.
type ErrorCode ¶
type ErrorCode string
ErrorCode - `bad_request` (400): malformed request.
- `checksum_mismatch` (400): upload body does not match `X-Sha256`.
- `unauthorized` (401): missing, wrong or expired token.
- `forbidden` (403): token kind not accepted on this route.
- `not_found` (404): unknown resource.
- `not_leased` (409): worker data route for a job not leased to the caller.
- `too_large` (413): body over a configured limit.
- `invalid_graph` (422): duplicate names, unknown references, cycle, too many jobs.
- `missing_secret` (422): a job names a secret the submission did not send (on retry: that neither the request nor the original run's stored secrets supply; the stored secrets do not survive an hourchd restart).
- `context_not_found` (422): `context_ref` is not stored.
- `unsatisfiable` (422): some job needs tags (and the `docker` capability for an `image`) that no worker hourchd has ever seen offers, nor (for jobs without an `image`) any unlocked, non-excluded powerwarden host; the message lists each such job.
- `internal` (500): unexpected server error.
- `unavailable` (503): object store unreachable.
const ( ErrorCodeBadRequest ErrorCode = "bad_request" ErrorCodeChecksumMismatch ErrorCode = "checksum_mismatch" ErrorCodeContextNotFound ErrorCode = "context_not_found" ErrorCodeForbidden ErrorCode = "forbidden" ErrorCodeInternal ErrorCode = "internal" ErrorCodeInvalidGraph ErrorCode = "invalid_graph" ErrorCodeMissingSecret ErrorCode = "missing_secret" ErrorCodeNotFound ErrorCode = "not_found" ErrorCodeNotLeased ErrorCode = "not_leased" ErrorCodeTooLarge ErrorCode = "too_large" ErrorCodeUnsatisfiable ErrorCode = "unsatisfiable" )
Defines values for ErrorCode.
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event One `data` payload on `GET /v1/events`, discriminated by `type` (equal to the SSE `event` name).
func (Event) AsJobEvent ¶
AsJobEvent returns the union data inside the Event as a JobEvent
func (Event) AsResyncEvent ¶
func (t Event) AsResyncEvent() (ResyncEvent, error)
AsResyncEvent returns the union data inside the Event as a ResyncEvent
func (Event) AsRunEvent ¶
AsRunEvent returns the union data inside the Event as a RunEvent
func (Event) AsWorkerEvent ¶
func (t Event) AsWorkerEvent() (WorkerEvent, error)
AsWorkerEvent returns the union data inside the Event as a WorkerEvent
func (Event) Discriminator ¶
func (*Event) FromJobEvent ¶
FromJobEvent overwrites any union data inside the Event as the provided JobEvent
func (*Event) FromResyncEvent ¶
func (t *Event) FromResyncEvent(v ResyncEvent) error
FromResyncEvent overwrites any union data inside the Event as the provided ResyncEvent
func (*Event) FromRunEvent ¶
FromRunEvent overwrites any union data inside the Event as the provided RunEvent
func (*Event) FromWorkerEvent ¶
func (t *Event) FromWorkerEvent(v WorkerEvent) error
FromWorkerEvent overwrites any union data inside the Event as the provided WorkerEvent
func (Event) MarshalJSON ¶
func (*Event) MergeJobEvent ¶
MergeJobEvent performs a merge with any union data inside the Event, using the provided JobEvent
func (*Event) MergeResyncEvent ¶
func (t *Event) MergeResyncEvent(v ResyncEvent) error
MergeResyncEvent performs a merge with any union data inside the Event, using the provided ResyncEvent
func (*Event) MergeRunEvent ¶
MergeRunEvent performs a merge with any union data inside the Event, using the provided RunEvent
func (*Event) MergeWorkerEvent ¶
func (t *Event) MergeWorkerEvent(v WorkerEvent) error
MergeWorkerEvent performs a merge with any union data inside the Event, using the provided WorkerEvent
func (*Event) UnmarshalJSON ¶
func (Event) ValueByDiscriminator ¶
type GetHealthzResponse ¶
type GetHealthzResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Healthz
JSON503 *Healthz
}
func ParseGetHealthzResponse ¶
func ParseGetHealthzResponse(rsp *http.Response) (*GetHealthzResponse, error)
ParseGetHealthzResponse parses an HTTP response from a GetHealthzWithResponse call
func (GetHealthzResponse) Status ¶
func (r GetHealthzResponse) Status() string
Status returns HTTPResponse.Status
func (GetHealthzResponse) StatusCode ¶
func (r GetHealthzResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetJobArtifactResponse ¶
type GetJobArtifactResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *BadRequest
JSON401 *Unauthorized
JSON403 *Forbidden
JSON404 *NotFound
JSON503 *Unavailable
}
func ParseGetJobArtifactResponse ¶
func ParseGetJobArtifactResponse(rsp *http.Response) (*GetJobArtifactResponse, error)
ParseGetJobArtifactResponse parses an HTTP response from a GetJobArtifactWithResponse call
func (GetJobArtifactResponse) Status ¶
func (r GetJobArtifactResponse) Status() string
Status returns HTTPResponse.Status
func (GetJobArtifactResponse) StatusCode ¶
func (r GetJobArtifactResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetJobLogParams ¶
type GetJobLogParams struct {
// Attempt Attempt number (1-based). Omitted means the latest attempt.
Attempt *Attempt `form:"attempt,omitempty" json:"attempt,omitempty"`
}
GetJobLogParams defines parameters for GetJobLog.
type GetJobLogResponse ¶
type GetJobLogResponse struct {
Body []byte
HTTPResponse *http.Response
JSON401 *Unauthorized
JSON403 *Forbidden
JSON404 *NotFound
JSON503 *Unavailable
}
func ParseGetJobLogResponse ¶
func ParseGetJobLogResponse(rsp *http.Response) (*GetJobLogResponse, error)
ParseGetJobLogResponse parses an HTTP response from a GetJobLogWithResponse call
func (GetJobLogResponse) Status ¶
func (r GetJobLogResponse) Status() string
Status returns HTTPResponse.Status
func (GetJobLogResponse) StatusCode ¶
func (r GetJobLogResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetJobResponse ¶
type GetJobResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *JobDetail
JSON401 *Unauthorized
JSON403 *Forbidden
JSON404 *NotFound
}
func ParseGetJobResponse ¶
func ParseGetJobResponse(rsp *http.Response) (*GetJobResponse, error)
ParseGetJobResponse parses an HTTP response from a GetJobWithResponse call
func (GetJobResponse) Status ¶
func (r GetJobResponse) Status() string
Status returns HTTPResponse.Status
func (GetJobResponse) StatusCode ¶
func (r GetJobResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetKeyRequestDiscoveryResponse ¶ added in v0.2.0
type GetKeyRequestDiscoveryResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *KeyRequestDiscovery
JSON404 *Error
}
func ParseGetKeyRequestDiscoveryResponse ¶ added in v0.2.0
func ParseGetKeyRequestDiscoveryResponse(rsp *http.Response) (*GetKeyRequestDiscoveryResponse, error)
ParseGetKeyRequestDiscoveryResponse parses an HTTP response from a GetKeyRequestDiscoveryWithResponse call
func (GetKeyRequestDiscoveryResponse) Status ¶ added in v0.2.0
func (r GetKeyRequestDiscoveryResponse) Status() string
Status returns HTTPResponse.Status
func (GetKeyRequestDiscoveryResponse) StatusCode ¶ added in v0.2.0
func (r GetKeyRequestDiscoveryResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetRunByNumberResponse ¶
type GetRunByNumberResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Run
JSON401 *Unauthorized
JSON403 *Forbidden
JSON404 *NotFound
}
func ParseGetRunByNumberResponse ¶
func ParseGetRunByNumberResponse(rsp *http.Response) (*GetRunByNumberResponse, error)
ParseGetRunByNumberResponse parses an HTTP response from a GetRunByNumberWithResponse call
func (GetRunByNumberResponse) Status ¶
func (r GetRunByNumberResponse) Status() string
Status returns HTTPResponse.Status
func (GetRunByNumberResponse) StatusCode ¶
func (r GetRunByNumberResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetRunResponse ¶
type GetRunResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Run
JSON401 *Unauthorized
JSON403 *Forbidden
JSON404 *NotFound
}
func ParseGetRunResponse ¶
func ParseGetRunResponse(rsp *http.Response) (*GetRunResponse, error)
ParseGetRunResponse parses an HTTP response from a GetRunWithResponse call
func (GetRunResponse) Status ¶
func (r GetRunResponse) Status() string
Status returns HTTPResponse.Status
func (GetRunResponse) StatusCode ¶
func (r GetRunResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetStatsResponse ¶
type GetStatsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Stats
JSON401 *Unauthorized
JSON403 *Forbidden
}
func ParseGetStatsResponse ¶
func ParseGetStatsResponse(rsp *http.Response) (*GetStatsResponse, error)
ParseGetStatsResponse parses an HTTP response from a GetStatsWithResponse call
func (GetStatsResponse) Status ¶
func (r GetStatsResponse) Status() string
Status returns HTTPResponse.Status
func (GetStatsResponse) StatusCode ¶
func (r GetStatsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetWorkerJobContextResponse ¶
type GetWorkerJobContextResponse struct {
Body []byte
HTTPResponse *http.Response
JSON401 *Unauthorized
JSON403 *Forbidden
JSON404 *NotFound
JSON409 *NotLeased
JSON503 *Unavailable
}
func ParseGetWorkerJobContextResponse ¶
func ParseGetWorkerJobContextResponse(rsp *http.Response) (*GetWorkerJobContextResponse, error)
ParseGetWorkerJobContextResponse parses an HTTP response from a GetWorkerJobContextWithResponse call
func (GetWorkerJobContextResponse) Status ¶
func (r GetWorkerJobContextResponse) Status() string
Status returns HTTPResponse.Status
func (GetWorkerJobContextResponse) StatusCode ¶
func (r GetWorkerJobContextResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetWorkerJobInputResponse ¶
type GetWorkerJobInputResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *BadRequest
JSON401 *Unauthorized
JSON403 *Forbidden
JSON404 *NotFound
JSON409 *NotLeased
JSON503 *Unavailable
}
func ParseGetWorkerJobInputResponse ¶
func ParseGetWorkerJobInputResponse(rsp *http.Response) (*GetWorkerJobInputResponse, error)
ParseGetWorkerJobInputResponse parses an HTTP response from a GetWorkerJobInputWithResponse call
func (GetWorkerJobInputResponse) Status ¶
func (r GetWorkerJobInputResponse) Status() string
Status returns HTTPResponse.Status
func (GetWorkerJobInputResponse) StatusCode ¶
func (r GetWorkerJobInputResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type Healthz ¶
type Healthz struct {
Minio HealthzMinio `json:"minio"`
Powerwarden HealthzPowerwarden `json:"powerwarden"`
// RunsHoldingSecrets Runs whose stored secrets exist now; an hourchd restart loses them
// (their pending jobs fail `secret_unavailable`). Omitted when
// SQLite is not open.
RunsHoldingSecrets *int `json:"runs_holding_secrets,omitempty"`
Status HealthzStatus `json:"status"`
}
Healthz No job data.
type HealthzMinio ¶
type HealthzMinio string
HealthzMinio defines model for Healthz.Minio.
const ( HealthzMinioConnected HealthzMinio = "connected" HealthzMinioUnreachable HealthzMinio = "unreachable" )
Defines values for HealthzMinio.
type HealthzPowerwarden ¶
type HealthzPowerwarden string
HealthzPowerwarden defines model for Healthz.Powerwarden.
const ( HealthzPowerwardenConnected HealthzPowerwarden = "connected" HealthzPowerwardenDisabled HealthzPowerwarden = "disabled" HealthzPowerwardenUnreachable HealthzPowerwarden = "unreachable" )
Defines values for HealthzPowerwarden.
type HealthzStatus ¶
type HealthzStatus string
HealthzStatus defines model for Healthz.Status.
const ( HealthzStatusOk HealthzStatus = "ok" )
Defines values for HealthzStatus.
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type JobAttempt ¶
type JobAttempt struct {
Attempt int `json:"attempt"`
Error string `json:"error"`
ExitCode *int `json:"exit_code"`
FinishedAt *time.Time `json:"finished_at"`
StartedAt time.Time `json:"started_at"`
Worker string `json:"worker"`
}
JobAttempt One attempt, reconstructed from the events table.
type JobCounts ¶
type JobCounts struct {
Cancelled int `json:"cancelled"`
Failed int `json:"failed"`
Leased int `json:"leased"`
Pending int `json:"pending"`
Ready int `json:"ready"`
Succeeded int `json:"succeeded"`
}
JobCounts Number of jobs in each status.
type JobDetail ¶
type JobDetail struct {
// Argv After placeholder substitution once the job is `ready`; as submitted before.
Argv []string `json:"argv"`
// Artifacts Declared artifact paths.
Artifacts []ArtifactPath `json:"artifacts"`
// Attempt Attempts started so far (0 before the first assignment).
Attempt int `json:"attempt"`
Attempts []JobAttempt `json:"attempts"`
ConcurrencyKey string `json:"concurrency_key"`
CreatedAt time.Time `json:"created_at"`
// DependsOn Effective dependencies by job name (explicit, inputs and output references).
DependsOn []JobName `json:"depends_on"`
Env map[string]string `json:"env"`
// Error Empty on success. Server-set reasons: `timeout`, `lease_expired`,
// `accept_timeout`, `missing_output`, `secret_unavailable`,
// `dependency_failed`, `cancelled`, `exit_code`, `no_worker`; otherwise the
// worker's `result.error` text. `secret_unavailable`: the run's
// stored secrets could not be read when the job was due to start,
// almost always because hourchd restarted (the key lives only in
// its memory); hourchd fails such `pending`/`ready` jobs at startup.
// Retry the run with the values, or re-run the workflow binary.
// `no_worker`: the job stayed `ready` with no connected worker
// (idle or busy) able to run it for `dispatch.unschedulable_timeout`
// (30m); a busy fleet never trips it.
Error string `json:"error"`
ExitCode *int `json:"exit_code"`
FinishedAt *time.Time `json:"finished_at"`
// Id ULID (Crockford base32, upper case).
Id Ulid `json:"id"`
Image string `json:"image"`
Inputs []JobInput `json:"inputs"`
LeaseUntil *time.Time `json:"lease_until"`
MaxAttempts int `json:"max_attempts"`
// Name Unique within a run, e.g. `build` or `build:hello`.
Name JobName `json:"name"`
// Outputs Key → value from `$HOURCH_OUTPUTS`.
Outputs map[string]string `json:"outputs"`
ReadyAt *time.Time `json:"ready_at"`
// RunId ULID (Crockford base32, upper case).
RunId Ulid `json:"run_id"`
// Secrets Secret names this job receives (values are never returned).
Secrets []SecretName `json:"secrets"`
StartedAt *time.Time `json:"started_at"`
Status JobStatus `json:"status"`
// Tags A worker can take the job when its tags are a superset. Zero tags means any worker.
Tags Tags `json:"tags"`
TimeoutSeconds int `json:"timeout_seconds"`
UploadedArtifacts []Artifact `json:"uploaded_artifacts"`
Workdir string `json:"workdir"`
// Worker Worker id holding or last holding the lease; empty if never assigned.
Worker string `json:"worker"`
}
JobDetail defines model for JobDetail.
type JobEvent ¶
type JobEvent struct {
Job JobSummary `json:"job"`
Seq int64 `json:"seq"`
Type JobEventType `json:"type"`
}
JobEvent defines model for JobEvent.
type JobEventType ¶
type JobEventType string
JobEventType defines model for JobEvent.Type.
const (
Job JobEventType = "job"
)
Defines values for JobEventType.
type JobInput ¶
type JobInput struct {
// As Destination relative to the workdir root. Default `inputs/<job>/<path>`.
As *string `json:"as,omitempty"`
// Job Unique within a run, e.g. `build` or `build:hello`.
Job JobName `json:"job"`
// Path Relative path; a trailing `/` names a directory. No leading `/`, no `.` or `..` segments.
Path ArtifactPath `json:"path"`
}
JobInput An upstream artifact fetched before the command runs.
type JobSpec ¶
type JobSpec struct {
Argv []string `json:"argv"`
// Artifacts Paths to upload after success; a trailing `/` uploads every file under it.
Artifacts *[]ArtifactPath `json:"artifacts,omitempty"`
// ConcurrencyKey At most one `leased` job per key across all runs. Empty means none.
ConcurrencyKey *string `json:"concurrency_key,omitempty"`
// DependsOn Explicit dependencies by job name (ordering with no data dependency).
DependsOn *[]JobName `json:"depends_on,omitempty"`
// Env Extra environment variables (names match `EnvName`; `HOURCH_*` is reserved).
Env *map[string]string `json:"env,omitempty"`
// Image Container image; empty runs the job as a process. Only assigned to workers with capability `docker`.
Image *string `json:"image,omitempty"`
Inputs *[]JobInput `json:"inputs,omitempty"`
MaxAttempts *int `json:"max_attempts,omitempty"`
// Name Unique within a run, e.g. `build` or `build:hello`.
Name JobName `json:"name"`
// Secrets Names of run secrets exposed to this job as environment variables.
Secrets *[]SecretName `json:"secrets,omitempty"`
// Tags A worker can take the job when its tags are a superset. Zero tags means any worker.
Tags *Tags `json:"tags,omitempty"`
// TimeoutSeconds Omitted means `limits.default_timeout` (2h).
TimeoutSeconds *int `json:"timeout_seconds,omitempty"`
// Workdir Working directory relative to the unpacked context. Empty is the context root.
Workdir *string `json:"workdir,omitempty"`
}
JobSpec One job as submitted. `argv` and `env` values may contain `${outputs.<job>.<key>}` placeholders, substituted when the job becomes `ready`.
type JobSummary ¶
type JobSummary struct {
// Attempt Attempts started so far (0 before the first assignment).
Attempt int `json:"attempt"`
CreatedAt time.Time `json:"created_at"`
// DependsOn Effective dependencies by job name (explicit, inputs and output references).
DependsOn []JobName `json:"depends_on"`
// Error Empty on success. Server-set reasons: `timeout`, `lease_expired`,
// `accept_timeout`, `missing_output`, `secret_unavailable`,
// `dependency_failed`, `cancelled`, `exit_code`, `no_worker`; otherwise the
// worker's `result.error` text. `secret_unavailable`: the run's
// stored secrets could not be read when the job was due to start,
// almost always because hourchd restarted (the key lives only in
// its memory); hourchd fails such `pending`/`ready` jobs at startup.
// Retry the run with the values, or re-run the workflow binary.
// `no_worker`: the job stayed `ready` with no connected worker
// (idle or busy) able to run it for `dispatch.unschedulable_timeout`
// (30m); a busy fleet never trips it.
Error string `json:"error"`
ExitCode *int `json:"exit_code"`
FinishedAt *time.Time `json:"finished_at"`
// Id ULID (Crockford base32, upper case).
Id Ulid `json:"id"`
MaxAttempts int `json:"max_attempts"`
// Name Unique within a run, e.g. `build` or `build:hello`.
Name JobName `json:"name"`
ReadyAt *time.Time `json:"ready_at"`
// RunId ULID (Crockford base32, upper case).
RunId Ulid `json:"run_id"`
StartedAt *time.Time `json:"started_at"`
Status JobStatus `json:"status"`
// Tags A worker can take the job when its tags are a superset. Zero tags means any worker.
Tags Tags `json:"tags"`
// Worker Worker id holding or last holding the lease; empty if never assigned.
Worker string `json:"worker"`
}
JobSummary defines model for JobSummary.
type KeyRequestDiscovery ¶ added in v0.2.0
type KeyRequestDiscovery struct {
// RequestUrl Absolute `http` or `https` URL where a key request is filed with
// `POST`.
RequestUrl string `json:"request_url"`
}
KeyRequestDiscovery defines model for KeyRequestDiscovery.
type ListBuildsParams ¶
type ListBuildsParams struct {
Type *BuildType `form:"type,omitempty" json:"type,omitempty"`
Flavour *Flavour `form:"flavour,omitempty" json:"flavour,omitempty"`
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
}
ListBuildsParams defines parameters for ListBuilds.
type ListBuildsResponse ¶
type ListBuildsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]Build
JSON400 *BadRequest
JSON401 *Unauthorized
JSON403 *Forbidden
}
func ParseListBuildsResponse ¶
func ParseListBuildsResponse(rsp *http.Response) (*ListBuildsResponse, error)
ParseListBuildsResponse parses an HTTP response from a ListBuildsWithResponse call
func (ListBuildsResponse) Status ¶
func (r ListBuildsResponse) Status() string
Status returns HTTPResponse.Status
func (ListBuildsResponse) StatusCode ¶
func (r ListBuildsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ListJobArtifactsResponse ¶
type ListJobArtifactsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]Artifact
JSON401 *Unauthorized
JSON403 *Forbidden
JSON404 *NotFound
}
func ParseListJobArtifactsResponse ¶
func ParseListJobArtifactsResponse(rsp *http.Response) (*ListJobArtifactsResponse, error)
ParseListJobArtifactsResponse parses an HTTP response from a ListJobArtifactsWithResponse call
func (ListJobArtifactsResponse) Status ¶
func (r ListJobArtifactsResponse) Status() string
Status returns HTTPResponse.Status
func (ListJobArtifactsResponse) StatusCode ¶
func (r ListJobArtifactsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ListRunsParams ¶
type ListRunsParams struct {
Workflow *WorkflowName `form:"workflow,omitempty" json:"workflow,omitempty"`
Status *RunStatus `form:"status,omitempty" json:"status,omitempty"`
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
// Before Return runs whose id sorts before this run id.
Before *Ulid `form:"before,omitempty" json:"before,omitempty"`
}
ListRunsParams defines parameters for ListRuns.
type ListRunsResponse ¶
type ListRunsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]RunSummary
JSON400 *BadRequest
JSON401 *Unauthorized
JSON403 *Forbidden
}
func ParseListRunsResponse ¶
func ParseListRunsResponse(rsp *http.Response) (*ListRunsResponse, error)
ParseListRunsResponse parses an HTTP response from a ListRunsWithResponse call
func (ListRunsResponse) Status ¶
func (r ListRunsResponse) Status() string
Status returns HTTPResponse.Status
func (ListRunsResponse) StatusCode ¶
func (r ListRunsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ListWorkersResponse ¶
type ListWorkersResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]Worker
JSON401 *Unauthorized
JSON403 *Forbidden
}
func ParseListWorkersResponse ¶
func ParseListWorkersResponse(rsp *http.Response) (*ListWorkersResponse, error)
ParseListWorkersResponse parses an HTTP response from a ListWorkersWithResponse call
func (ListWorkersResponse) Status ¶
func (r ListWorkersResponse) Status() string
Status returns HTTPResponse.Status
func (ListWorkersResponse) StatusCode ¶
func (r ListWorkersResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type LogChunkEvent ¶
type LogChunkEvent struct {
// Data UTF-8 text, secrets redacted.
Data string `json:"data"`
// Offset Byte offset in the attempt's log after this chunk; also the SSE `id`.
Offset int64 `json:"offset"`
Stream LogStream `json:"stream"`
}
LogChunkEvent defines model for LogChunkEvent.
type LogEndEvent ¶
type LogEndEvent struct {
ExitCode *int `json:"exit_code"`
// Offset Final byte length of the attempt's log.
Offset int64 `json:"offset"`
Status JobStatus `json:"status"`
}
LogEndEvent defines model for LogEndEvent.
type LogStreamEvent ¶
type LogStreamEvent struct {
// contains filtered or unexported fields
}
LogStreamEvent One `data` payload on `GET /v1/jobs/{id}/log/stream`; the SSE `event` name (`log` or `end`) says which.
func (LogStreamEvent) AsLogChunkEvent ¶
func (t LogStreamEvent) AsLogChunkEvent() (LogChunkEvent, error)
AsLogChunkEvent returns the union data inside the LogStreamEvent as a LogChunkEvent
func (LogStreamEvent) AsLogEndEvent ¶
func (t LogStreamEvent) AsLogEndEvent() (LogEndEvent, error)
AsLogEndEvent returns the union data inside the LogStreamEvent as a LogEndEvent
func (*LogStreamEvent) FromLogChunkEvent ¶
func (t *LogStreamEvent) FromLogChunkEvent(v LogChunkEvent) error
FromLogChunkEvent overwrites any union data inside the LogStreamEvent as the provided LogChunkEvent
func (*LogStreamEvent) FromLogEndEvent ¶
func (t *LogStreamEvent) FromLogEndEvent(v LogEndEvent) error
FromLogEndEvent overwrites any union data inside the LogStreamEvent as the provided LogEndEvent
func (LogStreamEvent) MarshalJSON ¶
func (t LogStreamEvent) MarshalJSON() ([]byte, error)
func (*LogStreamEvent) MergeLogChunkEvent ¶
func (t *LogStreamEvent) MergeLogChunkEvent(v LogChunkEvent) error
MergeLogChunkEvent performs a merge with any union data inside the LogStreamEvent, using the provided LogChunkEvent
func (*LogStreamEvent) MergeLogEndEvent ¶
func (t *LogStreamEvent) MergeLogEndEvent(v LogEndEvent) error
MergeLogEndEvent performs a merge with any union data inside the LogStreamEvent, using the provided LogEndEvent
func (*LogStreamEvent) UnmarshalJSON ¶
func (t *LogStreamEvent) UnmarshalJSON(b []byte) error
type NextCounterResponse ¶
type NextCounterResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Counter
JSON400 *BadRequest
JSON401 *Unauthorized
JSON403 *Forbidden
}
func ParseNextCounterResponse ¶
func ParseNextCounterResponse(rsp *http.Response) (*NextCounterResponse, error)
ParseNextCounterResponse parses an HTTP response from a NextCounterWithResponse call
func (NextCounterResponse) Status ¶
func (r NextCounterResponse) Status() string
Status returns HTTPResponse.Status
func (NextCounterResponse) StatusCode ¶
func (r NextCounterResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PersonalKeysStatus ¶ added in v0.3.0
type PersonalKeysStatus struct {
// AgeSeconds Age of the live list; absent when origin is none
AgeSeconds *int `json:"age_seconds,omitempty"`
CacheFailing bool `json:"cache_failing"`
Entries int `json:"entries"`
// LastError The latest pull error, made safe (printable, at most 200 characters); absent when the latest pull succeeded
LastError *string `json:"last_error,omitempty"`
// LastSuccess Last good pull in this process; absent if none
LastSuccess *time.Time `json:"last_success,omitempty"`
// ListTime When the live list was last known good; absent when origin is none
ListTime *time.Time `json:"list_time,omitempty"`
Origin PersonalKeysStatusOrigin `json:"origin"`
}
PersonalKeysStatus defines model for PersonalKeysStatus.
type PersonalKeysStatusOrigin ¶ added in v0.3.0
type PersonalKeysStatusOrigin string
PersonalKeysStatusOrigin defines model for PersonalKeysStatus.Origin.
const ( Cache PersonalKeysStatusOrigin = "cache" None PersonalKeysStatusOrigin = "none" Provider PersonalKeysStatusOrigin = "provider" )
Defines values for PersonalKeysStatusOrigin.
type PutBuildJSONRequestBody ¶
type PutBuildJSONRequestBody = BuildBody
PutBuildJSONRequestBody defines body for PutBuild for application/json ContentType.
type PutBuildResponse ¶
type PutBuildResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Build
JSON400 *BadRequest
JSON401 *Unauthorized
JSON403 *Forbidden
JSON413 *TooLarge
}
func ParsePutBuildResponse ¶
func ParsePutBuildResponse(rsp *http.Response) (*PutBuildResponse, error)
ParsePutBuildResponse parses an HTTP response from a PutBuildWithResponse call
func (PutBuildResponse) Status ¶
func (r PutBuildResponse) Status() string
Status returns HTTPResponse.Status
func (PutBuildResponse) StatusCode ¶
func (r PutBuildResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PutWorkerJobArtifactParams ¶
type PutWorkerJobArtifactParams struct {
// XSha256 Hex SHA-256 of the body.
XSha256 Sha256 `json:"X-Sha256"`
}
PutWorkerJobArtifactParams defines parameters for PutWorkerJobArtifact.
type PutWorkerJobArtifactResponse ¶
type PutWorkerJobArtifactResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Artifact
JSON400 *BadRequest
JSON401 *Unauthorized
JSON403 *Forbidden
JSON409 *NotLeased
JSON413 *TooLarge
JSON503 *Unavailable
}
func ParsePutWorkerJobArtifactResponse ¶
func ParsePutWorkerJobArtifactResponse(rsp *http.Response) (*PutWorkerJobArtifactResponse, error)
ParsePutWorkerJobArtifactResponse parses an HTTP response from a PutWorkerJobArtifactWithResponse call
func (PutWorkerJobArtifactResponse) Status ¶
func (r PutWorkerJobArtifactResponse) Status() string
Status returns HTTPResponse.Status
func (PutWorkerJobArtifactResponse) StatusCode ¶
func (r PutWorkerJobArtifactResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type ResyncEvent ¶
type ResyncEvent struct {
Seq int64 `json:"seq"`
Type ResyncEventType `json:"type"`
}
ResyncEvent The requested `Last-Event-ID` is no longer in the ring; re-read the list routes.
type ResyncEventType ¶
type ResyncEventType string
ResyncEventType defines model for ResyncEvent.Type.
const (
Resync ResyncEventType = "resync"
)
Defines values for ResyncEventType.
type RetryRequest ¶
type RetryRequest struct {
// Secrets Secret name → value. Overrides the original run's stored values;
// required for every secret a job needs once the stored secrets are
// gone (after an hourchd restart). Never returned.
Secrets *map[string]string `json:"secrets,omitempty"`
}
RetryRequest defines model for RetryRequest.
type RetryRunJSONRequestBody ¶
type RetryRunJSONRequestBody = RetryRequest
RetryRunJSONRequestBody defines body for RetryRun for application/json ContentType.
type RetryRunResponse ¶
type RetryRunResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *Run
JSON400 *BadRequest
JSON401 *Unauthorized
JSON403 *Forbidden
JSON404 *NotFound
JSON422 *Unprocessable
JSON503 *Unavailable
}
func ParseRetryRunResponse ¶
func ParseRetryRunResponse(rsp *http.Response) (*RetryRunResponse, error)
ParseRetryRunResponse parses an HTTP response from a RetryRunWithResponse call
func (RetryRunResponse) Status ¶
func (r RetryRunResponse) Status() string
Status returns HTTPResponse.Status
func (RetryRunResponse) StatusCode ¶
func (r RetryRunResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type Run ¶
type Run struct {
// ContextRef `sha256:<hex>`, or empty when the run has no context.
ContextRef string `json:"context_ref"`
CreatedAt time.Time `json:"created_at"`
FinishedAt *time.Time `json:"finished_at"`
// Id ULID (Crockford base32, upper case).
Id Ulid `json:"id"`
// JobCounts Number of jobs in each status.
JobCounts JobCounts `json:"job_counts"`
// Jobs In submission order.
Jobs []JobSummary `json:"jobs"`
// Number Sequential per workflow, from 1.
Number int64 `json:"number"`
Params map[string]string `json:"params"`
// SecretNames Names of the secrets submitted with the run (values are never returned).
SecretNames []SecretName `json:"secret_names"`
Status RunStatus `json:"status"`
// SubmittedBy Name of the submitter token.
SubmittedBy string `json:"submitted_by"`
Workflow WorkflowName `json:"workflow"`
}
Run defines model for Run.
type RunEvent ¶
type RunEvent struct {
Run RunSummary `json:"run"`
Seq int64 `json:"seq"`
Type RunEventType `json:"type"`
}
RunEvent defines model for RunEvent.
type RunEventType ¶
type RunEventType string
RunEventType defines model for RunEvent.Type.
const (
RunEventTypeRun RunEventType = "run"
)
Defines values for RunEventType.
type RunSubmission ¶
type RunSubmission struct {
// ContextRef Omitted means jobs start in an empty workdir.
ContextRef *ContextRef `json:"context_ref,omitempty"`
Jobs []JobSpec `json:"jobs"`
// Params Free-form run parameters, shown in the UI.
Params *map[string]string `json:"params,omitempty"`
// Secrets Secret name → value. Write-only; never returned. Keys match `SecretName`.
Secrets *map[string]string `json:"secrets,omitempty"`
Workflow WorkflowName `json:"workflow"`
}
RunSubmission defines model for RunSubmission.
type RunSummary ¶
type RunSummary struct {
CreatedAt time.Time `json:"created_at"`
FinishedAt *time.Time `json:"finished_at"`
// Id ULID (Crockford base32, upper case).
Id Ulid `json:"id"`
// JobCounts Number of jobs in each status.
JobCounts JobCounts `json:"job_counts"`
// Number Sequential per workflow, from 1.
Number int64 `json:"number"`
Params map[string]string `json:"params"`
Status RunStatus `json:"status"`
// SubmittedBy Name of the submitter token.
SubmittedBy string `json:"submitted_by"`
Workflow WorkflowName `json:"workflow"`
}
RunSummary defines model for RunSummary.
type SecretName ¶
type SecretName = string
SecretName Also the environment variable name the job sees.
type Stats ¶
type Stats struct {
// DispatchLatencyMs `ready` → `assign` latency over the last hour; null with no assignments.
DispatchLatencyMs *LatencyMs `json:"dispatch_latency_ms"`
JobsLeased int `json:"jobs_leased"`
JobsReady int `json:"jobs_ready"`
// OldestReadyAgeSeconds Age of the oldest `ready` job; null when none.
OldestReadyAgeSeconds *int `json:"oldest_ready_age_seconds"`
PersonalKeys *PersonalKeysStatus `json:"personal_keys,omitempty"`
Powerwarden StatsPowerwarden `json:"powerwarden"`
// RunsHoldingSecrets Runs whose stored secrets exist now (any status: a failed or
// cancelled run keeps them for a retry). An hourchd restart loses
// them; check this before restarting.
RunsHoldingSecrets int `json:"runs_holding_secrets"`
RunsRunning int `json:"runs_running"`
// UnschedulableReady `ready` jobs that no connected worker (idle or busy) can run now.
// Such a job fails `no_worker` once this has lasted
// `dispatch.unschedulable_timeout`.
UnschedulableReady int `json:"unschedulable_ready"`
WorkersConnected int `json:"workers_connected"`
WorkersConnectedByTag map[string]int `json:"workers_connected_by_tag"`
}
Stats defines model for Stats.
type StatsPowerwarden ¶
type StatsPowerwarden string
StatsPowerwarden defines model for Stats.Powerwarden.
const ( Connected StatsPowerwarden = "connected" Disabled StatsPowerwarden = "disabled" Unreachable StatsPowerwarden = "unreachable" )
Defines values for StatsPowerwarden.
type StreamEventsParams ¶
type StreamEventsParams struct {
// LastEventID The `seq` of the last event the client saw; resume after it.
LastEventID *int64 `json:"Last-Event-ID,omitempty"`
}
StreamEventsParams defines parameters for StreamEvents.
type StreamEventsResponse ¶
type StreamEventsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON401 *Unauthorized
JSON403 *Forbidden
}
func ParseStreamEventsResponse ¶
func ParseStreamEventsResponse(rsp *http.Response) (*StreamEventsResponse, error)
ParseStreamEventsResponse parses an HTTP response from a StreamEventsWithResponse call
func (StreamEventsResponse) Status ¶
func (r StreamEventsResponse) Status() string
Status returns HTTPResponse.Status
func (StreamEventsResponse) StatusCode ¶
func (r StreamEventsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type StreamJobLogParams ¶
type StreamJobLogParams struct {
// Attempt Attempt number (1-based). Omitted means the latest attempt.
Attempt *Attempt `form:"attempt,omitempty" json:"attempt,omitempty"`
// LastEventID The `offset` of the last chunk the client saw; resume after it.
LastEventID *int64 `json:"Last-Event-ID,omitempty"`
}
StreamJobLogParams defines parameters for StreamJobLog.
type StreamJobLogResponse ¶
type StreamJobLogResponse struct {
Body []byte
HTTPResponse *http.Response
JSON401 *Unauthorized
JSON403 *Forbidden
JSON404 *NotFound
}
func ParseStreamJobLogResponse ¶
func ParseStreamJobLogResponse(rsp *http.Response) (*StreamJobLogResponse, error)
ParseStreamJobLogResponse parses an HTTP response from a StreamJobLogWithResponse call
func (StreamJobLogResponse) Status ¶
func (r StreamJobLogResponse) Status() string
Status returns HTTPResponse.Status
func (StreamJobLogResponse) StatusCode ¶
func (r StreamJobLogResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type SubmitRunJSONRequestBody ¶
type SubmitRunJSONRequestBody = RunSubmission
SubmitRunJSONRequestBody defines body for SubmitRun for application/json ContentType.
type SubmitRunParams ¶
type SubmitRunParams struct {
// ValidateOnly Check the submission without storing anything (a server-side dry run).
ValidateOnly *bool `form:"validate_only,omitempty" json:"validate_only,omitempty"`
}
SubmitRunParams defines parameters for SubmitRun.
type SubmitRunResponse ¶
type SubmitRunResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *ValidationResult
JSON201 *Run
JSON400 *BadRequest
JSON401 *Unauthorized
JSON403 *Forbidden
JSON422 *Unprocessable
JSON500 *Internal
JSON503 *Unavailable
}
func ParseSubmitRunResponse ¶
func ParseSubmitRunResponse(rsp *http.Response) (*SubmitRunResponse, error)
ParseSubmitRunResponse parses an HTTP response from a SubmitRunWithResponse call
func (SubmitRunResponse) Status ¶
func (r SubmitRunResponse) Status() string
Status returns HTTPResponse.Status
func (SubmitRunResponse) StatusCode ¶
func (r SubmitRunResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type Tags ¶
type Tags = []Tag
Tags A worker can take the job when its tags are a superset. Zero tags means any worker.
type UploadContextParams ¶
type UploadContextParams struct {
// XSha256 Hex SHA-256 of the body; checked when present.
XSha256 *XSha256Optional `json:"X-Sha256,omitempty"`
}
UploadContextParams defines parameters for UploadContext.
type UploadContextResponse ¶
type UploadContextResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *ContextUpload
JSON201 *ContextUpload
JSON400 *BadRequest
JSON401 *Unauthorized
JSON403 *Forbidden
JSON413 *TooLarge
JSON500 *Internal
JSON503 *Unavailable
}
func ParseUploadContextResponse ¶
func ParseUploadContextResponse(rsp *http.Response) (*UploadContextResponse, error)
ParseUploadContextResponse parses an HTTP response from a UploadContextWithResponse call
func (UploadContextResponse) Status ¶
func (r UploadContextResponse) Status() string
Status returns HTTPResponse.Status
func (UploadContextResponse) StatusCode ¶
func (r UploadContextResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ValidationResult ¶
type ValidationResult struct {
// Valid Always true (an invalid submission is a 4xx `Error`).
Valid bool `json:"valid"`
}
ValidationResult Answer of `POST /v1/runs?validate_only=true` when the submission is valid.
type Worker ¶
type Worker struct {
Capabilities []WorkerCapabilities `json:"capabilities"`
Connected bool `json:"connected"`
CurrentJob *Ulid `json:"current_job"`
// Hostname Equals powermaster's hostname for the host.
Hostname string `json:"hostname"`
Id string `json:"id"`
LastSeen time.Time `json:"last_seen"`
// Tags A worker can take the job when its tags are a superset. Zero tags means any worker.
Tags Tags `json:"tags"`
}
Worker defines model for Worker.
type WorkerCapabilities ¶
type WorkerCapabilities string
WorkerCapabilities defines model for Worker.Capabilities.
const (
Docker WorkerCapabilities = "docker"
)
Defines values for WorkerCapabilities.
type WorkerEvent ¶
type WorkerEvent struct {
Seq int64 `json:"seq"`
Type WorkerEventType `json:"type"`
Worker Worker `json:"worker"`
}
WorkerEvent defines model for WorkerEvent.
type WorkerEventType ¶
type WorkerEventType string
WorkerEventType defines model for WorkerEvent.Type.
const (
WorkerEventTypeWorker WorkerEventType = "worker"
)
Defines values for WorkerEventType.
type XSha256Optional ¶
type XSha256Optional = Sha256
XSha256Optional defines model for XSha256Optional.