artifact

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrObjectNotExist = errors.New("storage: object doesn't exist")

Functions

This section is empty.

Types

type GcsArtifactClient

type GcsArtifactClient struct {
	URLScheme
	// contains filtered or unexported fields
}

func (*GcsArtifactClient) DeleteArtifact

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

func (*GcsArtifactClient) GetType added in v1.13.2

func (gac *GcsArtifactClient) GetType() string

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(_ context.Context, _ string) error

func (*NopArtifactClient) GetType added in v1.13.2

func (nac *NopArtifactClient) GetType() string

func (*NopArtifactClient) GetURLScheme added in v1.13.2

func (nac *NopArtifactClient) GetURLScheme() string

func (*NopArtifactClient) ParseURL added in v1.12.0

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

func (*NopArtifactClient) ReadArtifact added in v1.12.0

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

func (*NopArtifactClient) WriteArtifact added in v1.12.0

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

type S3ArtifactClient added in v1.13.2

type S3ArtifactClient struct {
	URLScheme
	// contains filtered or unexported fields
}

func (*S3ArtifactClient) DeleteArtifact added in v1.13.2

func (s3c *S3ArtifactClient) DeleteArtifact(ctx context.Context, url string) error

func (*S3ArtifactClient) GetType added in v1.13.2

func (s3c *S3ArtifactClient) GetType() string

func (*S3ArtifactClient) ReadArtifact added in v1.13.2

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

func (*S3ArtifactClient) WriteArtifact added in v1.13.2

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

type SchemeInterface added in v1.13.2

type SchemeInterface interface {
	GetURLScheme() string
	ParseURL(gsURL string) (*URL, error)
}

type Service

type Service interface {
	GetType() string
	GetURLScheme() string
	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() (Service, error)

func NewNopArtifactClient

func NewNopArtifactClient() Service

func NewS3ArtifactClient added in v1.13.2

func NewS3ArtifactClient() (Service, error)

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.

type URLScheme added in v1.13.2

type URLScheme string

func (URLScheme) GetURLScheme added in v1.13.2

func (urlScheme URLScheme) GetURLScheme() string

func (URLScheme) ParseURL added in v1.13.2

func (urlScheme URLScheme) ParseURL(gsURL string) (*URL, error)

ParseURL parses an artifact storage string into a URL struct. The expected format of the string is [url-scheme]://[bucket-name]/[object-path]. If the provided URL is formatted incorrectly an error will be returned.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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