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

s3

package
v4.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCredentials

func GetCredentials(ctx context.Context, opts ClientOpts) (*credentials.Credentials, error)

func GetDefaultTransport

func GetDefaultTransport(opts ClientOpts) (*http.Transport, error)

GetDefaultTransport returns minio's default transport

func IsS3ErrCode

func IsS3ErrCode(err error, code string) bool

IsS3ErrCode returns if the supplied error is of a specific S3 error code

Types

type AddressingStyle

type AddressingStyle int

AddressingStyle is a type of bucket (and also its content) addressing used by the S3 client and supported by the server

const (
	AutoDetectStyle AddressingStyle = iota
	PathStyle
	VirtualHostedStyle
)

type ArtifactDriver

type ArtifactDriver struct {
	Endpoint              string
	Region                string
	Secure                bool
	TrustedCA             string
	AccessKey             string
	SecretKey             string
	SessionToken          string
	RoleARN               string
	UseSDKCreds           bool
	KmsKeyID              string
	KmsEncryptionContext  string
	EnableEncryption      bool
	ServerSideCustomerKey string
	AddressingStyle       string
}

ArtifactDriver is a driver for AWS S3

func (*ArtifactDriver) Delete

func (s3Driver *ArtifactDriver) Delete(ctx context.Context, artifact *wfv1.Artifact) error

Delete deletes an artifact from an S3 compliant storage

func (*ArtifactDriver) IsDirectory

func (s3Driver *ArtifactDriver) IsDirectory(ctx context.Context, artifact *wfv1.Artifact) (bool, error)

func (*ArtifactDriver) ListObjects

func (s3Driver *ArtifactDriver) ListObjects(ctx context.Context, artifact *wfv1.Artifact) ([]string, error)

ListObjects returns the files inside the directory represented by the Artifact

func (*ArtifactDriver) Load

func (s3Driver *ArtifactDriver) Load(ctx context.Context, inputArtifact *wfv1.Artifact, path string) error

Load downloads artifacts from S3 compliant storage

func (*ArtifactDriver) OpenStream

func (s3Driver *ArtifactDriver) OpenStream(ctx context.Context, inputArtifact *wfv1.Artifact) (io.ReadCloser, error)

OpenStream opens a stream reader for an artifact from S3 compliant storage

func (*ArtifactDriver) Save

func (s3Driver *ArtifactDriver) Save(ctx context.Context, path string, outputArtifact *wfv1.Artifact) error

Save saves an artifact to S3 compliant storage

func (*ArtifactDriver) SaveStream added in v4.1.0

func (s3Driver *ArtifactDriver) SaveStream(ctx context.Context, reader io.Reader, outputArtifact *wfv1.Artifact) error

SaveStream saves an artifact from an io.Reader to S3 compliant storage

type Client added in v4.1.0

type Client interface {
	// PutFile puts a single file to a bucket at the specified key
	PutFile(bucket, key, path string) error

	// PutDirectory puts a complete directory into a bucket key prefix, with each file in the directory
	// a separate key in the bucket.
	PutDirectory(bucket, key, path string) error

	// GetFile downloads a file to a local file path
	GetFile(bucket, key, path string) error

	// OpenFile opens a file for much lower disk and memory usage that GetFile
	OpenFile(bucket, key string) (io.ReadCloser, error)

	// KeyExists checks if object exists (and if we have permission to access)
	KeyExists(bucket, key string) (bool, error)

	// Delete deletes the key from the bucket
	Delete(bucket, key string) error

	// GetDirectory downloads a directory to a local file path
	GetDirectory(bucket, key, path string) error

	// ListDirectory list the contents of a directory/bucket
	ListDirectory(bucket, keyPrefix string) ([]string, error)

	// IsDirectory tests if the key is acting like an s3 directory
	IsDirectory(bucket, key string) (bool, error)

	// BucketExists returns whether a bucket exists
	BucketExists(bucket string) (bool, error)

	// MakeBucket creates a bucket with name bucketName and options opts
	MakeBucket(bucketName string, opts minio.MakeBucketOptions) error
}

func NewClient added in v4.1.0

func NewClient(ctx context.Context, opts ClientOpts) (Client, error)

NewClient instantiates a new S3 client object backed

type ClientOpts added in v4.1.0

type ClientOpts struct {
	Endpoint        string
	AddressingStyle AddressingStyle
	Region          string
	Secure          bool
	Transport       http.RoundTripper
	AccessKey       string
	SecretKey       string
	SessionToken    string
	Trace           bool
	RoleARN         string
	RoleSessionName string
	UseSDKCreds     bool
	EncryptOpts     EncryptOpts
	SendContentMd5  bool
}

type EncryptOpts

type EncryptOpts struct {
	KmsKeyID              string
	KmsEncryptionContext  string
	Enabled               bool
	ServerSideCustomerKey string
}

Jump to

Keyboard shortcuts

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