storage

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MinioConfig

type MinioConfig struct {
	Endpoint        string
	AccessKeyID     string
	SecretAccessKey string
	UseSSL          bool
}

type ObjectStorageClient

type ObjectStorageClient interface {
	MakeBucket(ctx context.Context, bucketName string, opts minio.MakeBucketOptions) error
	BucketExists(ctx context.Context, bucketName string) (bool, error)
	PutObject(ctx context.Context, bucketName string, objectName string, reader io.Reader, objectSize int64, opts minio.PutObjectOptions) (minio.UploadInfo, error)
	GetObject(ctx context.Context, bucketName string, objectName string, opts minio.GetObjectOptions) (*minio.Object, error)
	ListObjects(ctx context.Context, bucketName string, opts minio.ListObjectsOptions) <-chan minio.ObjectInfo
	RemoveObjects(ctx context.Context, bucketName string, objectsCh <-chan minio.ObjectInfo, opts minio.RemoveObjectsOptions) <-chan minio.RemoveObjectError
}

func NewObjectStorageClient

func NewObjectStorageClient(config *configs.Configuration) (ObjectStorageClient, *errors.GimmeError)

NewObjectStorageClient create a new object storage client

type ObjectStorageManager

type ObjectStorageManager interface {
	CreateBucket(bucketName string, location string) *errors.GimmeError
	AddObject(objectName string, file *zip.File) *errors.GimmeError
	GetObject(objectName string) (*minio.Object, *errors.GimmeError)
	ObjectExists(objectName string) bool
	ListObjects(objectParentName string) []minio.ObjectInfo
	RemoveObjects(objectParentName string) *errors.GimmeError
}

func NewObjectStorageManager

func NewObjectStorageManager(client ObjectStorageClient) ObjectStorageManager

NewObjectStorageManager create a new object storage manager

type RemoveError added in v1.1.0

type RemoveError struct {
	Kind       RemoveKindErrorEnum
	ObjectName string
	Details    string
}

type RemoveKindErrorEnum added in v1.1.0

type RemoveKindErrorEnum string
const (
	Read   RemoveKindErrorEnum = "Read"
	Delete                     = "Delete"
)

Jump to

Keyboard shortcuts

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