data_store

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 20 Imported by: 2

Documentation

Index

Constants

View Source
const (
	S5Storage    = "s5"
	S3Storage    = "s3"
	LocalStorage = "local"
	ContentType  = "application/octet-stream"
	DataPath     = "data"
	S3url        = "s3://"
	Localurl     = "file://"
)

Variables

View Source
var (
	ErrFileNotFound = fmt.Errorf("file not found")
)

Functions

This section is empty.

Types

type DataStoreClient

type DataStoreClient struct {
	Client IDataStoreClient
}

func NewDataStoreClient

func NewDataStoreClient(config DataStoreConfig) (DataStoreClient, error)

type DataStoreConfig

type DataStoreConfig struct {
	Url            string
	UseHttps       bool
	NoVerifySSL    bool
	User           string
	Password       string
	Service        string
	DataPath       string
	ContentType    string
	S3MaxRetries   int
	S3DelayRetries int
}

type IDataStoreClient

type IDataStoreClient interface {
	GetFile(name string, location string) ([]byte, error)
	UploadFromFile(filePath string, dest string) error
	UploadFromBytes(data []byte, destFolder string, destName string) error
	UploadFromReader(data io.Reader, size int64, destFolder string, destName string) error
	List(dir string, prefix string) ([]string, error)
	ListChan(ctx context.Context, dir string, prefix string) (<-chan string, error)
	StorageType() string
	DeleteFiles(name string, location string) error
	RenameFile(oldName string, newName string, bucket string) error
}

type LocalClient

type LocalClient struct {
	// contains filtered or unexported fields
}

func (*LocalClient) DeleteFiles added in v1.3.4

func (c *LocalClient) DeleteFiles(object string, bucket string) error

func (*LocalClient) GetDataPath added in v1.3.0

func (c *LocalClient) GetDataPath() string

func (*LocalClient) GetFile

func (c *LocalClient) GetFile(object string, bucket string) ([]byte, error)

func (*LocalClient) List

func (c *LocalClient) List(bucket string, prefix string) ([]string, error)

func (*LocalClient) ListChan added in v1.2.4

func (c *LocalClient) ListChan(ctx context.Context, bucket string, prefix string) (<-chan string, error)

func (*LocalClient) RenameFile added in v1.3.4

func (c *LocalClient) RenameFile(oldObject string, newObject string, bucket string) error

func (*LocalClient) StorageType

func (c *LocalClient) StorageType() string

func (*LocalClient) UploadFromBytes added in v1.2.3

func (c *LocalClient) UploadFromBytes(data []byte, folder string, name string) error

func (*LocalClient) UploadFromFile added in v1.2.3

func (c *LocalClient) UploadFromFile(name string, folder string) error

func (*LocalClient) UploadFromReader added in v1.3.0

func (c *LocalClient) UploadFromReader(data io.Reader, size int64, folder string, name string) error

type MinioClient

type MinioClient struct {
	// contains filtered or unexported fields
}

func (*MinioClient) DeleteFiles added in v1.3.4

func (c *MinioClient) DeleteFiles(object string, bucket string) error

func (*MinioClient) GetClient

func (c *MinioClient) GetClient() *minio.Client

func (*MinioClient) GetContentType added in v1.3.0

func (c *MinioClient) GetContentType() string

func (*MinioClient) GetFile

func (c *MinioClient) GetFile(object string, bucket string) ([]byte, error)

func (*MinioClient) List

func (c *MinioClient) List(bucket string, prefix string) ([]string, error)

func (*MinioClient) ListChan added in v1.2.4

func (c *MinioClient) ListChan(ctx context.Context, bucket string, prefix string) (<-chan string, error)

func (*MinioClient) RenameFile added in v1.3.4

func (c *MinioClient) RenameFile(oldObject string, newObject string, bucket string) error

func (*MinioClient) StorageType

func (c *MinioClient) StorageType() string

func (*MinioClient) UploadFromBytes added in v1.2.3

func (c *MinioClient) UploadFromBytes(data []byte, folder string, name string) error

func (*MinioClient) UploadFromFile added in v1.2.3

func (c *MinioClient) UploadFromFile(name string, folder string) error

func (*MinioClient) UploadFromReader added in v1.3.0

func (c *MinioClient) UploadFromReader(data io.Reader, size int64, folder string, name string) error

type S5cmdClient added in v1.3.0

type S5cmdClient struct {
	// contains filtered or unexported fields
}

func (*S5cmdClient) DeleteFiles added in v1.3.4

func (c *S5cmdClient) DeleteFiles(object string, bucket string) error

func (*S5cmdClient) GetClient added in v1.3.0

func (c *S5cmdClient) GetClient() *s5store.S3

func (*S5cmdClient) GetContentType added in v1.3.0

func (c *S5cmdClient) GetContentType() string

func (*S5cmdClient) GetFile added in v1.3.0

func (c *S5cmdClient) GetFile(object string, bucket string) ([]byte, error)

func (*S5cmdClient) List added in v1.3.0

func (c *S5cmdClient) List(bucket string, prefix string) ([]string, error)

func (*S5cmdClient) ListChan added in v1.3.0

func (c *S5cmdClient) ListChan(ctx context.Context, bucket string, prefix string) (<-chan string, error)

func (*S5cmdClient) RenameFile added in v1.3.4

func (c *S5cmdClient) RenameFile(oldObject string, newObject string, bucket string) error

func (*S5cmdClient) StorageType added in v1.3.0

func (c *S5cmdClient) StorageType() string

func (*S5cmdClient) UploadFromBytes added in v1.3.0

func (c *S5cmdClient) UploadFromBytes(data []byte, folder string, name string) error

func (*S5cmdClient) UploadFromFile added in v1.3.0

func (c *S5cmdClient) UploadFromFile(name string, folder string) error

func (*S5cmdClient) UploadFromReader added in v1.3.0

func (c *S5cmdClient) UploadFromReader(data io.Reader, size int64, folder string, name string) error

type S5cmdList added in v1.3.0

type S5cmdList struct {
	Key string `json:"key"`
}

Jump to

Keyboard shortcuts

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