gcs

package
v0.0.0-...-355f60d Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2019 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 GcsArtifacts

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

func NewGcsArtifacts

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

func (*GcsArtifacts) ProfileReader

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

type GcsBuild

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

func (*GcsBuild) BuildStr

func (b *GcsBuild) BuildStr() string

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 StorageClientIntf,
	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 struct {
	storage.Client
}

func NewStorageClient

func NewStorageClient(ctx context.Context) *StorageClient

func (StorageClient) DoesObjectExist

func (client StorageClient) DoesObjectExist(ctx context.Context, bucket, object string) bool

DoesObjectExist checks whether an object exists in GCS bucket

func (*StorageClient) ListGcsObjects

func (client *StorageClient) ListGcsObjects(ctx context.Context, bucketName,
	prefix, delim string) (objects []string)

func (StorageClient) ProfileReader

func (client StorageClient) ProfileReader(ctx context.Context, bucket,
	object string) *artifacts.ProfileReader

type StorageClientIntf

type StorageClientIntf interface {
	Bucket(bucketName string) *storage.BucketHandle
	ListGcsObjects(ctx context.Context, bucketName, prefix, delim string) (
		objects []string)
	ProfileReader(ctx context.Context, bucket, object string) *artifacts.ProfileReader
	////CovList(Ctx context.Context, bucket, object string, concernedFiles *map[string]bool) (g *CoverageList)
	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