filemanager

package
v0.1.9-patch-2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2020 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProviderConfigFromEnv

func GetProviderConfigFromEnv() map[string]interface{}

GetProviderConfigFromEnv returns the provider config

Types

type AzureBlobStorageConfig

type AzureBlobStorageConfig struct {
	Container   string
	Prefix      string
	AccountName string
	AccountKey  string
}

func GetAzureBlogStorageConfig

func GetAzureBlogStorageConfig(config map[string]interface{}) *AzureBlobStorageConfig

type AzureBlobStorageManager

type AzureBlobStorageManager struct {
	Config *AzureBlobStorageConfig
}

func (*AzureBlobStorageManager) Download

func (manager *AzureBlobStorageManager) Download(output *os.File, key string) error

func (*AzureBlobStorageManager) Upload

func (manager *AzureBlobStorageManager) Upload(file *os.File, prefixes ...string) (UploadOutput, error)

Upload passed in file to Azure Blob Storage

type FileManager

type FileManager interface {
	Upload(*os.File, ...string) (UploadOutput, error)
	Download(*os.File, string) error
}

FileManager inplements all upload methods

func New

func New(settings *SettingsT) (FileManager, error)

New returns FileManager backed by configured privider

type GCSConfig

type GCSConfig struct {
	Bucket      string
	Prefix      string
	Credentials string
}

func GetGCSConfig

func GetGCSConfig(config map[string]interface{}) *GCSConfig

type GCSManager

type GCSManager struct {
	Config *GCSConfig
}

func (*GCSManager) Download

func (manager *GCSManager) Download(output *os.File, key string) error

func (*GCSManager) Upload

func (manager *GCSManager) Upload(file *os.File, prefixes ...string) (UploadOutput, error)

type MinioConfig

type MinioConfig struct {
	Bucket          string
	Prefix          string
	EndPoint        string
	AccessKeyID     string
	SecretAccessKey string
	UseSSL          bool
}

func GetMinioConfig

func GetMinioConfig(config map[string]interface{}) *MinioConfig

type MinioManager

type MinioManager struct {
	Config *MinioConfig
}

func (*MinioManager) Download

func (manager *MinioManager) Download(file *os.File, key string) error

func (*MinioManager) ObjectUrl

func (manager *MinioManager) ObjectUrl(objectName string) string

func (*MinioManager) Upload

func (manager *MinioManager) Upload(file *os.File, prefixes ...string) (UploadOutput, error)

type S3Config

type S3Config struct {
	Bucket      string
	Prefix      string
	AccessKeyID string
	AccessKey   string
}

func GetS3Config

func GetS3Config(config map[string]interface{}) *S3Config

type S3Manager

type S3Manager struct {
	Config *S3Config
}

func (*S3Manager) Download

func (manager *S3Manager) Download(output *os.File, key string) error

func (*S3Manager) ListFilesWithPrefix

func (manager *S3Manager) ListFilesWithPrefix(prefix string) ([]*S3Object, error)

func (*S3Manager) Upload

func (manager *S3Manager) Upload(file *os.File, prefixes ...string) (UploadOutput, error)

Upload passed in file to s3

type S3Object

type S3Object struct {
	Key              string
	LastModifiedTime time.Time
}

type SettingsT

type SettingsT struct {
	Provider string
	Config   map[string]interface{}
}

SettingsT sets configuration for FileManager

type UploadOutput

type UploadOutput struct {
	Location string
}

Jump to

Keyboard shortcuts

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