artifact

package
v1.13.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GcsArtifactClient

type GcsArtifactClient struct {
	API *storage.Client
}

func (*GcsArtifactClient) DeleteArtifact

func (gac *GcsArtifactClient) DeleteArtifact(ctx context.Context, url string) error

func (*GcsArtifactClient) ParseURL added in v1.12.0

func (gac *GcsArtifactClient) ParseURL(gsURL string) (*URL, error)

Parse parses a Google Cloud Storage string into a URL struct. The expected format of the string is gs://[bucket-name]/[object-path]. If the provided URL is formatted incorrectly an error will be returned.

func (*GcsArtifactClient) ReadArtifact added in v1.12.0

func (gac *GcsArtifactClient) ReadArtifact(ctx context.Context, url string) ([]byte, error)

func (*GcsArtifactClient) WriteArtifact added in v1.12.0

func (gac *GcsArtifactClient) WriteArtifact(ctx context.Context, url string, content []byte) error

type NopArtifactClient

type NopArtifactClient struct{}

func (*NopArtifactClient) DeleteArtifact

func (nac *NopArtifactClient) DeleteArtifact(ctx context.Context, url string) error

func (*NopArtifactClient) ParseURL added in v1.12.0

func (nac *NopArtifactClient) ParseURL(gsURL string) (*URL, error)

func (*NopArtifactClient) ReadArtifact added in v1.12.0

func (nac *NopArtifactClient) ReadArtifact(ctx context.Context, url string) ([]byte, error)

func (*NopArtifactClient) WriteArtifact added in v1.12.0

func (nac *NopArtifactClient) WriteArtifact(ctx context.Context, url string, content []byte) error

type Service

type Service interface {
	ParseURL(gsURL string) (*URL, error)

	ReadArtifact(ctx context.Context, url string) ([]byte, error)
	WriteArtifact(ctx context.Context, url string, content []byte) error
	DeleteArtifact(ctx context.Context, url string) error
}

func NewGcsArtifactClient

func NewGcsArtifactClient(api *storage.Client) Service

func NewNopArtifactClient

func NewNopArtifactClient() Service

type URL added in v1.12.0

type URL struct {
	// Bucket is the name of the Google Cloud Storage bucket where the object
	// is located.
	Bucket string

	// Object is the name and or path of the object stored in the bucket. It
	// should not start with a forward slash.
	Object string
}

URL contains the information needed to identify the location of an object located in Google Cloud Storage.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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