Documentation ¶
Overview ¶
Package buildbucket contains logic of interacting with Buildbucket.
Index ¶
- func CancelBuild(c context.Context, bbid int64, reason string) (*bbpb.Build, error)
- func GetBuild(c context.Context, bbid int64, mask *bbpb.BuildMask) (*bbpb.Build, error)
- func GetBuildTaskDimension(ctx context.Context, bbid int64) (*pb.Dimensions, error)
- func MockGetBuild(mc *MockedClient)
- func MockScheduleBuild(mc *MockedClient, buildID int64, commitID string) *bbpb.Build
- func ScheduleBuild(c context.Context, req *bbpb.ScheduleBuildRequest) (*bbpb.Build, error)
- func SearchOlderBuilds(c context.Context, refBuild *bbpb.Build, mask *bbpb.BuildMask, ...) ([]*bbpb.Build, string, error)
- type Client
- func (c *Client) CancelBuild(ctx context.Context, req *bbpb.CancelBuildRequest) (*bbpb.Build, error)
- func (c *Client) GetBuild(ctx context.Context, req *bbpb.GetBuildRequest) (*bbpb.Build, error)
- func (c *Client) ScheduleBuild(ctx context.Context, req *bbpb.ScheduleBuildRequest) (*bbpb.Build, error)
- func (c *Client) SearchBuild(ctx context.Context, req *bbpb.SearchBuildsRequest) (*bbpb.SearchBuildsResponse, error)
- type MockedClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CancelBuild ¶
func GetBuildTaskDimension ¶
func MockGetBuild ¶
func MockGetBuild(mc *MockedClient)
func MockScheduleBuild ¶
func MockScheduleBuild(mc *MockedClient, buildID int64, commitID string) *bbpb.Build
func ScheduleBuild ¶
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 (*Client) CancelBuild ¶
func (*Client) ScheduleBuild ¶
func (*Client) SearchBuild ¶
func (c *Client) SearchBuild(ctx context.Context, req *bbpb.SearchBuildsRequest) (*bbpb.SearchBuildsResponse, error)
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.
Click to show internal directories.
Click to hide internal directories.