s3

package
v3.7.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2025 License: Apache-2.0 Imports: 29 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAWSCredentials added in v3.7.0

func GetAWSCredentials(opts S3ClientOpts) (*credentials.Credentials, error)

Get AWS credentials based on default order from aws SDK

func GetCredentials added in v3.7.0

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

func GetDefaultTransport added in v3.7.0

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

GetDefaultTransport returns minio's default transport

func IsS3ErrCode added in v3.7.0

func IsS3ErrCode(err error, code string) bool

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

Types

type AddressingStyle added in v3.7.0

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 added in v3.1.0

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

ArtifactDriver is a driver for AWS S3

func (*ArtifactDriver) Delete added in v3.4.0

func (s3Driver *ArtifactDriver) Delete(artifact *wfv1.Artifact) error

Delete deletes an artifact from an S3 compliant storage

func (*ArtifactDriver) IsDirectory added in v3.4.0

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

func (*ArtifactDriver) ListObjects added in v3.1.0

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

ListObjects returns the files inside the directory represented by the Artifact

func (*ArtifactDriver) Load added in v3.1.0

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

Load downloads artifacts from S3 compliant storage

func (*ArtifactDriver) OpenStream added in v3.4.0

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

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

func (*ArtifactDriver) Save added in v3.1.0

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

Save saves an artifact to S3 compliant storage

type EncryptOpts added in v3.7.0

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

type S3Client added in v3.7.0

type S3Client 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 NewS3Client added in v3.7.0

func NewS3Client(ctx context.Context, opts S3ClientOpts) (S3Client, error)

NewS3Client instantiates a new S3 client object backed

type S3ClientOpts added in v3.7.0

type S3ClientOpts 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
}

Jump to

Keyboard shortcuts

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