buildbucket

package
v0.0.0-...-8ff35f7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package buildbucket contains logic of interacting with Buildbucket.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelBuild

func CancelBuild(c context.Context, bbid int64, reason string) (*bbpb.Build, error)

func GetBuild

func GetBuild(c context.Context, bbid int64, mask *bbpb.BuildMask) (*bbpb.Build, error)

func GetBuildTaskDimension

func GetBuildTaskDimension(ctx context.Context, bbid int64) (*pb.Dimensions, error)

func MockGetBuild

func MockGetBuild(mc *MockedClient)

func MockScheduleBuild

func MockScheduleBuild(mc *MockedClient, buildID int64, commitID string) *bbpb.Build

func ScheduleBuild

func ScheduleBuild(c context.Context, req *bbpb.ScheduleBuildRequest) (*bbpb.Build, error)

func SearchOlderBuilds

func SearchOlderBuilds(c context.Context, refBuild *bbpb.Build, mask *bbpb.BuildMask, maxResultSize int32, pageToken string) ([]*bbpb.Build, string, error)

SearchOlderBuilds searches for builds in the same builder and are older than a reference Build. More recent builds appear first. The token for the next page of builds is also returned.

Types

type Client

type Client struct {
	Client bbpb.BuildsClient
}

Client is the client to communicate with Buildbucket. It wraps a bbpb.BuildsClient.

func NewClient

func NewClient(ctx context.Context, host string) (*Client, error)

NewClient creates a client to communicate with Buildbucket.

func (*Client) CancelBuild

func (c *Client) CancelBuild(ctx context.Context, req *bbpb.CancelBuildRequest) (*bbpb.Build, error)

func (*Client) GetBuild

func (c *Client) GetBuild(ctx context.Context, req *bbpb.GetBuildRequest) (*bbpb.Build, error)

GetBuild returns bbpb.Build for the requested build.

func (*Client) ScheduleBuild

func (c *Client) ScheduleBuild(ctx context.Context, req *bbpb.ScheduleBuildRequest) (*bbpb.Build, error)

func (*Client) SearchBuild

type MockedClient

type MockedClient struct {
	Client *bbpb.MockBuildsClient
	Ctx    context.Context
}

MockedClient is a mocked Buildbucket client for testing. It wraps a bbpb.MockBuildsClient and a context with the mocked client.

func NewMockedClient

func NewMockedClient(ctx context.Context, ctl *gomock.Controller) *MockedClient

NewMockedClient creates a MockedClient for testing.

Jump to

Keyboard shortcuts

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