Documentation
¶
Index ¶
- func GetCredentials(ctx context.Context, opts S3ClientOpts) (*credentials.Credentials, error)
- func GetDefaultTransport(opts S3ClientOpts) (*http.Transport, error)
- func IsS3ErrCode(err error, code string) bool
- type AddressingStyle
- type ArtifactDriver
- func (s3Driver *ArtifactDriver) Delete(ctx context.Context, artifact *wfv1.Artifact) error
- func (s3Driver *ArtifactDriver) IsDirectory(ctx context.Context, artifact *wfv1.Artifact) (bool, error)
- func (s3Driver *ArtifactDriver) ListObjects(ctx context.Context, artifact *wfv1.Artifact) ([]string, error)
- func (s3Driver *ArtifactDriver) Load(ctx context.Context, inputArtifact *wfv1.Artifact, path string) error
- func (s3Driver *ArtifactDriver) OpenStream(ctx context.Context, inputArtifact *wfv1.Artifact) (io.ReadCloser, error)
- func (s3Driver *ArtifactDriver) Save(ctx context.Context, path string, outputArtifact *wfv1.Artifact) error
- type EncryptOpts
- type S3Client
- type S3ClientOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCredentials ¶
func GetCredentials(ctx context.Context, opts S3ClientOpts) (*credentials.Credentials, error)
func GetDefaultTransport ¶
func GetDefaultTransport(opts S3ClientOpts) (*http.Transport, error)
GetDefaultTransport returns minio's default transport
func IsS3ErrCode ¶
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
}
ArtifactDriver is a driver for AWS S3
func (*ArtifactDriver) IsDirectory ¶
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
type EncryptOpts ¶
type S3Client ¶
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 ¶
func NewS3Client(ctx context.Context, opts S3ClientOpts) (S3Client, error)
NewS3Client instantiates a new S3 client object backed
type S3ClientOpts ¶
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
}
Click to show internal directories.
Click to hide internal directories.