Documentation ¶
Index ¶
- type Config
- func (config *Config) Connect() error
- func (config Config) EnsureBucket(bucket string, retries int) (err error)
- func (config Config) GetFile(descriptor desc.RemoteFileDesc, targetFolder string) (localFile desc.LocalFileDesc, err error)
- func (config Config) IsConnected() bool
- func (config Config) PutFile(localFile desc.LocalFileDesc) (remoteFile desc.RemoteFileDesc, err error)
- func (config Config) PutFileFromReader(fileHandle io.ReadCloser, localFile desc.LocalFileDesc) (remoteFile desc.RemoteFileDesc, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 ¶
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) GetFile ¶
func (config Config) GetFile(descriptor desc.RemoteFileDesc, targetFolder string) (localFile desc.LocalFileDesc, err error)
GetFile retrieves the file associated with the RemoteFileDesc onto local disk It ensures that the target bucket exists and otherwise creates it targetFolder is the folder in which to store the data
func (Config) IsConnected ¶
IsConnected returns whether the client of a MinioConfig is initialized
func (Config) PutFile ¶
func (config Config) PutFile(localFile desc.LocalFileDesc) (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, localFile desc.LocalFileDesc) (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