plank

package module
v0.0.0-...-5f47f8a Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 1

README

Plank

A Logkeeper API client in Go.

Development

The Plank project uses a makefile to coordinate compilation and testing. All output from the make commands is written to the git-ignored directory build.

compile

Compiles non-test code.

test, test-<package>

Runs all tests or the tests of a specific package, sequentially.

  • If you would like to specify tests to run using a regex, set the environment variable RUN_TEST.
  • If you would like to specify a run count, set the environment variable RUN_COUNT.
  • If you would like to run the tests using the Go race detector, set the environment variable RACE_DETECTOR.
lint, lint-<package>

Installs and runs the golangci-lint linter.

mod-tidy

Runs go mod tidy.

verify-mod-tidy

Verifies that go mod tidy has been run to clean up the go.mod and go.sum files.

clean

Removes the build directory.

clean-results

Removes all of the output files from the build directory.

File tickets in JIRA with the EVG project.

Documentation

Overview

Package plank provides a simple read-only client for the Logkeeper REST API.

Index

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

func (c *LogkeeperClient) GetBuildMetadata(ctx context.Context, buildID string) (Build, error)

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.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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