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 ¶
- func NewAgentAPIPingRequest(server string) (*http.Request, error)
- func NewAgentCheckinRequest(server string, body AgentCheckinJSONRequestBody) (*http.Request, error)
- func NewAgentCheckinRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewHealthRequest(server string) (*http.Request, error)
- type AgentAPIPingResponse
- type AgentCheckinInput
- type AgentCheckinJSONRequestBody
- type AgentCheckinOutput
- type AgentCheckinResponse
- type Client
- func (c *Client) AgentAPIPing(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) AgentCheckin(ctx context.Context, body AgentCheckinJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) AgentCheckinWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) Health(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) AgentAPIPingWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*AgentAPIPingResponse, error)
- func (c *ClientWithResponses) AgentCheckinWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*AgentCheckinResponse, error)
- func (c *ClientWithResponses) AgentCheckinWithResponse(ctx context.Context, body AgentCheckinJSONRequestBody, ...) (*AgentCheckinResponse, error)
- func (c *ClientWithResponses) HealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthResponse, error)
- type ClientWithResponsesInterface
- type EnvironmentVariable
- type HealthResponse
- type HttpRequestDoer
- type PoolLabel
- type RequestEditorFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAgentAPIPingRequest ¶
NewAgentAPIPingRequest constructs an http.Request for the AgentAPIPing method
func NewAgentCheckinRequest ¶ added in v1.0.0
func NewAgentCheckinRequest(server string, body AgentCheckinJSONRequestBody) (*http.Request, error)
NewAgentCheckinRequest calls the generic AgentCheckin builder with application/json body
Types ¶
type AgentAPIPingResponse ¶
func ParseAgentAPIPingResponse ¶
func ParseAgentAPIPingResponse(rsp *http.Response) (*AgentAPIPingResponse, error)
ParseAgentAPIPingResponse parses an HTTP response from a AgentAPIPingWithResponse call
func (AgentAPIPingResponse) ContentType ¶ added in v1.2.0
func (r AgentAPIPingResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (AgentAPIPingResponse) GetBody ¶ added in v1.2.0
func (r AgentAPIPingResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (AgentAPIPingResponse) Status ¶
func (r AgentAPIPingResponse) Status() string
Status returns HTTPResponse.Status
func (AgentAPIPingResponse) StatusCode ¶
func (r AgentAPIPingResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type AgentCheckinInput ¶ added in v1.0.0
type AgentCheckinInput struct {
AgentID *string `json:"agentID,omitempty"`
AgentVersion *string `json:"agentVersion,omitempty"`
// Paused Self-reported quiesced acknowledgement. A pause-aware agent sets
// this to true only once it has observed the pause and its in-flight
// worker has exited (it is in the paused sleep loop). It is
// level-triggered — sent on every checkin while quiesced — and the
// server records it only while the agent is actually paused, so a
// stale ack racing an unpause is ignored. Optional: absent means the
// agent has not acknowledged quiescing.
Paused *bool `json:"paused,omitempty"`
PoolLabels *[]PoolLabel `json:"poolLabels,omitempty"`
}
AgentCheckinInput defines model for agentCheckinInput.
type AgentCheckinJSONRequestBody ¶ added in v1.0.0
type AgentCheckinJSONRequestBody = AgentCheckinInput
AgentCheckinJSONRequestBody defines body for AgentCheckin for application/json ContentType.
type AgentCheckinOutput ¶ added in v1.0.0
type AgentCheckinOutput struct {
AuthToken *string `json:"authToken,omitempty"`
// PauseReason The reason recorded with the pause, for the host operator's logs. Present only when paused and a reason was given.
PauseReason *string `json:"pauseReason,omitempty"`
// Paused True when the agent is paused and must not launch workers: it
// should log the pause, skip launching, and keep checking in on its
// existing cadence until this clears. A paused checkin is still a
// successful checkin and must not count toward the agent's max-error
// process exit. Optional — absent or false means run normally, so an
// older agent binary talking to this API (or a newer agent talking
// to an older API) safely defaults to running.
Paused *bool `json:"paused,omitempty"`
// PausedAt When the pause was set. Present only when paused.
PausedAt *time.Time `json:"pausedAt,omitempty"`
// PausedBy Who set the pause (email, or client identity for machine tokens). Present only when paused.
PausedBy *string `json:"pausedBy,omitempty"`
RequiredAgentVersion *string `json:"requiredAgentVersion,omitempty"`
WorkerEnvironmentVariables *[]EnvironmentVariable `json:"workerEnvironmentVariables,omitempty"`
WorkerImageURI *string `json:"workerImageURI,omitempty"`
}
AgentCheckinOutput defines model for agentCheckinOutput.
type AgentCheckinResponse ¶ added in v1.0.0
type AgentCheckinResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *AgentCheckinOutput
}
func ParseAgentCheckinResponse ¶ added in v1.0.0
func ParseAgentCheckinResponse(rsp *http.Response) (*AgentCheckinResponse, error)
ParseAgentCheckinResponse parses an HTTP response from a AgentCheckinWithResponse call
func (AgentCheckinResponse) ContentType ¶ added in v1.2.0
func (r AgentCheckinResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (AgentCheckinResponse) GetBody ¶ added in v1.2.0
func (r AgentCheckinResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (AgentCheckinResponse) GetJSON200 ¶ added in v1.2.0
func (r AgentCheckinResponse) GetJSON200() *AgentCheckinOutput
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (AgentCheckinResponse) Status ¶ added in v1.0.0
func (r AgentCheckinResponse) Status() string
Status returns HTTPResponse.Status
func (AgentCheckinResponse) StatusCode ¶ added in v1.0.0
func (r AgentCheckinResponse) 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) AgentAPIPing ¶
func (c *Client) AgentAPIPing(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
AgentAPIPing performs a GET /agentapiping (the `AgentAPIPing` operationId) request.
Used for testing, to validate the specific existence of the Agent API
func (*Client) AgentCheckin ¶ added in v1.0.0
func (c *Client) AgentCheckin(ctx context.Context, body AgentCheckinJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
AgentCheckin performs a POST /agent/checkin (the `AgentCheckin` operationId) request. Takes a body of the `application/json` content type.
Startup endpoint for agents.
func (*Client) AgentCheckinWithBody ¶ added in v1.0.0
func (c *Client) AgentCheckinWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
AgentCheckinWithBody performs a POST /agent/checkin (the `AgentCheckin` operationId) request, with any type of body and a specified content type.
Startup endpoint for agents.
type ClientInterface ¶
type ClientInterface interface {
// AgentCheckinWithBody performs a POST /agent/checkin (the `AgentCheckin` operationId) request,
// with any type of body and a specified content type.
//
// Startup endpoint for agents.
AgentCheckinWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// AgentCheckin performs a POST /agent/checkin (the `AgentCheckin` operationId) request.
// Takes a body of the `application/json` content type.
//
// Startup endpoint for agents.
AgentCheckin(ctx context.Context, body AgentCheckinJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// AgentAPIPing performs a GET /agentapiping (the `AgentAPIPing` operationId) request.
//
// Used for testing, to validate the specific existence of the Agent API
AgentAPIPing(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// Health performs a GET /health (the `Health` operationId) request.
//
// Returns whether the service is healthy or not.
Health(ctx context.Context, 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) AgentAPIPingWithResponse ¶
func (c *ClientWithResponses) AgentAPIPingWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*AgentAPIPingResponse, error)
AgentAPIPingWithResponse performs a GET /agentapiping (the `AgentAPIPing` operationId) request.
Used for testing, to validate the specific existence of the Agent API ¶
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) AgentCheckinWithBodyWithResponse ¶ added in v1.0.0
func (c *ClientWithResponses) AgentCheckinWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentCheckinResponse, error)
AgentCheckinWithBodyWithResponse performs a POST /agent/checkin (the `AgentCheckin` operationId) request, with any type of body and a specified content type.
Startup endpoint for agents.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) AgentCheckinWithResponse ¶ added in v1.0.0
func (c *ClientWithResponses) AgentCheckinWithResponse(ctx context.Context, body AgentCheckinJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentCheckinResponse, error)
AgentCheckinWithResponse performs a POST /agent/checkin (the `AgentCheckin` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Startup endpoint for agents.
func (*ClientWithResponses) HealthWithResponse ¶
func (c *ClientWithResponses) HealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthResponse, error)
HealthWithResponse performs a GET /health (the `Health` operationId) request.
Returns whether the service is healthy or not.
Returns a wrapper object for the known response body format(s).
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// AgentCheckinWithBodyWithResponse performs a POST /agent/checkin (the `AgentCheckin` operationId) request,
// with any type of body and a specified content type.
//
// Startup endpoint for agents.
//
// Returns a wrapper object for the known response body format(s).
AgentCheckinWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentCheckinResponse, error)
// AgentCheckinWithResponse performs a POST /agent/checkin (the `AgentCheckin` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Startup endpoint for agents.
AgentCheckinWithResponse(ctx context.Context, body AgentCheckinJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentCheckinResponse, error)
// AgentAPIPingWithResponse performs a GET /agentapiping (the `AgentAPIPing` operationId) request.
//
// Used for testing, to validate the specific existence of the Agent API
//
// Returns a wrapper object for the known response body format(s).
AgentAPIPingWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*AgentAPIPingResponse, error)
// HealthWithResponse performs a GET /health (the `Health` operationId) request.
//
// Returns whether the service is healthy or not.
//
// Returns a wrapper object for the known response body format(s).
HealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type EnvironmentVariable ¶
type EnvironmentVariable = []string
EnvironmentVariable defines model for environmentVariable.
type HealthResponse ¶
func ParseHealthResponse ¶
func ParseHealthResponse(rsp *http.Response) (*HealthResponse, error)
ParseHealthResponse parses an HTTP response from a HealthWithResponse call
func (HealthResponse) ContentType ¶ added in v1.2.0
func (r HealthResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (HealthResponse) GetBody ¶ added in v1.2.0
func (r HealthResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (HealthResponse) Status ¶
func (r HealthResponse) Status() string
Status returns HTTPResponse.Status
func (HealthResponse) StatusCode ¶
func (r HealthResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.