Documentation ¶
Index ¶
- func ValidateSecret(secret *corev1.Secret) error
- type MinioClient
- func (c *MinioClient) Close(_ context.Context)
- func (c *MinioClient) FGetObject(ctx context.Context, bucketName, objectName, localPath string) (string, error)
- func (c *MinioClient) ObjectIsNotFound(err error) bool
- func (c *MinioClient) VisitObjects(ctx context.Context, bucketName string, visit func(key, etag string) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateSecret ¶
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 (*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, 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.