adapter

package
v0.0.0-...-f839e32 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Folder

type Folder string

Folder specifies folders of the adapter. Base functions operate with any folder, thus custom folders can be used as well

type ObjectToMinIOAdapter

type ObjectToMinIOAdapter interface {
	// GetBucket returns bucket within the storage
	GetBucket() string
	// GetPath returns specified task-related path within the storage.
	// Path does not end with / and thus can't be used as prefix for uploading objects.
	GetPath(path ...Folder) string
	// GetPrefix returns specified task-related prefix within storage.
	// Prefix ends with / and thus can be used as prefix for uploading objects.
	GetPrefix(path ...Folder) string
	// GetObjectPath returns specified task-related full path to an object (file) within the storage.
	// Filename is included into the result. Can be used to upload/download an object by its full path.
	// In case `base` specified, object is trimmed to base - maning filename used w/o prefix.
	GetObjectPath(object string, base bool, path ...Folder) string
	// GetObjectAddress the same idea as GetObjectPath, but returns ready-to-use S3Address
	GetObjectAddress(object string, base bool, path ...Folder) *common.S3Address
	// FirstObject returns specified task-related full path to the first object (file) (filename included) within storage.
	// Can be used to upload/download the object by full path.
	// Is the same as GetObjectPath with the difference that it makes GetObjectPath() of the first object in the path
	FirstObject(path ...Folder) (*common.S3Address, error)
	// WalkObjects walks files with function.
	WalkObjects(f func(int, *minio.MinIO, *minio_go.ObjectInfo, *common.S3Address) bool, path ...Folder) error
}

ObjectToMinIOAdapter is an interface of an entity which can adapt an object to MinIO storage

type TaskMinIO

type TaskMinIO struct {
	Config sections.MinIOConfigurator
	Task   *common.Task
}

TaskMinIO specifies task to MinIO adapter

func NewTaskMinIOAdapter

func NewTaskMinIOAdapter(config sections.MinIOConfigurator, task *common.Task) *TaskMinIO

NewTaskMinIOAdapter creates new Task to MinIO adapter

func (*TaskMinIO) FirstInFile

func (a *TaskMinIO) FirstInFile() (*common.S3Address, error)

FirstInFile gets first `in` file S3Address

func (*TaskMinIO) FirstObject

func (a *TaskMinIO) FirstObject(path ...Folder) (*common.S3Address, error)

FirstObject is an ObjectToMinIOAdapter interface function

func (*TaskMinIO) FirstOutFile

func (a *TaskMinIO) FirstOutFile() (*common.S3Address, error)

FirstOutFile gets first `out` file S3Address

func (*TaskMinIO) FirstResultFile

func (a *TaskMinIO) FirstResultFile() (*common.S3Address, error)

FirstResultFile gets first `result` file S3Address

func (*TaskMinIO) FirstTmpFile

func (a *TaskMinIO) FirstTmpFile() (*common.S3Address, error)

FirstTmpFile gets first `tmp` file S3Address

func (*TaskMinIO) GetBucket

func (a *TaskMinIO) GetBucket() string

GetBucket is an ObjectToMinIOAdapter interface function

func (*TaskMinIO) GetInFile

func (a *TaskMinIO) GetInFile(file string, base bool) string

GetInFile gets `in` full file path

func (*TaskMinIO) GetInFileAddress

func (a *TaskMinIO) GetInFileAddress(file string, base bool) *common.S3Address

GetInFileAddress gets `in` file S3Address

func (*TaskMinIO) GetInPath

func (a *TaskMinIO) GetInPath() string

GetInPath gets `in` path

func (*TaskMinIO) GetInPathAddress

func (a *TaskMinIO) GetInPathAddress() *common.S3Address

GetInPathAddress gets `in` path as S3Address

func (*TaskMinIO) GetInPrefix

func (a *TaskMinIO) GetInPrefix() string

GetInPrefix gets `in` prefix

func (*TaskMinIO) GetObjectAddress

func (a *TaskMinIO) GetObjectAddress(object string, base bool, path ...Folder) *common.S3Address

GetObjectAddress is an ObjectToMinIOAdapter interface function

func (*TaskMinIO) GetObjectPath

func (a *TaskMinIO) GetObjectPath(object string, base bool, path ...Folder) string

GetObjectPath is an ObjectToMinIOAdapter interface function

func (*TaskMinIO) GetOutFile

func (a *TaskMinIO) GetOutFile(file string, base bool) string

GetOutFile gets `out` full file path

func (*TaskMinIO) GetOutFileAddress

func (a *TaskMinIO) GetOutFileAddress(file string, base bool) *common.S3Address

GetOutFileAddress gets `out` file S3Address

func (*TaskMinIO) GetOutPath

func (a *TaskMinIO) GetOutPath() string

GetOutPath gets `out` path

func (*TaskMinIO) GetOutPathAddress

func (a *TaskMinIO) GetOutPathAddress() *common.S3Address

GetOutPathAddress gets `out` path as S3Address

func (*TaskMinIO) GetOutPrefix

func (a *TaskMinIO) GetOutPrefix() string

GetOutPrefix gets `out` prefix

func (*TaskMinIO) GetPath

func (a *TaskMinIO) GetPath(path ...Folder) string

GetPath is an ObjectToMinIOAdapter interface function

func (*TaskMinIO) GetPathAddress

func (a *TaskMinIO) GetPathAddress(path ...Folder) *common.S3Address

GetPathAddress is a wrapper over GetPath to get Path as an S3Address

func (*TaskMinIO) GetPrefix

func (a *TaskMinIO) GetPrefix(path ...Folder) string

GetPrefix is an ObjectToMinIOAdapter interface function

func (*TaskMinIO) GetResultFile

func (a *TaskMinIO) GetResultFile(file string, base bool) string

GetResultFile gets `result` file path

func (*TaskMinIO) GetResultFileAddress

func (a *TaskMinIO) GetResultFileAddress(file string, base bool) *common.S3Address

GetResultFileAddress gets `result` file S3Address

func (*TaskMinIO) GetResultPath

func (a *TaskMinIO) GetResultPath() string

GetResultPath gets `result` path

func (*TaskMinIO) GetResultPathAddress

func (a *TaskMinIO) GetResultPathAddress() *common.S3Address

GetResultPathAddress gets `result` path as S3Address

func (*TaskMinIO) GetResultPrefix

func (a *TaskMinIO) GetResultPrefix() string

GetResultPrefix gets `result` prefix

func (*TaskMinIO) GetTaskPath

func (a *TaskMinIO) GetTaskPath() string

GetTaskPath gets path of the whole task

func (*TaskMinIO) GetTmpFile

func (a *TaskMinIO) GetTmpFile(file string, base bool) string

GetTmpFile gets `tmp` file path

func (*TaskMinIO) GetTmpFileAddress

func (a *TaskMinIO) GetTmpFileAddress(file string, base bool) *common.S3Address

GetTmpFileAddress gets `tmp` files S3Address

func (*TaskMinIO) GetTmpPath

func (a *TaskMinIO) GetTmpPath() string

GetTmpPath gets `tmp` path

func (*TaskMinIO) GetTmpPathAddress

func (a *TaskMinIO) GetTmpPathAddress() *common.S3Address

GetTmpPathAddress gets `tmp` path as S3Address

func (*TaskMinIO) GetTmpPrefix

func (a *TaskMinIO) GetTmpPrefix() string

GetTmpPrefix gets `tmp` prefix

func (*TaskMinIO) WalkInFiles

func (a *TaskMinIO) WalkInFiles(f func(int, *minio.MinIO, *minioGo.ObjectInfo, *common.S3Address) bool) error

WalkInFiles walks `in` files

func (*TaskMinIO) WalkObjects

func (a *TaskMinIO) WalkObjects(f func(int, *minio.MinIO, *minioGo.ObjectInfo, *common.S3Address) bool, path ...Folder) error

WalkObjects is an ObjectToMinIOAdapter interface function

func (*TaskMinIO) WalkOutFiles

func (a *TaskMinIO) WalkOutFiles(f func(int, *minio.MinIO, *minioGo.ObjectInfo, *common.S3Address) bool) error

WalkOutFiles walks `out` files

func (*TaskMinIO) WalkResultFiles

func (a *TaskMinIO) WalkResultFiles(f func(int, *minio.MinIO, *minioGo.ObjectInfo, *common.S3Address) bool) error

WalkResultFiles walks `result` files

func (*TaskMinIO) WalkTmpFiles

func (a *TaskMinIO) WalkTmpFiles(f func(int, *minio.MinIO, *minioGo.ObjectInfo, *common.S3Address) bool) error

WalkTmpFiles walks `tmp` files

Jump to

Keyboard shortcuts

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