Documentation ¶
Overview ¶
Package plank provides a simple read-only client for the Logkeeper REST API.
Index ¶
- type Build
- type LogkeeperClient
- func (c *LogkeeperClient) GetBuildMetadata(ctx context.Context, buildID string) (Build, error)
- func (c *LogkeeperClient) GetTestMetadata(ctx context.Context, buildID, testID string) (Test, error)
- func (c *LogkeeperClient) StreamAllLogs(ctx context.Context, buildID string) (io.ReadCloser, error)
- func (c *LogkeeperClient) StreamTestLogs(ctx context.Context, buildID, testID string) (io.ReadCloser, error)
- type NewLogkeeperClientOptions
- type Test
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Build ¶
type Build struct { ID string `json:"id"` Builder string `json:"builder"` BuildNum int `json:"buildnum"` TaskID string `json:"task_id"` TaskExecution int `json:"execution"` Tests []Test `json:"tests"` }
Build is the API model representing metadata of a Logkeeper build.
type LogkeeperClient ¶
type LogkeeperClient struct {
// contains filtered or unexported fields
}
LogkeeperClient is a simple read-only API client for the Logkeeper service.
func NewLogkeeperClient ¶
func NewLogkeeperClient(opts NewLogkeeperClientOptions) *LogkeeperClient
NewLogkeeperClient returns a new Logkeeper client with the given options.
func (*LogkeeperClient) GetBuildMetadata ¶
GetBuildMetadata returns the metadata for the given Logkeeper build ID.
func (*LogkeeperClient) GetTestMetadata ¶
func (c *LogkeeperClient) GetTestMetadata(ctx context.Context, buildID, testID string) (Test, error)
GetTestMetadata returns the metadata for the given Logkeeper test ID.
func (*LogkeeperClient) StreamAllLogs ¶
func (c *LogkeeperClient) StreamAllLogs(ctx context.Context, buildID string) (io.ReadCloser, error)
StreamAllLogs returns a stream of all logs from the given Logkeeper build ID. It is the responsibility of the caller to close the stream.
func (*LogkeeperClient) StreamTestLogs ¶
func (c *LogkeeperClient) StreamTestLogs(ctx context.Context, buildID, testID string) (io.ReadCloser, error)
StreamTestLogs returns a stream of the logs from the given Logkeeper build ID and test ID. It is the responsibility of the caller to close the stream.
type NewLogkeeperClientOptions ¶
type NewLogkeeperClientOptions struct { // BaseURL is the base URL of the Logkeeper service. Defaults to // `https://logkeeper2.build.10gen.cc`. BaseURL string // HTTPClient is the underlying HTTP client for making requests to the // Logkeeper service. Optional. HTTPClient *http.Client }
NewLogkeeperClientOptions specify the arguments for creating a new Logkeeper client.
type Test ¶
type Test struct { ID string `json:"id"` Name string `json:"name"` BuildID string `json:"build_id"` TaskID string `json:"task_id"` TaskExecution int `json:"execution"` Phase string `json:"phase"` Command string `json:"command"` }
Test is the API model representing metadata of a Logkeeper test.