Documentation ¶
Index ¶
- type AliOssConf
- type AliOssOption
- type AliYunOssBucket
- func (b *AliYunOssBucket) UploadBytes(saveFile string, bs []byte) (url string, err error)
- func (b *AliYunOssBucket) UploadLocalFile(saveFile, filePath string) (url string, err error)
- func (b *AliYunOssBucket) UploadString(saveFile, str string) (url string, err error)
- func (b *AliYunOssBucket) UploadStruct(saveFile string, s interface{}) (url string, err error)
- func (b *AliYunOssBucket) UploadWebFile(saveFile, originUrl string) (url string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AliOssConf ¶
type AliOssConf struct {
Endpoint, AccessKeyId, AccessKeySecret, Bucket, BucketBaseUrl string
}
type AliOssOption ¶
type AliOssOption func(c *AliOssConf)
AliOssOption 配置项
func WithAliOssAccessKeyId ¶
func WithAliOssAccessKeyId(accessKeyId string) AliOssOption
func WithAliOssAccessKeySecret ¶
func WithAliOssAccessKeySecret(accessKeySecret string) AliOssOption
func WithAliOssBucket ¶
func WithAliOssBucket(bucket string) AliOssOption
func WithAliOssBucketBaseUrl ¶
func WithAliOssBucketBaseUrl(baseUrl string) AliOssOption
bucket访问域名 请使用http/https完整URL
type AliYunOssBucket ¶
func NewAliYunOssBucket ¶
func NewAliYunOssBucket(options ...AliOssOption) (ab *AliYunOssBucket, err error)
func (*AliYunOssBucket) UploadBytes ¶
func (b *AliYunOssBucket) UploadBytes(saveFile string, bs []byte) (url string, err error)
上传Bytes数组 saveFile只可使用相对路径
func (*AliYunOssBucket) UploadLocalFile ¶
func (b *AliYunOssBucket) UploadLocalFile(saveFile, filePath string) (url string, err error)
上传本地文件 saveFile只可使用相对路径
func (*AliYunOssBucket) UploadString ¶
func (b *AliYunOssBucket) UploadString(saveFile, str string) (url string, err error)
上传字符串 saveFile只可使用相对路径
func (*AliYunOssBucket) UploadStruct ¶
func (b *AliYunOssBucket) UploadStruct(saveFile string, s interface{}) (url string, err error)
上传结构体转存json saveFile只可使用相对路径
func (*AliYunOssBucket) UploadWebFile ¶
func (b *AliYunOssBucket) UploadWebFile(saveFile, originUrl string) (url string, err error)
上传web文件 saveFile只可使用相对路径
Click to show internal directories.
Click to hide internal directories.