Help us shape the future of Go! Take the 2026 Go Developer Survey

s3

package
v1.108.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ProviderID = "AWS-S3"

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

func NewBackend

func NewBackend(creds *Credentials) (*Backend, error)

func (*Backend) CheckWritePermissions

func (b *Backend) CheckWritePermissions(ctx context.Context) error

CheckWritePermissions performs an actual write to the repository to check that the credentials

func (*Backend) Describe

func (b *Backend) Describe(ctx context.Context, digest string) (*pb.CASResource, error)

func (*Backend) Download

func (b *Backend) Download(ctx context.Context, w io.Writer, digest string) error

func (*Backend) Exists

func (b *Backend) Exists(ctx context.Context, digest string) (bool, error)

Exists check that the artifact is already present in the repository

func (*Backend) SupportsStreaming added in v1.106.0

func (b *Backend) SupportsStreaming() bool

SupportsStreaming reports that the s3 backend can upload directly from a streaming reader. The AWS SDK's manager.Uploader consumes the reader in bounded-size parts (multipart upload), so CAS never needs to buffer the whole artifact in memory.

func (*Backend) Upload

func (b *Backend) Upload(ctx context.Context, r io.Reader, resource *pb.CASResource) error

type BackendProvider

type BackendProvider struct {
	// contains filtered or unexported fields
}

func NewBackendProvider

func NewBackendProvider(cReader credentials.Reader) *BackendProvider

func (*BackendProvider) FromCredentials

func (p *BackendProvider) FromCredentials(ctx context.Context, secretName string) (backend.UploaderDownloader, error)

func (*BackendProvider) ID

func (p *BackendProvider) ID() string

func (*BackendProvider) ValidateAndExtractCredentials

func (p *BackendProvider) ValidateAndExtractCredentials(location string, credsJSON []byte) (any, error)

type Credentials

type Credentials struct {
	// AWS Access Key ID
	AccessKeyID string
	// AWS Secret Access Key
	SecretAccessKey string
	// Deprecated: use Location instead. Kept for backward compatibility with existing stored credentials
	BucketName string
	// Location is a combination of the bucket name and the endpoint
	// custom endpoint + bucket-name https://123.r2.cloudflarestorage.com/bucket-name
	// or just the bucket name i.e bucket-name
	Location string
	// Region ID, i.e us-east-1
	Region string
}

func (*Credentials) Validate

func (c *Credentials) Validate() error

Validate that the APICreds has all its properties set

Jump to

Keyboard shortcuts

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