storage

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileManager

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

func Init

func Init(config ...StorageConfig) (*FileManager, error)

func (*FileManager) Download

func (fm *FileManager) Download(ctx context.Context, key string) ([]byte, error)

func (*FileManager) Upload

func (fm *FileManager) Upload(ctx context.Context, file []byte, key string, options ...types.UploadOptions) (string, error)

type Storage

type Storage interface {
	Upload(ctx context.Context, file []byte, key string, options ...types.UploadOptions) (string, error)
	Download(ctx context.Context, key string) ([]byte, error)
}

func GetStorage

func GetStorage() (Storage, error)

type StorageConfig

type StorageConfig struct {
	Type      StorageType
	Bucket    string
	Region    string
	KeyPrefix string
}

type StorageType

type StorageType string
const (
	StorageDiskLocal StorageType = "local"
	StorageDiskS3    StorageType = "s3"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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