gcs

package
v0.0.0-...-d7993bf Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package gcs stores functions that relates to GCS operations, without dependency on the package calc

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	ArtifactsDirNameOnGcs = "artifacts"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*storage.Client
}

func NewClient

func NewClient(ctx context.Context) *Client

func (*Client) DoesObjectExist

func (c *Client) DoesObjectExist(ctx context.Context, bucket, object string) bool

DoesObjectExist checks whether an object exists in GCS bucket

func (*Client) ListGcsObjects

func (c *Client) ListGcsObjects(ctx context.Context, bucketName, prefix, delim string) []string

func (*Client) ProfileReader

func (c *Client) ProfileReader(ctx context.Context, bucket,
	object string) *artifacts.ProfileReader

type GcsArtifacts

type GcsArtifacts struct {
	artifacts.Artifacts
	Ctx    context.Context
	Client StorageClient
	Bucket string
}

func NewGcsArtifacts

func NewGcsArtifacts(ctx context.Context, client StorageClient,
	bucket string, baseArtifacts artifacts.Artifacts) *GcsArtifacts

func (*GcsArtifacts) ProfileReader

func (arts *GcsArtifacts) ProfileReader() *artifacts.ProfileReader

type GcsBuild

type GcsBuild struct {
	Client       StorageClient
	Bucket       string
	Job          string
	Build        int
	CovThreshold int
}

type PostSubmit

type PostSubmit struct {
	GcsBuild

	ArtifactsDirName string
	BuildsSorted     []int
	Ctx              context.Context
	// contains filtered or unexported fields
}

func NewPostSubmit

func NewPostSubmit(ctx context.Context, client StorageClient,
	bucket, prowJobName, artifactsDirName, covProfileName string) (p *PostSubmit)

func (*PostSubmit) ProfileReader

func (p *PostSubmit) ProfileReader() *artifacts.ProfileReader

ProfileReader returns the reader for the most recent healthy profile

type PreSubmit

type PreSubmit struct {
	githubPr.GithubPr
	PresubmitBuild
}

func (*PreSubmit) MakeGcsArtifacts

func (p *PreSubmit) MakeGcsArtifacts(localArts artifacts.LocalArtifacts) *GcsArtifacts

func (*PreSubmit) UrlGcsLineCovLinkWithMarker

func (p *PreSubmit) UrlGcsLineCovLinkWithMarker(section int) (result string)

type PresubmitBuild

type PresubmitBuild struct {
	GcsBuild
	Artifacts     GcsArtifacts
	PostSubmitJob string
}

type StorageClient

type StorageClient interface {
	ListGcsObjects(ctx context.Context, bucketName, prefix, delim string) []string
	ProfileReader(ctx context.Context, bucket, object string) *artifacts.ProfileReader
	DoesObjectExist(ctx context.Context, bucket, object string) bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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