client

package
v0.0.0-...-7f005ae Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Overview

Package client is for the external clients that Sheriff-o-Matic needs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildersClient

func BuildersClient(c context.Context) (buildbucketpb.BuildersClient, error)

BuildersClient returns a buildbucketpb.BuildersClient.

func GetGitiles

func GetGitiles(c context.Context, URL string) ([]byte, error)

GetGitiles fetches gitiles raw text content with required authentication headers. Note that this currently only works from AppEngine due to gaeauth dependencies.

func GetGitilesCached

func GetGitilesCached(c context.Context, URL string) ([]byte, error)

GetGitilesCached fetches gitiles content through memcache. Note that this currently only works from AppEngine due to memcache and gaeauth dependencies.

func ListBuildersByBucket

func ListBuildersByBucket(c context.Context, client BBBuildersClient, project string, bucket string) ([]*buildbucketpb.BuilderItem, error)

ListBuildersByBucket queries BuildBucket for a list of builders for a bucket.

func NewBisectionServiceClient

func NewBisectionServiceClient(c context.Context, host string) (bisectionpb.AnalysesClient, error)

func ProdClients

func ProdClients(ctx context.Context) (CrBug, Bisection)

ProdClients returns a set of service clients pointed at production.

func StagingClients

func StagingClients(ctx context.Context) (CrBug, Bisection)

StagingClients returns a set of service clients pointed at instances suitable for a staging environment.

Types

type BBBuildersClient

type BBBuildersClient interface {
	ListBuilders(c context.Context, in *buildbucketpb.ListBuildersRequest, opts ...grpc.CallOption) (*buildbucketpb.ListBuildersResponse, error)
}

BBBuildersClient is for testing purpose.

type Bisection

type Bisection interface {
	QueryBisectionResults(c context.Context, bbid int64, stepName string) (*bisectionpb.QueryAnalysisResponse, error)
	BatchGetTestAnalyses(c context.Context, req *bisectionpb.BatchGetTestAnalysesRequest) (*bisectionpb.BatchGetTestAnalysesResponse, error)
}

Bisection returns information about failures that LUCI Bisection analyzes

type BisectionClient

type BisectionClient struct {
	ServiceClient bisectionpb.AnalysesClient
}

func (*BisectionClient) QueryBisectionResults

func (cl *BisectionClient) QueryBisectionResults(c context.Context, bbid int64, stepName string) (*bisectionpb.QueryAnalysisResponse, error)

type CrBug

type CrBug interface {
	// CrBugItems returns issue matching label.
	CrbugItems(ctx context.Context, label string) ([]messages.CrbugItem, error)
}

CrBug returns bug information.

type CrBugs

type CrBugs struct {
	// contains filtered or unexported fields
}

CrBugs is a minimal Monorail client for fetching issues.

func (*CrBugs) CrbugItems

func (cr *CrBugs) CrbugItems(ctx context.Context, label string) ([]messages.CrbugItem, error)

CrbugItems returns a slice of issues that match label.

type CrRev

type CrRev interface {
	// GetRedirect gets the redirect for a commit position.
	GetRedirect(c context.Context, pos string) (map[string]string, error)
}

CrRev returns redirects for commit positions.

func NewCrRev

func NewCrRev(baseURL string) CrRev

NewCrRev returns a crrev client.

type Test

type Test struct {
	Builders []string `json:"builders"`
}

Test represents information about Tests in a builder group.

type Writer

type Writer interface {
	// PostAlerts posts alerts to Sheriff-o-Matic.
	PostAlerts(ctx context.Context, alerts *messages.AlertsSummary) error
}

Writer writes out data to other services, most notably sheriff-o-matic.

func NewWriter

func NewWriter(alertsBase string, transport http.RoundTripper) Writer

NewWriter returns a new Client, which will post alerts to alertsBase.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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