minio

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateSTSProvider added in v1.4.0

func ValidateSTSProvider(bucketProvider string, sts *sourcev1.BucketSTSSpec) error

ValidateSTSProvider validates the STS provider.

func ValidateSTSSecret added in v1.4.0

func ValidateSTSSecret(stsProvider string, secret *corev1.Secret) error

ValidateSTSSecret validates the STS secret. The provided Secret may be nil.

func ValidateSecret

func ValidateSecret(secret *corev1.Secret) error

ValidateSecret validates the credential secret. The provided Secret may be nil.

Types

type MinioClient

type MinioClient struct {
	*minio.Client
}

MinioClient is a minimal Minio client for fetching files from S3 compatible storage APIs.

func NewClient

func NewClient(bucket *sourcev1.Bucket, opts ...Option) (*MinioClient, error)

NewClient creates a new Minio storage client.

func (*MinioClient) Close

func (c *MinioClient) Close(_ context.Context)

Close closes the Minio Client and logs any useful errors.

func (*MinioClient) FGetObject

func (c *MinioClient) FGetObject(ctx context.Context, bucketName, objectName, localPath string) (string, error)

FGetObject gets the object from the provided object storage bucket, and writes it to targetPath. It returns the etag of the successfully fetched file, or any error.

func (*MinioClient) ObjectIsNotFound

func (c *MinioClient) ObjectIsNotFound(err error) bool

ObjectIsNotFound checks if the error provided is a minio.ErrResponse with "NoSuchKey" code.

func (*MinioClient) VisitObjects

func (c *MinioClient) VisitObjects(ctx context.Context, bucketName string, prefix string, visit func(key, etag string) error) error

VisitObjects iterates over the items in the provided object storage bucket, calling visit for every item. If the underlying client or the visit callback returns an error, it returns early.

type Option added in v1.4.0

type Option func(*options)

Option is a function that configures the Minio client.

func WithProxyURL added in v1.4.0

func WithProxyURL(proxyURL *url.URL) Option

WithProxyURL sets the proxy URL for the Minio client.

func WithSTSSecret added in v1.4.0

func WithSTSSecret(secret *corev1.Secret) Option

WithSTSSecret sets the STS secret for the Minio client.

func WithSTSTLSConfig added in v1.4.0

func WithSTSTLSConfig(tlsConfig *tls.Config) Option

WithSTSTLSConfig sets the STS TLS configuration for the Minio client.

func WithSecret added in v1.4.0

func WithSecret(secret *corev1.Secret) Option

WithSecret sets the secret for the Minio client.

func WithTLSConfig added in v1.4.0

func WithTLSConfig(tlsConfig *tls.Config) Option

WithTLSConfig sets the TLS configuration for the Minio client.

Jump to

Keyboard shortcuts

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