Documentation ¶
Index ¶
- Constants
- func BuildObjectName(namespace, image, alg string) string
- func NewMinIOClient(host string) (*minio.Client, error)
- type Storage
- func (s *Storage) CreateBucketIfNotExists(ctx context.Context, bucketName string) error
- func (s *Storage) ListBuckets(ctx context.Context) ([]minio.BucketInfo, error)
- func (s *Storage) Load(ctx context.Context, bucketName, objectName string) ([]byte, error)
- func (s *Storage) Remove(ctx context.Context, bucketName string, objName string) error
- func (s *Storage) Save(ctx context.Context, bucketName, objectName string, data []byte) error
Constants ¶
View Source
const ( MsgFailedCreateBucket string = "failed to create bucket: %w" MsgFailedGetInfo string = "failed to get info for object: %w" MsgFailedInitiateClient string = "failed to initiate MinIO client: %w" MsgFailedLoad string = "failed to load object: %w" MsgFailedRemove string = "failed to remove object: %w" MsgFailedUpload string = "failed to upload object: %w" )
Error messages
View Source
const DefaultBucketName = "integrity"
Variables ¶
This section is empty.
Functions ¶
func BuildObjectName ¶ added in v0.1.1
BuildObjectName returns the object name for the given @namespace and @image.
An @image has the following format: imageName:imageTag Returns: namespace/imageName/imageTag.alg
func NewMinIOClient ¶
NewMinIOClient returns the MinIO client
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage represents instance for MinIO storage
func NewStorage ¶
NewStorage creates new storage instance and return it
func (*Storage) CreateBucketIfNotExists ¶
CreateBucketIfNotExists creates a new bucket with the given @bucketName if it does not exist
func (*Storage) ListBuckets ¶
ListBuckets returns a list of all buckets in the MinIO server
Click to show internal directories.
Click to hide internal directories.