ufile

package
v0.21.28 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Overview

Package ufile include resources of ucloud ufile product

See also

for detail.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateBucketRequest

type CreateBucketRequest struct {
	request.CommonBase

	// 待创建Bucket的名称,具有全局唯一性
	BucketName *string `required:"true"`

	// Bucket访问类型,public或private; 默认为private
	Type *string `required:"false"`
}

CreateBucketRequest is request schema for CreateBucket action

type CreateBucketResponse

type CreateBucketResponse struct {
	response.CommonBase

	// 已创建Bucket的ID
	BucketId string

	// 已创建Bucket的名称
	BucketName string
}

CreateBucketResponse is response schema for CreateBucket action

type CreateUFileTokenRequest

type CreateUFileTokenRequest struct {
	request.CommonBase

	// 令牌允许操作的bucket,默认*表示全部
	AllowedBuckets []string `required:"false"`

	// 令牌允许执行的操作,[ TOKEN_ALLOW_NONE , TOKEN_ALLOW_READ , TOKEN_ALLOW_WRITE , TOKEN_ALLOW_DELETE , TOKEN_ALLOW_LIST, TOKEN_ALLOW_IOP , TOKEN_ALLOW_DP  ]。默认TOKEN_ALLOW_NONE
	AllowedOps []string `required:"false"`

	// 令牌允许操作的key前缀,默认*表示全部
	AllowedPrefixes []string `required:"false"`

	// Unix 时间戳,精确到秒,为令牌过期时间点。默认过期时间为一天(即当前Unix时间戳+86400);注意:过期时间不能超过 4102416000
	ExpireTime *int `required:"false"`

	// 令牌名称
	TokenName *string `required:"true"`
}

CreateUFileTokenRequest is request schema for CreateUFileToken action

type CreateUFileTokenResponse

type CreateUFileTokenResponse struct {
	response.CommonBase

	// 创建令牌的token_id
	TokenId string
}

CreateUFileTokenResponse is response schema for CreateUFileToken action

type DeleteBucketRequest

type DeleteBucketRequest struct {
	request.CommonBase

	// 待删除Bucket的名称
	BucketName *string `required:"true"`
}

DeleteBucketRequest is request schema for DeleteBucket action

type DeleteBucketResponse

type DeleteBucketResponse struct {
	response.CommonBase

	// Bucket的ID
	BucketId string

	// Bucket的名称
	BucketName string
}

DeleteBucketResponse is response schema for DeleteBucket action

type DeleteUFileTokenRequest

type DeleteUFileTokenRequest struct {
	request.CommonBase

	// 令牌ID
	TokenId *string `required:"true"`
}

DeleteUFileTokenRequest is request schema for DeleteUFileToken action

type DeleteUFileTokenResponse

type DeleteUFileTokenResponse struct {
	response.CommonBase
}

DeleteUFileTokenResponse is response schema for DeleteUFileToken action

type DescribeBucketRequest

type DescribeBucketRequest struct {
	request.CommonBase

	// 待获取Bucket的名称,若不提供,则获取所有Bucket
	BucketName *string `required:"false"`

	// 获取所有Bucket列表的限制数目,默认为20
	Limit *int `required:"false"`

	// 获取所有Bucket列表的偏移数目,默认为0
	Offset *int `required:"false"`
}

DescribeBucketRequest is request schema for DescribeBucket action

type DescribeBucketResponse

type DescribeBucketResponse struct {
	response.CommonBase

	// Bucket的描述信息 参数见 UFileBucketSet
	DataSet []UFileBucketSet
}

DescribeBucketResponse is response schema for DescribeBucket action

type DescribeUFileTokenRequest

type DescribeUFileTokenRequest struct {
	request.CommonBase

	// 0表示显示部分token信息;不传递和其他情况表示显示全部token信息
	Display *int `required:"false"`

	// 令牌ID,只返回指定ID信息,否则拉取所有令牌
	TokenId *string `required:"false"`

	// 令牌名称,只返回指定令牌名称信息,否则拉取所有令牌
	TokenName *string `required:"false"`
}

DescribeUFileTokenRequest is request schema for DescribeUFileToken action

type DescribeUFileTokenResponse

type DescribeUFileTokenResponse struct {
	response.CommonBase

	// 【该字段已废弃,请谨慎使用】
	Action string `deprecated:"true"`

	// 令牌描述信息
	DataSet []UFileTokenSet

	// 【该字段已废弃,请谨慎使用】
	RetCode int `deprecated:"true"`
}

DescribeUFileTokenResponse is response schema for DescribeUFileToken action

type GetUFileQuotaInfoRequest added in v0.21.3

type GetUFileQuotaInfoRequest struct {
	request.CommonBase

	// 配额类型,取值为storage-volume, download-traffic或request-count
	QuotaType []string `required:"true"`
}

GetUFileQuotaInfoRequest is request schema for GetUFileQuotaInfo action

type GetUFileQuotaInfoResponse added in v0.21.3

type GetUFileQuotaInfoResponse struct {
	response.CommonBase

	// 配额信息数据集
	DataSet []UFileQuotaDataSetItem
}

GetUFileQuotaInfoResponse is response schema for GetUFileQuotaInfo action

type GetUFileQuotaPriceRequest added in v0.21.3

type GetUFileQuotaPriceRequest struct {
	request.CommonBase

	// 下载流量,单位: GB,范围: [0, 60 000],步长:1GB
	DownloadTraffic *int `required:"false"`

	// 请求次数,单位:万次,范围:[0, 1 000 000],步长:1万次
	RequestCount *int `required:"false"`

	// 存储容量,单位: GB*天,范围: [0, 30 000 000],步长:100GB*天
	StorageVolume *int `required:"false"`
}

GetUFileQuotaPriceRequest is request schema for GetUFileQuotaPrice action

type GetUFileQuotaPriceResponse added in v0.21.3

type GetUFileQuotaPriceResponse struct {
	response.CommonBase

	// 待支付价格,单位:分
	Price float64
}

GetUFileQuotaPriceResponse is response schema for GetUFileQuotaPrice action

type GetUFileQuotaRequest added in v0.21.3

type GetUFileQuotaRequest struct {
	request.CommonBase

	// 配额类型,取值为storage-volume, download-traffic或request-count
	QuotaType *string `required:"true"`
}

GetUFileQuotaRequest is request schema for GetUFileQuota action

type GetUFileQuotaResponse added in v0.21.3

type GetUFileQuotaResponse struct {
	response.CommonBase

	// 剩余的配额数值
	LeftQuota float64
}

GetUFileQuotaResponse is response schema for GetUFileQuota action

type GetUFileReportRequest added in v0.21.3

type GetUFileReportRequest struct {
	request.CommonBase

	// 查询结束时间
	EndTime *int `required:"true"`

	// 查询开始时间
	StartTime *int `required:"true"`
}

GetUFileReportRequest is request schema for GetUFileReport action

type GetUFileReportResponse added in v0.21.3

type GetUFileReportResponse struct {
	response.CommonBase

	// 报表内容 参数见 UFileReportSet
	DataSet []UFileReportSet
}

GetUFileReportResponse is response schema for GetUFileReport action

type SetUFileRefererRequest added in v0.21.3

type SetUFileRefererRequest struct {
	request.CommonBase

	// 存储空间名称
	BucketName *string `required:"true"`

	// RefererType为白名单时,RefererAllowNull为false代表不允许空referer访问,为true代表允许空referer访问;此参数默认为 true;
	RefererAllowNull *bool `required:"false"`

	// 开启关闭referer防盗链;关闭防盗链会清空防盗链参数设置,开启防盗链必须指定 RefererType、Referers;开启:on, 关闭:off;
	RefererStatus *string `required:"true"`

	// 防盗链Referer类型,支持两种类型,黑名单和白名单; 1黑名单,2白名单;RefererStatus为"on"时此参数必填;
	RefererType *int `required:"false"`

	// 防盗链Referer规则,支持正则表达式(不支持符号';')
	Referers []string `required:"false"`
}

SetUFileRefererRequest is request schema for SetUFileReferer action

type SetUFileRefererResponse added in v0.21.3

type SetUFileRefererResponse struct {
	response.CommonBase
}

SetUFileRefererResponse is response schema for SetUFileReferer action

type UFileBucketSet

type UFileBucketSet struct {

	// Bucket所属业务, general或vod或udb general: 普通业务; vod: 视频云业务; udb: 云数据库业务
	Biz string

	// Bucket的ID
	BucketId string

	// Bucket名称
	BucketName string

	// 与Bucket关联的CND加速域名的ID列表
	CdnDomainId []string

	// Bucket的创建时间
	CreateTime int

	// Bucket的域名集合 参数见 UFileDomainSet
	Domain UFileDomainSet

	// 是否存在自定义域名。0不存在,1存在,2错误
	HasUserDomain int

	// Bucket的修改时间
	ModifyTime int

	// Bucket所属地域
	Region string

	// 所属业务组
	Tag string

	// Bucket访问类型
	Type string
}

UFileBucketSet - DescribeBucket

type UFileClient

type UFileClient struct {
	*ucloud.Client
}

UFileClient is the client of UFile

func NewClient

func NewClient(config *ucloud.Config, credential *auth.Credential) *UFileClient

NewClient will return a instance of UFileClient

func (*UFileClient) CreateBucket

func (c *UFileClient) CreateBucket(req *CreateBucketRequest) (*CreateBucketResponse, error)

API: CreateBucket

创建Bucket

func (*UFileClient) CreateUFileToken

func (c *UFileClient) CreateUFileToken(req *CreateUFileTokenRequest) (*CreateUFileTokenResponse, error)

API: CreateUFileToken

创建US3令牌

func (*UFileClient) DeleteBucket

func (c *UFileClient) DeleteBucket(req *DeleteBucketRequest) (*DeleteBucketResponse, error)

API: DeleteBucket

删除Bucket

func (*UFileClient) DeleteUFileToken

func (c *UFileClient) DeleteUFileToken(req *DeleteUFileTokenRequest) (*DeleteUFileTokenResponse, error)

API: DeleteUFileToken

删除令牌

func (*UFileClient) DescribeBucket

func (c *UFileClient) DescribeBucket(req *DescribeBucketRequest) (*DescribeBucketResponse, error)

API: DescribeBucket

获取Bucket的描述信息

func (*UFileClient) DescribeUFileToken

API: DescribeUFileToken

获取令牌信息

func (*UFileClient) GetUFileQuota added in v0.21.3

func (c *UFileClient) GetUFileQuota(req *GetUFileQuotaRequest) (*GetUFileQuotaResponse, error)

API: GetUFileQuota

查看配额状态

func (*UFileClient) GetUFileQuotaInfo added in v0.21.3

API: GetUFileQuotaInfo

获取配额信息

func (*UFileClient) GetUFileQuotaPrice added in v0.21.3

API: GetUFileQuotaPrice

根据US3的购买配额,查询需要支付的价格。

func (*UFileClient) GetUFileReport added in v0.21.3

func (c *UFileClient) GetUFileReport(req *GetUFileReportRequest) (*GetUFileReportResponse, error)

API: GetUFileReport

查看配额使用报表

func (*UFileClient) NewCreateBucketRequest

func (c *UFileClient) NewCreateBucketRequest() *CreateBucketRequest

NewCreateBucketRequest will create request of CreateBucket action.

func (*UFileClient) NewCreateUFileTokenRequest

func (c *UFileClient) NewCreateUFileTokenRequest() *CreateUFileTokenRequest

NewCreateUFileTokenRequest will create request of CreateUFileToken action.

func (*UFileClient) NewDeleteBucketRequest

func (c *UFileClient) NewDeleteBucketRequest() *DeleteBucketRequest

NewDeleteBucketRequest will create request of DeleteBucket action.

func (*UFileClient) NewDeleteUFileTokenRequest

func (c *UFileClient) NewDeleteUFileTokenRequest() *DeleteUFileTokenRequest

NewDeleteUFileTokenRequest will create request of DeleteUFileToken action.

func (*UFileClient) NewDescribeBucketRequest

func (c *UFileClient) NewDescribeBucketRequest() *DescribeBucketRequest

NewDescribeBucketRequest will create request of DescribeBucket action.

func (*UFileClient) NewDescribeUFileTokenRequest

func (c *UFileClient) NewDescribeUFileTokenRequest() *DescribeUFileTokenRequest

NewDescribeUFileTokenRequest will create request of DescribeUFileToken action.

func (*UFileClient) NewGetUFileQuotaInfoRequest added in v0.21.3

func (c *UFileClient) NewGetUFileQuotaInfoRequest() *GetUFileQuotaInfoRequest

NewGetUFileQuotaInfoRequest will create request of GetUFileQuotaInfo action.

func (*UFileClient) NewGetUFileQuotaPriceRequest added in v0.21.3

func (c *UFileClient) NewGetUFileQuotaPriceRequest() *GetUFileQuotaPriceRequest

NewGetUFileQuotaPriceRequest will create request of GetUFileQuotaPrice action.

func (*UFileClient) NewGetUFileQuotaRequest added in v0.21.3

func (c *UFileClient) NewGetUFileQuotaRequest() *GetUFileQuotaRequest

NewGetUFileQuotaRequest will create request of GetUFileQuota action.

func (*UFileClient) NewGetUFileReportRequest added in v0.21.3

func (c *UFileClient) NewGetUFileReportRequest() *GetUFileReportRequest

NewGetUFileReportRequest will create request of GetUFileReport action.

func (*UFileClient) NewSetUFileRefererRequest added in v0.21.3

func (c *UFileClient) NewSetUFileRefererRequest() *SetUFileRefererRequest

NewSetUFileRefererRequest will create request of SetUFileReferer action.

func (*UFileClient) NewUpdateBucketRequest

func (c *UFileClient) NewUpdateBucketRequest() *UpdateBucketRequest

NewUpdateBucketRequest will create request of UpdateBucket action.

func (*UFileClient) NewUpdateUFileTokenRequest

func (c *UFileClient) NewUpdateUFileTokenRequest() *UpdateUFileTokenRequest

NewUpdateUFileTokenRequest will create request of UpdateUFileToken action.

func (*UFileClient) SetUFileReferer added in v0.21.3

func (c *UFileClient) SetUFileReferer(req *SetUFileRefererRequest) (*SetUFileRefererResponse, error)

API: SetUFileReferer

设置对象存储防盗链

func (*UFileClient) UpdateBucket

func (c *UFileClient) UpdateBucket(req *UpdateBucketRequest) (*UpdateBucketResponse, error)

API: UpdateBucket

更改Bucket的属性

func (*UFileClient) UpdateUFileToken

func (c *UFileClient) UpdateUFileToken(req *UpdateUFileTokenRequest) (*UpdateUFileTokenResponse, error)

API: UpdateUFileToken

更新令牌的操作权限,可操作key的前缀,可操作bucket和令牌超时时间点

type UFileDomainSet

type UFileDomainSet struct {

	// UCDN加速域名
	Cdn []string

	// 用户自定义CDN加速域名
	CustomCdn []string

	// 用户自定义源站域名
	CustomSrc []string

	// 源站域名
	Src []string
}

UFileDomainSet - DescribeBucket

type UFileQuotaDataSetItem added in v0.21.3

type UFileQuotaDataSetItem struct {

	// 剩余下载流量
	DownloadFlow UFileQuotaLeft

	// 是否欠费:1表示欠费;0表示未欠费
	Owe int

	// 可用地域
	Region string

	// 剩余请求次数
	RequestCnt UFileQuotaLeft

	// 剩余存储容量
	Storage UFileQuotaLeft
}

UFileQuotaDataSetItem - 配额信息

type UFileQuotaLeft added in v0.21.3

type UFileQuotaLeft struct {

	// 配额剩余量
	Left float64
}

UFileQuotaLeft - 配额剩余量

type UFileReportSet added in v0.21.3

type UFileReportSet struct {

	// 配额消费当日使用的下载流量,单位:GB
	DownloadTraffic float64

	// 配额消费当日使用的请求次数,单位:万次
	RequestCount float64

	// 配额消费当日使用的存储容量,单位:GB*天
	StorageVolume float64

	// 配额消费时间,unix时间戳,精确到日期
	Time int
}

UFileReportSet - GetUFileReport

type UFileTokenSet

type UFileTokenSet struct {

	// 令牌允许操作的bucket
	AllowedBuckets []string

	// 令牌允许执行的操作,[ TOKEN_ALLOW_NONE , TOKEN_ALLOW_READ , TOKEN_ALLOW_WRITE , TOKEN_ALLOW_DELETE , TOKEN_ALLOW_LIST, TOKEN_ALLOW_IOP , TOKEN_ALLOW_DP ]
	AllowedOps []string

	// 令牌允许操作的key前缀
	AllowedPrefixes []string

	// 创建时间
	CreateTime int

	// 令牌的超时时间点
	ExpireTime int

	// 修改时间
	ModifyTime int

	// 令牌私钥
	PrivateKey string

	// 令牌公钥
	PublicKey string

	// 所属地区
	Region string

	// 令牌ID
	TokenId string

	// 令牌名称
	TokenName string
}

UFileTokenSet - ufile令牌集合

type UpdateBucketRequest

type UpdateBucketRequest struct {
	request.CommonBase

	// 待修改Bucket的名称
	BucketName *string `required:"true"`

	// Bucket访问类型;public或private
	Type *string `required:"true"`
}

UpdateBucketRequest is request schema for UpdateBucket action

type UpdateBucketResponse

type UpdateBucketResponse struct {
	response.CommonBase

	// Bucket的ID
	BucketId string

	// Bucket的名称
	BucketName string
}

UpdateBucketResponse is response schema for UpdateBucket action

type UpdateUFileTokenRequest

type UpdateUFileTokenRequest struct {
	request.CommonBase

	// 令牌允许操作的bucket
	AllowedBuckets []string `required:"false"`

	// 令牌允许执行的操作,[ TOKEN_ALLOW_NONE , TOKEN_ALLOW_READ , TOKEN_ALLOW_WRITE , TOKEN_ALLOW_DELETE , TOKEN_ALLOW_LIST, TOKEN_ALLOW_IOP , TOKEN_ALLOW_DP ]
	AllowedOps []string `required:"false"`

	// 令牌允许操作的key前缀
	AllowedPrefixes []string `required:"false"`

	// 令牌的超时时间点(时间戳);注意:过期时间不能超过 4102416000
	ExpireTime *int `required:"false"`

	// 令牌ID
	TokenId *string `required:"true"`

	// 令牌名称
	TokenName *string `required:"false"`
}

UpdateUFileTokenRequest is request schema for UpdateUFileToken action

type UpdateUFileTokenResponse

type UpdateUFileTokenResponse struct {
	response.CommonBase
}

UpdateUFileTokenResponse is response schema for UpdateUFileToken action

Jump to

Keyboard shortcuts

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