upload

package
v0.0.0-...-70261f9 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliyunOSS

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

func NewAliyunOSS

func NewAliyunOSS(cfg *properties.Aliyun) (*AliyunOSS, error)

func (*AliyunOSS) DeleteFile

func (s *AliyunOSS) DeleteFile(key string) (err error)

func (*AliyunOSS) UploadFile

func (s *AliyunOSS) UploadFile(prefix string, file *multipart.FileHeader) (url string, err error)

type Local

type Local struct {
	Host      string // 访问地址
	LocalPath string // 本地路径
}

func NewLocal

func NewLocal(cfg *properties.Local) *Local

func (*Local) DeleteFile

func (s *Local) DeleteFile(key string) error

func (*Local) UploadFile

func (s *Local) UploadFile(prefix string, file *multipart.FileHeader) (url string, err error)

type Qiniu

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

https://developer.qiniu.com/kodo/1238/go

func NewQiniu

func NewQiniu(conf *properties.Aliyun) *Qiniu

func (*Qiniu) DeleteFile

func (s *Qiniu) DeleteFile(key string) error

func (*Qiniu) UploadFile

func (s *Qiniu) UploadFile(prefix string, file *multipart.FileHeader) (url string, err error)

type Uploader

type Uploader interface {
	UploadFile(prefix string, file *multipart.FileHeader) (string, error)
	DeleteFile(key string) error
}

Uploader 对象存储接口 Author [SliverHorn](https://github.com/SliverHorn) Author [ccfish86](https://github.com/ccfish86)

func NewOss

func NewOss(cfg *properties.Upload) Uploader

NewOss OSS的实例化方法 Author [SliverHorn](https://github.com/SliverHorn) Author [ccfish86](https://github.com/ccfish86)

Jump to

Keyboard shortcuts

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