saOss

package
v0.0.0-...-b2602dc Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OssType

type OssType int8
const (
	NullOssType OssType = iota
	AliOssType          //阿里云
	CtOssType           //天翼云
)

type SaOss

type SaOss interface {
	Upload(destination string, reader io.Reader) error
	UploadFromLocalFile(destination string, localPath string) error
	Delete(destination string) error
	SetUrlRoot(root string)
	AddUrlRoot(url string) string
	DeleteUrlRoot(url string) string
	CopyWithBucket(src, destination string) error
	//path不需要http开头
	GetTxt(path string) (res string, err error)
	//destination已"/"结尾,则会自动加上随机名称,否则直接按照全路径保存
	UploadTxt(destination string, v string) (path string, err error)
}

func InitOss

func InitOss(ossType OssType, endpoint string, accessKeyId string, accessKeySecret string, bucket string) (SaOss, error)

Jump to

Keyboard shortcuts

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