Documentation ¶
Index ¶
- Variables
- func VerifyMinioEnvs() error
- type Config
- func (config *Config) Connect() error
- func (config Config) EnsureBucket(bucket string, retries int) (err error)
- func (config Config) GetConfigFile(filename string) (localFile desc.LocalFileDesc, err error)
- func (config Config) GetFile(descriptor desc.RemoteFileDesc, targetFolder string, checkBucket bool) (localFile desc.LocalFileDesc, err error)
- func (config Config) GetFileAsReader(descriptor desc.RemoteFileDesc, checkBucket bool) (fhandle io.ReadCloser, err error)
- func (config Config) IsConnected() bool
- func (cfg *Config) ListConfigFiles() []string
- func (config Config) PutConfigFile(localFile desc.LocalFileDesc) (remoteFile desc.RemoteFileDesc, err error)
- func (config Config) PutFile(localFile desc.LocalFileDesc, checkBucket bool) (remoteFile desc.RemoteFileDesc, err error)
- func (config Config) PutFileFromReader(fileHandle io.ReadCloser, contentSize int64, localFile desc.LocalFileDesc, ...) (remoteFile desc.RemoteFileDesc, err error)
Constants ¶
This section is empty.
Variables ¶
var AccessKey = os.Getenv(minioAccessKeyEnv)
AccessKey is the access key for minio
var SecretKey = os.Getenv(minioSecretKeyEnv)
SecretKey is the secret access key for minio
var TargetBucket = os.Getenv(minioTargetBucketEnv)
TargetBucket is the bucket to which storage should go
var URL = os.Getenv(minioURLEnv)
URL is the url at which the minio client can be reached
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 ¶
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) EnsureBucket ¶
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 ¶
IsConnected returns whether the client of a MinioConfig is initialized
func (*Config) ListConfigFiles ¶ added in v0.2.3
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