store

package
v0.0.0-...-affaa53 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Endpoint          string `envconfig:"default=minio.kyma.local"`
	ExternalEndpoint  string `envconfig:"default=https://minio.kyma.local"`
	AccessKey         string `envconfig:""`
	SecretKey         string `envconfig:""`
	UseSSL            bool   `envconfig:"default=true"`
	UploadWorkerCount int    `envconfig:"default=10"`
}

type MinioClient

type MinioClient interface {
	FPutObjectWithContext(ctx context.Context, bucketName, objectName, filePath string, opts minio.PutObjectOptions) (n int64, err error)
	ListObjects(bucketName, objectPrefix string, recursive bool, doneCh <-chan struct{}) <-chan minio.ObjectInfo
	MakeBucket(bucketName string, location string) error
	BucketExists(bucketName string) (bool, error)
	RemoveBucket(bucketName string) error
	SetBucketPolicy(bucketName, policy string) error
	GetBucketPolicy(bucketName string) (string, error)
	RemoveObjectsWithContext(ctx context.Context, bucketName string, objectsCh <-chan string) <-chan minio.RemoveObjectError
}

type Store

type Store interface {
	CreateBucket(namespace, crName, region string) (string, error)
	BucketExists(name string) (bool, error)
	DeleteBucket(ctx context.Context, name string) error
	SetBucketPolicy(name string, policy v1alpha2.BucketPolicy) error
	CompareBucketPolicy(name string, expected v1alpha2.BucketPolicy) (bool, error)
	ContainsAllObjects(ctx context.Context, bucketName, assetName string, files []string) (bool, error)
	PutObjects(ctx context.Context, bucketName, assetName, sourceBasePath string, files []string) error
	DeleteObjects(ctx context.Context, bucketName, prefix string) error
	ListObjects(ctx context.Context, bucketName, prefix string) ([]string, error)
}

func New

func New(client MinioClient, uploadWorkerCount int) Store

Directories

Path Synopsis
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0

Jump to

Keyboard shortcuts

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