minio

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AccessKey = os.Getenv(minioAccessKeyEnv)

AccessKey is the access key for minio

View Source
var SecretKey = os.Getenv(minioSecretKeyEnv)

SecretKey is the secret access key for minio

View Source
var TargetBucket = os.Getenv(minioTargetBucketEnv)

TargetBucket is the bucket to which storage should go

View Source
var URL = os.Getenv(minioURLEnv)

URL is the url at which the minio client can be reached

View Source
var UseSSL = parseUseSSL(minioUseSSLEnv)

UseSSL is a bool denoting whether minio client uses SSL

Functions

func VerifyMinioEnvs added in v0.4.0

func VerifyMinioEnvs() error

VerifyMinioEnvs checks whether each of the environment variables returned a non-empty value

Types

type Config

type Config struct {
	TargetBucket string
	Endpoint     string
	AccessKey    string
	SecretKey    string
	UseSSL       bool
	PutOptions   minio.PutObjectOptions
	GetOptions   minio.GetObjectOptions
	Client       *minio.Client
}

Config is a structure holding all relevant information regarding the minio storage used by Iterum

func NewMinioConfig

func NewMinioConfig(endpoint, accessKey, secretAccessKey, targetBucket string, useSSL bool) Config

NewMinioConfig initiates a new minio configuration with all its necessary information

func NewMinioConfigFromEnv

func NewMinioConfigFromEnv() Config

NewMinioConfigFromEnv uses environment variables to initialize a new MinioConfig configured for a step's output

func (*Config) Connect

func (config *Config) Connect() error

Connect tries to initialize the Client element of a minio config

func (Config) EnsureBucket

func (config Config) EnsureBucket(bucket string, retries int) (err error)

EnsureBucket makes sure that the target bucket exists and rights are owned to it. It will retry for 'retries' times and return an error if it fails in the end

func (Config) GetConfigFile added in v0.2.1

func (config Config) GetConfigFile(filename string) (localFile desc.LocalFileDesc, err error)

GetConfigFile gets the file associated with filename from the minioStorage

func (Config) GetFile

func (config Config) GetFile(descriptor desc.RemoteFileDesc, targetFolder string, checkBucket bool) (localFile desc.LocalFileDesc, err error)

GetFile retrieves the file associated with the RemoteFileDesc onto local disk It does not ensure any existing connection neither the bucket. This is the responsibility of the user targetFolder is the folder in which to store the data

func (Config) GetFileAsReader added in v0.4.4

func (config Config) GetFileAsReader(descriptor desc.RemoteFileDesc, checkBucket bool) (fhandle io.ReadCloser, err error)

GetFileAsReader retrieves the file associated with the passed RemoteFileDesc and returns it it as a readable object

func (Config) IsConnected

func (config Config) IsConnected() bool

IsConnected returns whether the client of a MinioConfig is initialized

func (*Config) ListConfigFiles added in v0.2.3

func (cfg *Config) ListConfigFiles() []string

ListConfigFiles returns the list of files contained in the config bucket of a minio config

func (Config) PutConfigFile added in v0.2.1

func (config Config) PutConfigFile(localFile desc.LocalFileDesc) (remoteFile desc.RemoteFileDesc, err error)

PutConfigFile sends the file associated with localPath into the minioStorage in the config bucket of this pipeline run

func (Config) PutFile

func (config Config) PutFile(localFile desc.LocalFileDesc, checkBucket bool) (remoteFile desc.RemoteFileDesc, err error)

PutFile send the file associated with localPath into the minioStorage It ensures that the target bucket exists and otherwise creates it filePath is the target remote path

func (Config) PutFileFromReader

func (config Config) PutFileFromReader(fileHandle io.ReadCloser, contentSize int64, localFile desc.LocalFileDesc, checkBucket bool) (remoteFile desc.RemoteFileDesc, err error)

PutFileFromReader send the data associated with a fileHandler into the minioStorage It assumes that the target bucket exists and access is granted to it ia the config remotePath is the target remote path to store to. fileName is used in the RemoteFileDesc

Jump to

Keyboard shortcuts

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