Documentation ¶
Overview ¶
Package gcs stores functions that relates to GCS operations, without dependency on the package calc
Copyright 2019 The Knative Authors ¶
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
- type GcsArtifacts
- type GcsBuild
- type PostSubmit
- type PreSubmit
- type PresubmitBuild
- type StorageClient
- func (client StorageClient) DoesObjectExist(ctx context.Context, bucket, object string) bool
- func (client *StorageClient) ListGcsObjects(ctx context.Context, bucketName, prefix, delim string) (objects []string)
- func (client StorageClient) ProfileReader(ctx context.Context, bucket, object string) *artifacts.ProfileReader
- type StorageClientIntf
Constants ¶
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 }
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 ¶
type PresubmitBuild ¶
type PresubmitBuild struct { GcsBuild Artifacts GcsArtifacts PostSubmitJob string }
type StorageClient ¶
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 }