gostorage

package
v1.0.63 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliYun

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

AliYun 阿里云

func NewAliYun

func NewAliYun(config *AliYunConfig) (*AliYun, error)

NewAliYun 初始化 https://help.aliyun.com/document_detail/32144.html

func (*AliYun) PutLocalFile

func (c *AliYun) PutLocalFile(localFilePath, filePath, fileName string) (resp FileInfo, err error)

PutLocalFile 上传本地文件 @param localFile 本地文件路径 @param filePath 文件路径 @param fileName 文件名称

func (*AliYun) PutObject

func (c *AliYun) PutObject(file io.Reader, filePath, fileName string) (resp FileInfo, err error)

PutObject 上传文件流 @param file 文件流 @param filePath 文件路径 @param fileName 文件名称

type AliYunConfig

type AliYunConfig struct {
	AccessKeyId        string // 账号信息
	AccessKeySecret    string // 账号信息
	Endpoint           string // 地域节点 外网访问 test3
	EndpointEcs        string // 地域节点 ECS 的经典网络访问(内网) test1
	EndpointAccelerate string // 地域节点 传输加速域名(全地域上传下载加速 test4
	BucketName         string // 存储空间名称
}

AliYunConfig 阿里云配置

type Aws added in v1.0.52

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

func NewAws added in v1.0.52

func NewAws() *Aws

type Baidu

type Baidu struct {
	AccessKey       string
	SecretAccessKey string
	Endpoint        string
	BucketName      string
	// contains filtered or unexported fields
}

Baidu 百度云

func NewBaidu

func NewBaidu(accessKey string, secretAccessKey, endpoint, bucketName string) *Baidu

NewBaidu 初始化 https://cloud.baidu.com/doc/BOS/s/4jwvyry1p

func (*Baidu) Bucket

func (c *Baidu) Bucket(name string) *Baidu

Bucket 存储空间

func (*Baidu) PutObject

func (c *Baidu) PutObject(file io.Reader, filePath, fileName string) (resp FileInfo, err error)

PutObject 上传文件流 @param file 文件流 @param filePath 文件路径 @param fileName 文件名称

type FileInfo

type FileInfo struct {
	Path string // 文件路径
	Name string // 文件名称
	Url  string // 文件地址
}

FileInfo 上传文件的信息

type Huaweicloud

type Huaweicloud struct {
	AccessKey  string
	SecretKey  string
	Endpoint   string
	BucketName string
	// contains filtered or unexported fields
}

Huaweicloud 华为云

func NewHuaweicloud

func NewHuaweicloud(accessKey string, secretKey string, endpoint string, bucketName string) *Huaweicloud

NewHuaweicloud 初始化 https://support.huaweicloud.com/sdk-go-devg-obs/obs_33_0001.html

func (*Huaweicloud) Bucket

func (c *Huaweicloud) Bucket(name string) *Huaweicloud

Bucket 存储空间

func (*Huaweicloud) PutObject

func (c *Huaweicloud) PutObject(file io.Reader, filePath, fileName string) (resp FileInfo, err error)

PutObject 上传文件流 @param file 文件流 @param filePath 文件路径 @param fileName 文件名称

type Jdcloud

type Jdcloud struct {
	AccessKey  string
	SecretKey  string
	Endpoint   *string
	Regions    *string
	BucketName string
	// contains filtered or unexported fields
}

Jdcloud 京东云

func NewJdcloud

func NewJdcloud(accessKey string, secretKey string, endpoint *string, regions *string, bucketName string) *Jdcloud

NewJdcloud 初始化 https://docs.jdcloud.com/cn/object-storage-service/sdk-go

func (*Jdcloud) Bucket

func (c *Jdcloud) Bucket(name string) *Jdcloud

Bucket 存储空间

type Ksyun

type Ksyun struct {
	AccessKey  string
	SecretKey  string
	Endpoint   string
	Regions    string
	BucketName string
	// contains filtered or unexported fields
}

Ksyun 金山云

func NewKsyun

func NewKsyun(accessKey string, secretKey string, endpoint string, regions string, bucketName string) *Ksyun

NewKsyun 初始化 https://docs.ksyun.com/documents/40487

func (*Ksyun) Bucket

func (c *Ksyun) Bucket(name string) *Ksyun

Bucket 存储空间

func (*Ksyun) PutObject

func (c *Ksyun) PutObject(file io.Reader, filePath, fileName, acl string) (resp FileInfo, err error)

PutObject 上传文件流 @param file 文件流 @param filePath 文件路径 @param fileName 文件名称

type Qiniu

type Qiniu struct {
	AccessKey  string
	SecretKey  string
	BucketName string
	// contains filtered or unexported fields
}

Qiniu 七牛云

func NewQiniu

func NewQiniu(accessKey string, secretKey string, bucketName string) *Qiniu

NewQiniu 初始化 https://developer.qiniu.com/kodo/1238/go

func (*Qiniu) Bucket

func (c *Qiniu) Bucket(name string) *Qiniu

Bucket 存储空间

func (*Qiniu) PutObject

func (c *Qiniu) PutObject(file io.Reader, filePath, fileName, acl string) (resp FileInfo, err error)

PutObject 上传文件流 @param file 文件流 @param filePath 文件路径 @param fileName 文件名称

type Tencent

type Tencent struct {
	SecretID   string // 用户的 SecretId
	SecretKey  string // 用户的 SecretKey
	BucketName string // 存储桶名称
	Regions    string // 所属地域
	// contains filtered or unexported fields
}

Tencent 腾讯云

func NewTencent

func NewTencent(secretID, secretKey, regions, bucketName string) *Tencent

NewTencent 初始化 https://cloud.tencent.com/document/product/436/31215

func (*Tencent) Bucket

func (c *Tencent) Bucket(name string) *Tencent

Bucket 存储空间

func (*Tencent) PutObject

func (c *Tencent) PutObject(file io.Reader, filePath, fileName string) (resp FileInfo, err error)

PutObject 上传文件流 @param file 文件流 @param filePath 文件路径 @param fileName 文件名称

type Upyun

type Upyun struct {
	Operator   string
	Password   string
	BucketName string
	// contains filtered or unexported fields
}

Upyun 又拍云

func NewUpyun

func NewUpyun(operator string, password string, bucketName string) *Upyun

NewUpyun 初始化 https://github.com/upyun/go-sdk

func (*Upyun) Bucket

func (c *Upyun) Bucket(name string) *Upyun

Bucket 存储空间

func (*Upyun) PutObject

func (c *Upyun) PutObject(file io.Reader, filePath, fileName, acl string) (resp FileInfo, err error)

PutObject 上传文件流 @param file 文件流 @param filePath 文件路径 @param fileName 文件名称

Jump to

Keyboard shortcuts

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