Documentation ¶
Index ¶
- Constants
- func ArtifactFiles(ctx context.Context, opener fileFinder, o ArtifactOpts) ([]*resultstore.File, error)
- func Connect(ctx context.Context) (*grpc.ClientConn, error)
- func SeedAuthToken(seed string)
- type ArtifactOpts
- type Client
- type DefaultFile
- type Payload
- func (p *Payload) ConfiguredTarget() *resultstore.ConfiguredTarget
- func (p *Payload) DefaultConfiguration() *resultstore.Configuration
- func (p *Payload) Invocation() (*resultstore.Invocation, error)
- func (p *Payload) InvocationID() (string, error)
- func (p *Payload) OverallAction() *resultstore.Action
- func (p *Payload) OverallTarget() *resultstore.Target
- type Uploader
Constants ¶
const ResultStoreAddress = "resultstore.googleapis.com:443"
TODO: have client connect itself? Move to flagutils?
Variables ¶
This section is empty.
Functions ¶
func ArtifactFiles ¶
func ArtifactFiles(ctx context.Context, opener fileFinder, o ArtifactOpts) ([]*resultstore.File, error)
ArtifactFiles returns the files based on ArtifactOpts.
In the event of error, returns any files collected so far in the interest of best effort.
func Connect ¶
func Connect(ctx context.Context) (*grpc.ClientConn, error)
Connect returns a ResultStore GRPC client connection.
func SeedAuthToken ¶
func SeedAuthToken(seed string)
SeedAuthToken sets the seed for computing AuthenticationToken values for ResultStore uploads. This is just one of many layers of protection, but if ever needed, a Crier secret string could be used to rule out unintended writers from interfering with in-progress uploads.
Types ¶
type ArtifactOpts ¶
type ArtifactOpts struct { // Dir is the top-level directory, including the provider, e.g. // "gs://some-bucket/path"; include all files here. Dir string // ArtifactsDirOnly includes only the "Dir/artifacts/" directory, // instead of files in the tree rooted there. Experimental. ArtifactsDirOnly bool // DefaultFiles are files in directory Dir (not nested) that are // included in the output if they don't exist. DefaultFiles []DefaultFile }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(conn *grpc.ClientConn) *Client
NewClient returns a new ResultStore client.
func (*Client) UploadClient ¶
func (c *Client) UploadClient() resultstore.ResultStoreUploadClient
type DefaultFile ¶
DefaultFile describes a file that should exist in ArtifactOpts.Dir. If the file is not present, these values will be used instead.
type Payload ¶
type Payload struct { Job *v1.ProwJob Started *metadata.Started Finished *metadata.Finished Files []*resultstore.File ProjectID string }
func (*Payload) ConfiguredTarget ¶
func (p *Payload) ConfiguredTarget() *resultstore.ConfiguredTarget
func (*Payload) DefaultConfiguration ¶
func (p *Payload) DefaultConfiguration() *resultstore.Configuration
func (*Payload) Invocation ¶
Invocation returns an Invocation suitable to upload to ResultStore.
func (*Payload) InvocationID ¶
InvocationID returns the ResultStore InvocationId.
func (*Payload) OverallAction ¶
func (p *Payload) OverallAction() *resultstore.Action
func (*Payload) OverallTarget ¶
func (p *Payload) OverallTarget() *resultstore.Target
type Uploader ¶
type Uploader struct {
// contains filtered or unexported fields
}
func NewUploader ¶
func (*Uploader) Upload ¶
Upload uploads a completed Prow job's results to ResultStore's API: https://github.com/googleapis/googleapis/blob/master/google/devtools/resultstore/v2/resultstore_upload.proto This function distinguishes between transient and permanent errors; only transient errors from ResultStore are returned, in which case the call should be retried later.