Documentation ¶
Index ¶
- Constants
- Variables
- type CloudUploader
- type Oss
- func (oss Oss) Copy(ctx context.Context, source, target string) (code string, err error)
- func (oss Oss) Delete(ctx context.Context, source string) error
- func (oss Oss) GetSts(ctx context.Context, sessionName string) (result *StsResult, err error)
- func (oss Oss) Name() string
- func (oss Oss) Upload(ctx context.Context, source, target string) (link string, err error)
- type S3
- func (s3 S3) Copy(ctx context.Context, source, target string) (code string, err error)
- func (s3 S3) Delete(ctx context.Context, source string) error
- func (s3 S3) GetSts(ctx context.Context, sessionName string) (result *StsResult, err error)
- func (s3 S3) Name() string
- func (s3 S3) Upload(ctx context.Context, source, target string) (link string, err error)
- type StsResult
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)
Click to show internal directories.
Click to hide internal directories.