Documentation ¶
Index ¶
- type Agent
- type Client
- type Jobs
- func (j *Jobs) Executions(r *apimodels.ListJobExecutionsRequest) (*apimodels.ListJobExecutionsResponse, error)
- func (j *Jobs) Get(r *apimodels.GetJobRequest) (*apimodels.GetJobResponse, error)
- func (j *Jobs) History(r *apimodels.ListJobHistoryRequest) (*apimodels.ListJobHistoryResponse, error)
- func (j *Jobs) List(r *apimodels.ListJobsRequest) (*apimodels.ListJobsResponse, error)
- func (j *Jobs) Put(r *apimodels.PutJobRequest) (*apimodels.PutJobResponse, error)
- func (j *Jobs) Results(r *apimodels.ListJobResultsRequest) (*apimodels.ListJobResultsResponse, error)
- func (j *Jobs) Stop(r *apimodels.StopJobRequest) (*apimodels.StopJobResponse, error)
- type Nodes
- type OptionFn
- func WithAddress(address string) OptionFn
- func WithAppID(appID string) OptionFn
- func WithContext(ctx context.Context) OptionFn
- func WithHTTPAuth(auth *apimodels.HTTPBasicAuth) OptionFn
- func WithHTTPClient(client *http.Client) OptionFn
- func WithHeaders(headers http.Header) OptionFn
- func WithNamespace(namespace string) OptionFn
- func WithTimeout(timeout time.Duration) OptionFn
- type Options
- type UnexpectedResponseError
- func (e UnexpectedResponseError) Additional() error
- func (e UnexpectedResponseError) Body() string
- func (e UnexpectedResponseError) Error() string
- func (e UnexpectedResponseError) ExpectedStatuses() []int
- func (e UnexpectedResponseError) HasAdditional() bool
- func (e UnexpectedResponseError) HasBody() bool
- func (e UnexpectedResponseError) HasError() bool
- func (e UnexpectedResponseError) HasStatusCode() bool
- func (e UnexpectedResponseError) HasStatusText() bool
- func (e UnexpectedResponseError) StatusCode() int
- func (e UnexpectedResponseError) StatusText() string
- func (e UnexpectedResponseError) Unwrap() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
func (*Agent) Alive ¶
func (c *Agent) Alive() (*apimodels.IsAliveResponse, error)
Alive is used to check if the agent is alive.
func (*Agent) Node ¶
func (c *Agent) Node(req *apimodels.GetAgentNodeRequest) (*apimodels.GetAgentNodeResponse, error)
Node is used to get the agent node info.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type Jobs ¶
type Jobs struct {
// contains filtered or unexported fields
}
func (*Jobs) Executions ¶
func (j *Jobs) Executions(r *apimodels.ListJobExecutionsRequest) (*apimodels.ListJobExecutionsResponse, error)
Executions returns executions for a job.
func (*Jobs) Get ¶
func (j *Jobs) Get(r *apimodels.GetJobRequest) (*apimodels.GetJobResponse, error)
Get is used to get a job by ID.
func (*Jobs) History ¶
func (j *Jobs) History(r *apimodels.ListJobHistoryRequest) (*apimodels.ListJobHistoryResponse, error)
History returns history events for a job.
func (*Jobs) List ¶
func (j *Jobs) List(r *apimodels.ListJobsRequest) (*apimodels.ListJobsResponse, error)
List is used to list all jobs in the cluster.
func (*Jobs) Put ¶
func (j *Jobs) Put(r *apimodels.PutJobRequest) (*apimodels.PutJobResponse, error)
Put is used to submit a new job to the cluster, or update an existing job with matching ID.
func (*Jobs) Results ¶
func (j *Jobs) Results(r *apimodels.ListJobResultsRequest) (*apimodels.ListJobResultsResponse, error)
Results returns results for a job.
func (*Jobs) Stop ¶
func (j *Jobs) Stop(r *apimodels.StopJobRequest) (*apimodels.StopJobResponse, error)
Stop is used to stop a job by ID.
type Nodes ¶
type Nodes struct {
// contains filtered or unexported fields
}
func (*Nodes) Get ¶
func (c *Nodes) Get(r *apimodels.GetNodeRequest) (*apimodels.GetNodeResponse, error)
Get is used to get a node by ID.
func (*Nodes) List ¶
func (c *Nodes) List(r *apimodels.ListNodesRequest) (*apimodels.ListNodesResponse, error)
List is used to list all nodes in the cluster.
type OptionFn ¶
type OptionFn func(*Options)
OptionFn is a function that can be used to configure the client.
func WithAddress ¶
WithAddress sets the address of the node's public REST API.
func WithAppID ¶
WithAppID sets the optional application specific identifier appended to the User-Agent header.
func WithContext ¶
WithContext sets the default context to use for requests.
func WithHTTPAuth ¶
func WithHTTPAuth(auth *apimodels.HTTPBasicAuth) OptionFn
WithHTTPAuth sets the auth info to use for http access.
func WithHTTPClient ¶
WithHTTPClient sets the client to use. Default will be used if not provided. If set, other configuration options will be ignored, such as Timeout
func WithHeaders ¶
WithHeaders sets the headers to add to all requests.
func WithNamespace ¶
WithNamespace sets the default namespace to use for all requests.
func WithTimeout ¶
WithTimeout sets the timeout for requests.
type Options ¶
type Options struct { // Address is the address of the node's public REST API. Address string // Namespace is the default namespace to use for all requests. Namespace string // The optional application specific identifier appended to the User-Agent header. AppID string // Context is the default context to use for requests. Context context.Context // HTTPClient is the client to use. Default will be used if not provided. // If set, other configuration options will be ignored, such as Timeout HTTPClient *http.Client // HTTPAuth is the auth info to use for http access. HTTPAuth *apimodels.HTTPBasicAuth // Timeout is the timeout for requests. Timeout time.Duration // Headers is a map of headers to add to all requests. Headers http.Header }
type UnexpectedResponseError ¶
type UnexpectedResponseError struct {
// contains filtered or unexported fields
}
UnexpectedResponseError tracks the components for API errors encountered when requireOK and requireStatusIn's conditions are not met.
func (UnexpectedResponseError) Additional ¶
func (e UnexpectedResponseError) Additional() error
func (UnexpectedResponseError) Body ¶
func (e UnexpectedResponseError) Body() string
func (UnexpectedResponseError) Error ¶
func (e UnexpectedResponseError) Error() string
func (UnexpectedResponseError) ExpectedStatuses ¶
func (e UnexpectedResponseError) ExpectedStatuses() []int
func (UnexpectedResponseError) HasAdditional ¶
func (e UnexpectedResponseError) HasAdditional() bool
func (UnexpectedResponseError) HasBody ¶
func (e UnexpectedResponseError) HasBody() bool
func (UnexpectedResponseError) HasError ¶
func (e UnexpectedResponseError) HasError() bool
func (UnexpectedResponseError) HasStatusCode ¶
func (e UnexpectedResponseError) HasStatusCode() bool
func (UnexpectedResponseError) HasStatusText ¶
func (e UnexpectedResponseError) HasStatusText() bool
func (UnexpectedResponseError) StatusCode ¶
func (e UnexpectedResponseError) StatusCode() int
func (UnexpectedResponseError) StatusText ¶
func (e UnexpectedResponseError) StatusText() string
func (UnexpectedResponseError) Unwrap ¶
func (e UnexpectedResponseError) Unwrap() error