Documentation ¶
Overview ¶
Package s3manager implements the various functions needed to store and retrieve files from an S3 API compatible endpoint (AWS S3, Minio, etc)
Index ¶
- type ConnectionDetails
- type Manager
- func (m *Manager) DeleteObject(ctx context.Context, objectID string) error
- func (m *Manager) EnsureBucket(ctx context.Context) error
- func (m *Manager) Meta(ctx context.Context, blobUID string) (map[string]string, error)
- func (m *Manager) Upload(ctx context.Context, filepath string, metadata map[string]string) (string, error)
- func (m *Manager) UploadStream(ctx context.Context, file io.Reader, size int64, metadata map[string]string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionDetails ¶
type ConnectionDetails struct { Endpoint string UseSSL bool AccessKeyID string SecretAccessKey string Bucket string Location string CA []byte }
func GetConnectionDetails ¶
func GetConnectionDetails(ctx context.Context, cluster *kubernetes.Cluster, secretNamespace, secretName string) (ConnectionDetails, error)
GetConnectionDetails retrieves s3 details from an ini file stored in a secret. Note: The CLI tool in the staging job will use the ini file directly.
func (*ConnectionDetails) Validate ¶
func (details *ConnectionDetails) Validate() error
Validate makes sure the provided S3 settings are valid The user should provide all the mandatory settings or no settings at all.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func New ¶
func New(connectionDetails ConnectionDetails) (*Manager, error)
New returns an instance of an s3 manager
func (*Manager) DeleteObject ¶
DeleteObject deletes the specified object from the storage
func (*Manager) EnsureBucket ¶
EnsureBucket creates our bucket if it's missing
func (*Manager) Meta ¶ added in v0.3.0
Meta retrieves the meta data for the blob specified by it blobUID.