volcenginecloud

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const TosAuthorization = "Authorization"
View Source
const XTosPublicKeyUrl = "x-tos-pub-key-url"

Variables

This section is empty.

Functions

func GenTypeAUrl added in v0.0.33

func GenTypeAUrl(link string, key string, signName string, uid string, timestamp int64) (string, error)

GenTypeAUrl generates a signed URL of type A. It takes a link, key, signName, uid, and timestamp as input parameters. The function parses the URL, generates a random string, and creates a hash using the provided parameters. It then constructs the signed URL with the generated hash and returns it. For more details, refer to the documentation: https://www.volcengine.com/docs/6454/99849#%E7%AD%BE%E5%90%8D%E8%AE%A1%E7%AE%97%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81

func GenTypeBUrl added in v0.0.33

func GenTypeBUrl(link string, key string, timestamp int64) (string, error)

GenTypeBUrl generates a signed URL of type B. It takes a link, key, and timestamp as input parameters. The function parses the URL, formats the timestamp, and creates a hash using the provided parameters. It then constructs the signed URL with the generated hash and returns it.

func GenTypeCUrl added in v0.0.33

func GenTypeCUrl(link string, key string, timestamp int64) (string, error)

GenTypeCUrl generates a signed URL of type C. It takes a link, key, and timestamp as input parameters. The function parses the URL, converts the timestamp to a hexadecimal string, and creates a hash using the provided parameters. It then constructs the signed URL with the generated hash and returns it.

func GenTypeDUrl added in v0.0.33

func GenTypeDUrl(link, key, signName, timeName string, timestamp int64, base int) (string, error)

GenTypeDUrl generates a signed URL of type D. It takes a link, key, signName, timeName, timestamp, and base as input parameters. The function parses the URL, converts the timestamp to a string in the specified base, and creates a hash using the provided parameters. It then constructs the signed URL with the generated hash and returns it.

func GenTypeEUrl added in v0.0.33

func GenTypeEUrl(link, key, signName, tsName string, timestamp int64, base int) (string, error)

GenTypeEUrl generates a signed URL of type E by custom rule (e.g., key+domain+uri+timestamp). It takes a link, key, signName, tsName, timestamp, and base as input parameters. The function parses the URL, converts the timestamp to a string in the specified base, and creates a hash using the provided parameters. It then constructs the signed URL with the generated hash and returns it.

func GetUploadCallbackParams added in v0.0.33

func GetUploadCallbackParams(r *http.Request) ([]byte, error)

GetUploadCallbackParams 校验上传回调并返回body

Types

type CdnAccessLog added in v0.0.33

type CdnAccessLog struct {
	// 请求结束时间
	ReqTime string
	// 客户端ip
	ClientIp string
	// 请求响应时间
	RespTime float64
	// 请求使用的方法
	Method string
	// 请求 URL 中的 scheme
	Scheme string
	// 请求 URL 中的 域名
	Domain string
	// 请求 URL 中的路径和查询字符串,以斜杠(/)开头
	Url string
	// 请求使用的 HTTP 协议版本。
	HttpProtocol string
	// CDN 的响应状态码。
	StatusCode int64
	// CDN 向用户传输的数据量,单位是 bytes。
	RespSize int64
	// 请求是否命中 CDN 的缓存。
	BdStatusHit string
	// 请求中 Range 头部的值。如果请求不包含该头部,该字段的值是 -
	Range string
	// 请求中 Referer 头部的值。如果请求不包含该头部,该字段的值是 -
	Referer string
	// 请求中 User-Agent 头部的值。如果请求不包含该头部,该字段的值是 -
	UserAgent string
	// CDN 响应中 Content-Type 头部的值。如果响应不包含该头部,该字段的值是 -。
	ContentType string
}

CdnAccessLog CDN访问日志 Cdn日志字段说明:https://www.volcengine.com/docs/6454/71376

type CdnClient

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

func NewCdnClient

func NewCdnClient(accessKey, secretKey string) *CdnClient

func (CdnClient) AddCertificate

AddCertificate 上传证书

func (CdnClient) AnalyzeCdnAccessLog added in v0.0.33

func (c CdnClient) AnalyzeCdnAccessLog(logPath string, handler func(*CdnAccessLog) error) error

func (CdnClient) BatchDeployCert

BatchDeployCert 关联证书与加速域名

func (CdnClient) DescribeCdnAccessLog

func (c CdnClient) DescribeCdnAccessLog(req *cdn.DescribeCdnAccessLogRequest, options ...cdn.OptionArg) (*cdn.DescribeCdnAccessLogResponse, error)

DescribeCdnAccessLog 获取访问日志的下载链接

func (CdnClient) DescribeCdnConfig

DescribeCdnConfig 获取加速域名配置

func (CdnClient) DescribeCdnData

func (c CdnClient) DescribeCdnData(req *cdn.DescribeCdnDataRequest, options ...cdn.OptionArg) (*cdn.DescribeCdnDataResponse, error)

DescribeCdnData 获取访问统计的细分数据

func (CdnClient) DescribeContentQuota

func (c CdnClient) DescribeContentQuota(options ...cdn.OptionArg) (*cdn.DescribeContentQuotaResponse, error)

DescribeContentQuota 获取刷新、预热、封禁、解封的配额

func (CdnClient) DescribeContentTasks

DescribeContentTasks 获取刷新与预热任务列表

func (CdnClient) DescribeDistrictData

DescribeDistrictData 获取访问统计的细分数据

func (CdnClient) DescribeDistrictSummary

DescribeDistrictSummary 获取访问统计的汇总数据

func (CdnClient) ListDomains

func (c CdnClient) ListDomains(req *cdn.ListCdnDomainsRequest, options ...cdn.OptionArg) (*cdn.ListCdnDomainsResponse, error)

ListDomains 获取加速域名列表

func (CdnClient) SubmitPreloadTask

SubmitPreloadTask 提交预热任务 节流限制:您每秒最多可以发送 20 个请求。

默认情况下,每个火山引擎主账号的任务额度如下:
每天最多预热 1,000 个 URL。
每个任务最多预热 100 个 URL。

func (CdnClient) SubmitRefreshTask

SubmitRefreshTask 提交刷新任务 节流限制:您每秒最多可以发送 20 个请求。

默认情况下,每个火山引擎主账号的刷新额度如下:
每天最多刷新 1,000 个 URL。
每天最多刷新 50 个目录。
每个任务可以包含 100 个 URL 或目录。

func (CdnClient) UpdateCdnConfig

UpdateCdnConfig 修改加速域名配置

type OssClient

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

func NewOssClient

func NewOssClient(accessKey, secretKey, endpoint, region string) (*OssClient, error)

func (OssClient) AppendObject

AppendObject 追加上传

func (OssClient) DeleteObject

DeleteObject 删除对象

func (OssClient) HeadObject

HeadObject 查询对象元数据信息(判断对象是否存在)

func (OssClient) ListObjectsType2

ListObjectsType2 列举对象

func (OssClient) PreSignedPostSignature

PreSignedPostSignature Post表单预签名

func (OssClient) PreSignedURL added in v0.0.33

func (c OssClient) PreSignedURL(req *tos.PreSignedURLInput) (*tos.PreSignedURLOutput, error)

PreSignedURL 普通预签名上传

func (OssClient) PutObject

PutObject 普通上传

func (OssClient) RenameObject

func (c OssClient) RenameObject(ctx context.Context, req *tos.RenameObjectInput) (*tos.RenameObjectOutput, error)

RenameObject 重命名对象

func (OssClient) RestoreObject

RestoreObject 恢复对象

Jump to

Keyboard shortcuts

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