Documentation
¶
Index ¶
- Constants
- Variables
- type Storager
- func NewAferoStorager(fs afero.Fs) Storager
- func NewAliOssStorager(endpoint, accessKeyId, accessKeySecret, bucketName, domain string) (Storager, error)
- func NewBasePathStorager(basepath string, store Storager) Storager
- func NewMemStorager() Storager
- func NewOsFileStorager(basepath string) Storager
- func NewQiniuStorager(zone, accessKey, secretKey, bucket, domain string) (Storager, error)
- func NewS3Storager(endpoint, ak, sk, bucket, domain string) (Storager, error)
Constants ¶
View Source
const (
WRITER_BUFFER_SIZE = 1024 * 1024 * 2 // 1M
)
Variables ¶
View Source
var (
ErrQiniuZoneCodeNotFound = errors.New("qiniu zone code not found")
)
Functions ¶
This section is empty.
Types ¶
type Storager ¶
type Storager interface { Save(name string, reader io.Reader) error OpenMetadata(name string) (io.ReadCloser, error) Delete(name string) error Move(src, dest string) error PublicURL(publicURL, name string) (string, error) }
func NewAferoStorager ¶
func NewAliOssStorager ¶
func NewBasePathStorager ¶
func NewMemStorager ¶
func NewMemStorager() Storager
func NewOsFileStorager ¶
func NewQiniuStorager ¶
zone option: huadong:z0 huabei:z1 huanan:z2 northAmerica:na0 singapore:as0 fogCnEast1:fog-cn-east-1 domain required: https://file.example.com
func NewS3Storager ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.