settings

package
v0.0.0-...-b015d54 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	App = "go-web"
)

Variables

View Source
var (
	Rng      *rand.Rand
	Config   *viper.Viper
	Logger   *wrap.Logger
	Cache    *bigcache.BigCache
	Uploader CloudUploader
)

Functions

This section is empty.

Types

type CloudUploader

type CloudUploader interface {
	Name() string
	BucketUrl() string

	Upload(context.Context, string, string) (string, error)
	GetSts(context.Context, string) (*StsResult, error)
	Copy(context.Context, string, string) (string, error)
	Delete(context.Context, string) error
}

func NewAliyunOss

func NewAliyunOss(fp, field string) (uploader CloudUploader, err error)

func NewAwsS3

func NewAwsS3(fp, field string) (uploader CloudUploader, err error)

type Oss

type Oss struct {
	*aliyun.OssClient
}

aliyun.Oss impl

func (Oss) Copy

func (oss Oss) Copy(ctx context.Context, source, target string) (code string, err error)

func (Oss) Delete

func (oss Oss) Delete(ctx context.Context, source string) error

func (Oss) GetSts

func (oss Oss) GetSts(ctx context.Context, sessionName string) (result *StsResult, err error)

func (Oss) Name

func (oss Oss) Name() string

func (Oss) Upload

func (oss Oss) Upload(ctx context.Context, source, target string) (link string, err error)

type S3

type S3 struct {
	*aws.S3Client
}

aws.S3 impl

func (S3) Copy

func (s3 S3) Copy(ctx context.Context, source, target string) (code string, err error)

func (S3) Delete

func (s3 S3) Delete(ctx context.Context, source string) error

func (S3) GetSts

func (s3 S3) GetSts(ctx context.Context, sessionName string) (result *StsResult, err error)

func (S3) Name

func (s3 S3) Name() string

func (S3) Upload

func (s3 S3) Upload(ctx context.Context, source, target string) (link string, err error)

type StsResult

type StsResult aws.StsResult

Jump to

Keyboard shortcuts

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