Documentation
¶
Index ¶
- func ResolveArtifactStream(ctx context.Context, cli Client, namespace, path string) (io.ReadCloser, error)
- func UploadArtifact(ctx context.Context, c Client, namespace, path string, in io.Reader) error
- type ArtifactInfo
- type CacheInfo
- type CacheSourceError
- type CacheURLOpts
- type Client
- type ResolveArtifactOpts
- type UploadOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveArtifactStream ¶
Types ¶
type ArtifactInfo ¶
type ArtifactInfo struct { // Timestamp of the artifact commit. CreatedAt time.Time // Digest of the uploaded content. DigestSHA256 string }
func ResolveArtifactWithOpts ¶
func ResolveArtifactWithOpts(ctx context.Context, cli Client, namespace, path string, opts ResolveArtifactOpts) (io.ReadCloser, ArtifactInfo, error)
func UploadArtifactWithOpts ¶
func UploadArtifactWithOpts(ctx context.Context, c Client, namespace, path string, in io.Reader, o UploadOpts) (ArtifactInfo, error)
type CacheInfo ¶
func CacheURL ¶
func CacheURL(ctx context.Context, cli Client, sourceURL string, opts CacheURLOpts) (io.ReadCloser, CacheInfo, error)
Download the content from an arbitrary URL and cache it for fast access.
The content at the URL is assumed to be immutable. If content is already present in the artifact cache for the given URL it will be used instead.
Returns CacheSourceError if it fails downloading from sourceURL.
type CacheSourceError ¶
func (CacheSourceError) Error ¶
func (err CacheSourceError) Error() string
func (CacheSourceError) Unwrap ¶
func (err CacheSourceError) Unwrap() error
type CacheURLOpts ¶
type Client ¶
type Client struct { Artifacts storagev1betagrpc.ArtifactsServiceClient Conn *grpc.ClientConn }
func NewClient ¶
func NewClient(ctx context.Context, token api.TokenSource, opts ...grpc.DialOption) (Client, error)
func NewClientWithEndpoint ¶
func NewClientWithEndpoint(ctx context.Context, endpoint string, token api.TokenSource, opts ...grpc.DialOption) (Client, error)
type ResolveArtifactOpts ¶
type ResolveArtifactOpts struct { }
type UploadOpts ¶
type UploadOpts struct { // Artifact labels to save. Labels map[string]string // Expected length of the uploaded content. // If not set and the Reader is a Seeker, the length will be determined automatically. // Otherwise the content will be buffered in memory. Length int64 // Expected MD5 of the uploaded content; optional. MD5 string }
Click to show internal directories.
Click to hide internal directories.