Documentation ¶
Overview ¶
Package client provides a type-safe client for the Testground server.
Testground uses a client-server architecture. The Testground client talks to the Testground daemon, which builds, and runs your test plans.
The Testground client and daemon can run on the same system, or you can connect a Testground client to a remote Testground daemon.
Currently all commands to Testground, but the `daemon` command, are client-side commands.
Index ¶
- func ParseBuildPurgeResponse(r io.ReadCloser, progress io.Writer) error
- func ParseBuildResponse(r io.ReadCloser, progress io.Writer) (string, error)
- func ParseCollectResponse(r io.ReadCloser, file io.Writer, progress io.Writer) (api.CollectResponse, error)
- func ParseHealthcheckResponse(r io.ReadCloser, progress io.Writer) (api.HealthcheckResponse, error)
- func ParseLogsRequest(w io.Writer, r io.ReadCloser) (api.LogsResponse, error)
- func ParseRunResponse(r io.ReadCloser, progress io.Writer) (string, error)
- func ParseStatusResponse(r io.ReadCloser, progress io.Writer) (api.StatusResponse, error)
- func ParseTasksRequest(r io.ReadCloser, progress io.Writer) ([]*task.Task, error)
- func ParseTerminateRequest(r io.ReadCloser, progress io.Writer) error
- type Client
- func (c *Client) Build(ctx context.Context, r *api.BuildRequest, plandir string, sdkdir string, ...) (io.ReadCloser, error)
- func (c *Client) BuildPurge(ctx context.Context, r *api.BuildPurgeRequest) (io.ReadCloser, error)
- func (c *Client) Cancel(ctx context.Context, r *api.CancelRequest) (io.ReadCloser, error)
- func (c *Client) Close() error
- func (c *Client) CollectOutputs(ctx context.Context, r *api.OutputsRequest) (io.ReadCloser, error)
- func (c *Client) Healthcheck(ctx context.Context, r *api.HealthcheckRequest) (io.ReadCloser, error)
- func (c *Client) Logs(ctx context.Context, r *api.LogsRequest) (io.ReadCloser, error)
- func (c *Client) Run(ctx context.Context, r *api.RunRequest, plandir string, sdkdir string, ...) (io.ReadCloser, error)
- func (c *Client) Status(ctx context.Context, r *api.StatusRequest) (io.ReadCloser, error)
- func (c *Client) Tasks(ctx context.Context, r *api.TasksRequest) (io.ReadCloser, error)
- func (c *Client) Terminate(ctx context.Context, r *api.TerminateRequest) (io.ReadCloser, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseBuildPurgeResponse ¶ added in v0.5.3
func ParseBuildPurgeResponse(r io.ReadCloser, progress io.Writer) error
ParseBuildPurgeResponse parses a response from 'build/purge' call.
func ParseBuildResponse ¶
ParseBuildResponse parses a response from a `build` call
func ParseCollectResponse ¶
func ParseCollectResponse(r io.ReadCloser, file io.Writer, progress io.Writer) (api.CollectResponse, error)
ParseCollectResponse parses a response from a `collect` call
func ParseHealthcheckResponse ¶
func ParseHealthcheckResponse(r io.ReadCloser, progress io.Writer) (api.HealthcheckResponse, error)
ParseHealthcheckResponse parses a response from a 'healthcheck' call
func ParseLogsRequest ¶ added in v0.6.0
func ParseLogsRequest(w io.Writer, r io.ReadCloser) (api.LogsResponse, error)
ParseLogsRequest parses a response from a 'logs' call
func ParseRunResponse ¶
ParseRunResponse parses a response from a `run` call
func ParseStatusResponse ¶ added in v0.6.0
func ParseStatusResponse(r io.ReadCloser, progress io.Writer) (api.StatusResponse, error)
ParseStatusResponse parses a response from a 'status' call
func ParseTasksRequest ¶ added in v0.6.0
ParseTasksRequest parses a response from a 'task' call
func ParseTerminateRequest ¶
func ParseTerminateRequest(r io.ReadCloser, progress io.Writer) error
ParseTerminateRequest parses a response from a 'terminate' call
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the API client that performs all operations against a Testground server.
func (*Client) BuildPurge ¶ added in v0.5.3
func (c *Client) BuildPurge(ctx context.Context, r *api.BuildPurgeRequest) (io.ReadCloser, error)
BuildPurge sends a `build/purge` request to the daemon.
func (*Client) Cancel ¶ added in v0.6.0
func (c *Client) Cancel(ctx context.Context, r *api.CancelRequest) (io.ReadCloser, error)
func (*Client) CollectOutputs ¶
func (c *Client) CollectOutputs(ctx context.Context, r *api.OutputsRequest) (io.ReadCloser, error)
CollectOutputs sends a `collectOutputs` request to the daemon.
The Body in the response implement an io.ReadCloser and it's up to the caller to close it.
func (*Client) Healthcheck ¶
func (c *Client) Healthcheck(ctx context.Context, r *api.HealthcheckRequest) (io.ReadCloser, error)
Healthcheck sends a `healthcheck` request to the daemon.
func (*Client) Logs ¶ added in v0.6.0
func (c *Client) Logs(ctx context.Context, r *api.LogsRequest) (io.ReadCloser, error)
func (*Client) Status ¶ added in v0.6.0
func (c *Client) Status(ctx context.Context, r *api.StatusRequest) (io.ReadCloser, error)
func (*Client) Tasks ¶ added in v0.6.0
func (c *Client) Tasks(ctx context.Context, r *api.TasksRequest) (io.ReadCloser, error)
func (*Client) Terminate ¶
func (c *Client) Terminate(ctx context.Context, r *api.TerminateRequest) (io.ReadCloser, error)
Terminate sends a `terminate` request to the daemon.