client

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2023 License: Apache-2.0, MIT Imports: 26 Imported by: 0

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

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

func ParseBuildResponse(r io.ReadCloser, progress io.Writer) (string, error)

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

func ParseRunResponse(r io.ReadCloser, progress io.Writer) (string, error)

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

func ParseTasksRequest(r io.ReadCloser, progress io.Writer) ([]*task.Task, error)

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 New

func New(cfg *config.EnvConfig) *Client

New initializes a new API client

func (*Client) Build

func (c *Client) Build(ctx context.Context, r *api.BuildRequest, plandir string, sdkdir string, extraSrcs []string) (io.ReadCloser, error)

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) Close

func (c *Client) Close() error

Close the transport used by the client

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) Run

func (c *Client) Run(ctx context.Context, r *api.RunRequest, plandir string, sdkdir string, extraSrcs []string) (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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL