storage

package
v0.0.0-...-6dc645d Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsStorage

type AwsStorage struct {
	Storage
	Region         string `json:"region" eru:"required"`
	BucketName     string `json:"bucket_name" eru:"required"`
	Authentication string `json:"authentication" eru:"required"`
	Key            string `json:"key" eru:"required"`
	Secret         string `json:"secret" eru:"required"`
	// contains filtered or unexported fields
}

func (*AwsStorage) DownloadFile

func (awsStorage *AwsStorage) DownloadFile(ctx context.Context, folderPath string, fileName string, keyName eruaes.AesKey) (file []byte, err error)

func (*AwsStorage) Init

func (awsStorage *AwsStorage) Init(ctx context.Context) (err error)

func (*AwsStorage) MakeFromJson

func (awsStorage *AwsStorage) MakeFromJson(ctx context.Context, rj *json.RawMessage) error

func (*AwsStorage) UploadFile

func (awsStorage *AwsStorage) UploadFile(ctx context.Context, file multipart.File, header *multipart.FileHeader, docType string, folderPath string, keyName eruaes.AesKey) (docId string, err error)

func (*AwsStorage) UploadFileB64

func (awsStorage *AwsStorage) UploadFileB64(ctx context.Context, file []byte, fileName string, docType string, folderPath string, keyName eruaes.AesKey) (docId string, err error)

type GcpStorage

type GcpStorage struct {
	Storage
}

func (*GcpStorage) DownloadFile

func (gcpStorage *GcpStorage) DownloadFile(ctx context.Context, folderPath string, fileName string, keyName eruaes.AesKey) (file []byte, err error)

func (*GcpStorage) Init

func (gcpStorage *GcpStorage) Init(ctx context.Context) error

func (*GcpStorage) MakeFromJson

func (gcpStorage *GcpStorage) MakeFromJson(ctx context.Context, rj *json.RawMessage) error

func (*GcpStorage) UploadFile

func (gcpStorage *GcpStorage) UploadFile(ctx context.Context, file multipart.File, header *multipart.FileHeader, docType string, folderPath string, keyName eruaes.AesKey) (docId string, err error)

func (*GcpStorage) UploadFileB64

func (gcpStorage *GcpStorage) UploadFileB64(ctx context.Context, file []byte, fileName string, docType string, folderPath string, keyName eruaes.AesKey) (docId string, err error)

type Storage

type Storage struct {
	StorageType  string `json:"storage_type" eru:"required"`
	StorageName  string `json:"storage_name" eru:"required"`
	EncryptFiles bool   `json:"encrypt_files" eru:"required"`
	KeyPair      string `json:"key_pair" eru:"required"`
}

func (*Storage) GetAttribute

func (storage *Storage) GetAttribute(attributeName string) (attributeValue interface{}, err error)

type StorageI

type StorageI interface {
	UploadFile(ctx context.Context, file multipart.File, header *multipart.FileHeader, docType string, folderPath string, keyName eruaes.AesKey) (docId string, err error)
	UploadFileB64(ctx context.Context, file []byte, fileName string, docType string, folderPath string, keyName eruaes.AesKey) (docId string, err error)
	DownloadFile(ctx context.Context, folderPath string, fileName string, keyName eruaes.AesKey) (file []byte, err error)
	GetAttribute(attributeName string) (attributeValue interface{}, err error)
	MakeFromJson(ctx context.Context, rj *json.RawMessage) error
	Init(ctx context.Context) error
}

func GetStorage

func GetStorage(storageType string) StorageI

Jump to

Keyboard shortcuts

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