Documentation ¶
Overview ¶
Package workerclient provides a way to communicate with a Wharf worker server.
Index ¶
- type ArtifactEvent
- type ArtifactEventsRequest
- type Client
- func (c *Client) BuildID() uint
- func (c *Client) Close() error
- func (c *Client) DownloadArtifact(ctx context.Context, artifactID uint) (io.ReadCloser, error)
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) StreamArtifactEvents(ctx context.Context, req *ArtifactEventsRequest, opts ...grpc.CallOption) (v1.Worker_StreamArtifactEventsClient, error)
- func (c *Client) StreamLogs(ctx context.Context, req *LogsRequest, opts ...grpc.CallOption) (v1.Worker_StreamLogsClient, error)
- func (c *Client) StreamStatusEvents(ctx context.Context, req *StatusEventsRequest, opts ...grpc.CallOption) (v1.Worker_StreamStatusEventsClient, error)
- type LogLine
- type LogsRequest
- type Options
- type StatusEvent
- type StatusEventsRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArtifactEvent ¶
type ArtifactEvent = v1.StreamArtifactEventsResponse
ArtifactEvent is an alias for workerapi/v1.StreamArtifactEventsResponse.
type ArtifactEventsRequest ¶
type ArtifactEventsRequest = v1.StreamArtifactEventsRequest
ArtifactEventsRequest is an alias for workerapi/v1.StreamArtifactEventsResponse.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a HTTP (gRPC & REST) client that talks to wharf-cmd-worker. A new instance should be created via New to initiate it correctly.
func New ¶
New creates a new client that can communicate with a Wharf worker server.
Implements the Closer interface.
func (*Client) BuildID ¶
BuildID returns the worker's build ID. The value zero means the worker does not have an assigned build ID.
func (*Client) Close ¶
Close will terminate all active connections. Currently only gRPC streams are affected.
func (*Client) DownloadArtifact ¶
DownloadArtifact will open a stream to download an artifact BLOB.
func (*Client) StreamArtifactEvents ¶
func (c *Client) StreamArtifactEvents(ctx context.Context, req *ArtifactEventsRequest, opts ...grpc.CallOption) (v1.Worker_StreamArtifactEventsClient, error)
StreamArtifactEvents returns a stream that will receive status events from the worker.
func (*Client) StreamLogs ¶
func (c *Client) StreamLogs(ctx context.Context, req *LogsRequest, opts ...grpc.CallOption) (v1.Worker_StreamLogsClient, error)
StreamLogs returns a stream that will receive log lines from the worker.
func (*Client) StreamStatusEvents ¶
func (c *Client) StreamStatusEvents(ctx context.Context, req *StatusEventsRequest, opts ...grpc.CallOption) (v1.Worker_StreamStatusEventsClient, error)
StreamStatusEvents returns a stream that will receive status events from the worker.
type LogLine ¶
type LogLine = v1.StreamLogsResponse
LogLine is an alias for workerapi/v1.StreamLogsResponse.
type LogsRequest ¶
type LogsRequest = v1.StreamLogsRequest
LogsRequest is an alias for workerapi/v1.StreamLogsRequest.
type Options ¶
type Options struct { // InsecureSkipVerify disables cert verification if set to true. // // Should NOT be true in a production environment. InsecureSkipVerify bool // BuildID is the ID of the build from wharf-api. BuildID uint }
Options contains options that can be used in the creation of a new client.
type StatusEvent ¶
type StatusEvent = v1.StreamStatusEventsResponse
StatusEvent is an alias for workerapi/v1.StreamStatusEventsResponse.
type StatusEventsRequest ¶
type StatusEventsRequest = v1.StreamStatusEventsRequest
StatusEventsRequest is an alias for workerapi/v1.StreamStatusEventsRequest.