storage

package
v0.0.0-...-35b844d Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

func (*Engine) GetStorage

func (e *Engine) GetStorage(name string) FileSystem

func (*Engine) OnInit

func (e *Engine) OnInit(engine *harukap.HarukaAppEngine) error

type FileSystem

type FileSystem interface {
	Upload(ctx context.Context, body io.Reader, bucket string, key string) error
	Init() error
	Get(ctx context.Context, bucket, key string) (io.ReadCloser, error)
	Delete(ctx context.Context, bucket, key string) error
	IsExist(ctx context.Context, bucket, key string) (bool, error)
	Copy(ctx context.Context, bucket, key, destBucket, destKey string) error
}

type LocalStorage

type LocalStorage struct {
	Config     *LocalStorageConfig
	ConfigName string
	// contains filtered or unexported fields
}

func (*LocalStorage) Copy

func (l *LocalStorage) Copy(ctx context.Context, bucket, key, destBucket, destKey string) error

func (*LocalStorage) Delete

func (l *LocalStorage) Delete(ctx context.Context, bucket, key string) error

func (*LocalStorage) Get

func (l *LocalStorage) Get(ctx context.Context, bucket, key string) (io.ReadCloser, error)

func (*LocalStorage) Init

func (l *LocalStorage) Init() error

func (*LocalStorage) IsExist

func (l *LocalStorage) IsExist(ctx context.Context, bucket, key string) (bool, error)

func (*LocalStorage) OnInit

func (l *LocalStorage) OnInit(e *harukap.HarukaAppEngine) error

func (*LocalStorage) Upload

func (l *LocalStorage) Upload(ctx context.Context, body io.Reader, bucket string, key string) error

type LocalStorageConfig

type LocalStorageConfig struct {
	Path string `json:"path"`
}

type S3Client

type S3Client struct {
	Session    *session.Session
	Service    *s3.S3
	ConfigName string
	Config     *S3ClientConfig
}

func (*S3Client) Copy

func (c *S3Client) Copy(ctx context.Context, bucket, key, destBucket, destKey string) error

func (*S3Client) Delete

func (c *S3Client) Delete(ctx context.Context, bucket, key string) error

func (*S3Client) Get

func (c *S3Client) Get(ctx context.Context, bucket, key string) (io.ReadCloser, error)

func (*S3Client) Init

func (c *S3Client) Init() error

func (*S3Client) IsExist

func (c *S3Client) IsExist(ctx context.Context, bucket, key string) (bool, error)

func (*S3Client) OnInit

func (c *S3Client) OnInit(e *harukap.HarukaAppEngine) error

func (*S3Client) Upload

func (c *S3Client) Upload(ctx context.Context, body io.Reader, bucket string, key string) error

type S3ClientConfig

type S3ClientConfig struct {
	Id       string `json:"id"`
	Secret   string `json:"secret"`
	Region   string `json:"region"`
	Token    string `json:"token"`
	Endpoint string `json:"endpoint"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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