Documentation
¶
Index ¶
- Constants
- func GenTypeAUrl(link string, key string, signName string, uid string, timestamp int64) (string, error)
- func GenTypeBUrl(link string, key string, timestamp int64) (string, error)
- func GenTypeCUrl(link string, key string, timestamp int64) (string, error)
- func GenTypeDUrl(link, key, signName, timeName string, timestamp int64, base int) (string, error)
- func GenTypeEUrl(link, key, signName, tsName string, timestamp int64, base int) (string, error)
- func GetUploadCallbackParams(r *http.Request) ([]byte, error)
- type CdnAccessLog
- type CdnClient
- func (c CdnClient) AddCertificate(req *cdn.AddCdnCertificateRequest) (*cdn.AddCdnCertificateResponse, error)
- func (c CdnClient) AnalyzeCdnAccessLog(logPath string, handler func(*CdnAccessLog) error) error
- func (c CdnClient) BatchDeployCert(req *cdn.BatchDeployCertRequest) (*cdn.BatchDeployCertResponse, error)
- func (c CdnClient) DescribeCdnAccessLog(req *cdn.DescribeCdnAccessLogRequest, options ...cdn.OptionArg) (*cdn.DescribeCdnAccessLogResponse, error)
- func (c CdnClient) DescribeCdnConfig(req *cdn.DescribeCdnConfigRequest) (*cdn.DescribeCdnConfigResponse, error)
- func (c CdnClient) DescribeCdnData(req *cdn.DescribeCdnDataRequest, options ...cdn.OptionArg) (*cdn.DescribeCdnDataResponse, error)
- func (c CdnClient) DescribeContentQuota(options ...cdn.OptionArg) (*cdn.DescribeContentQuotaResponse, error)
- func (c CdnClient) DescribeContentTasks(req *cdn.DescribeContentTasksRequest) (*cdn.DescribeContentTasksResponse, error)
- func (c CdnClient) DescribeDistrictData(req *cdn.DescribeDistrictDataRequest) (*cdn.DescribeDistrictDataResponse, error)
- func (c CdnClient) DescribeDistrictSummary(req *cdn.DescribeDistrictSummaryRequest) (*cdn.DescribeDistrictSummaryResponse, error)
- func (c CdnClient) DescribeStatisticalRanking(req *cdn.DescribeStatisticalRankingRequest) (*cdn.DescribeStatisticalRankingResponse, error)
- func (c CdnClient) ListDomains(req *cdn.ListCdnDomainsRequest, options ...cdn.OptionArg) (*cdn.ListCdnDomainsResponse, error)
- func (c CdnClient) SubmitPreloadTask(req *cdn.SubmitPreloadTaskRequest) (*cdn.SubmitPreloadTaskResponse, error)
- func (c CdnClient) SubmitRefreshTask(req *cdn.SubmitRefreshTaskRequest) (*cdn.SubmitRefreshTaskResponse, error)
- func (c CdnClient) UpdateCdnConfig(req *cdn.UpdateCdnConfigRequest) (*cdn.UpdateCdnConfigResponse, error)
- type OssClient
- func (c OssClient) AppendObject(ctx context.Context, req *tos.AppendObjectV2Input) (*tos.AppendObjectV2Output, error)
- func (c OssClient) DeleteObject(ctx context.Context, req *tos.DeleteObjectV2Input) (*tos.DeleteObjectV2Output, error)
- func (c OssClient) HeadObject(ctx context.Context, req *tos.HeadObjectV2Input) (*tos.HeadObjectV2Output, error)
- func (c OssClient) ListObjectsType2(ctx context.Context, req *tos.ListObjectsType2Input) (*tos.ListObjectsType2Output, error)
- func (c OssClient) PreSignedPostSignature(ctx context.Context, req *tos.PreSingedPostSignatureInput) (*tos.PreSingedPostSignatureOutput, error)
- func (c OssClient) PreSignedURL(req *tos.PreSignedURLInput) (*tos.PreSignedURLOutput, error)
- func (c OssClient) PutObject(ctx context.Context, req *tos.PutObjectV2Input) (*tos.PutObjectV2Output, error)
- func (c OssClient) RenameObject(ctx context.Context, req *tos.RenameObjectInput) (*tos.RenameObjectOutput, error)
- func (c OssClient) RestoreObject(ctx context.Context, req *tos.RestoreObjectInput) (*tos.RestoreObjectOutput, error)
Constants ¶
const TosAuthorization = "Authorization"
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
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
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
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
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.
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 (CdnClient) AddCertificate ¶
func (c CdnClient) AddCertificate(req *cdn.AddCdnCertificateRequest) (*cdn.AddCdnCertificateResponse, error)
AddCertificate 上传证书
func (CdnClient) AnalyzeCdnAccessLog ¶ added in v0.0.33
func (c CdnClient) AnalyzeCdnAccessLog(logPath string, handler func(*CdnAccessLog) error) error
func (CdnClient) BatchDeployCert ¶
func (c CdnClient) BatchDeployCert(req *cdn.BatchDeployCertRequest) (*cdn.BatchDeployCertResponse, error)
BatchDeployCert 关联证书与加速域名
func (CdnClient) DescribeCdnAccessLog ¶
func (c CdnClient) DescribeCdnAccessLog(req *cdn.DescribeCdnAccessLogRequest, options ...cdn.OptionArg) (*cdn.DescribeCdnAccessLogResponse, error)
DescribeCdnAccessLog 获取访问日志的下载链接
func (CdnClient) DescribeCdnConfig ¶
func (c CdnClient) DescribeCdnConfig(req *cdn.DescribeCdnConfigRequest) (*cdn.DescribeCdnConfigResponse, error)
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 ¶
func (c CdnClient) DescribeContentTasks(req *cdn.DescribeContentTasksRequest) (*cdn.DescribeContentTasksResponse, error)
DescribeContentTasks 获取刷新与预热任务列表
func (CdnClient) DescribeDistrictData ¶
func (c CdnClient) DescribeDistrictData(req *cdn.DescribeDistrictDataRequest) (*cdn.DescribeDistrictDataResponse, error)
DescribeDistrictData 获取访问统计的细分数据
func (CdnClient) DescribeDistrictSummary ¶
func (c CdnClient) DescribeDistrictSummary(req *cdn.DescribeDistrictSummaryRequest) (*cdn.DescribeDistrictSummaryResponse, error)
DescribeDistrictSummary 获取访问统计的汇总数据
func (CdnClient) DescribeStatisticalRanking ¶
func (c CdnClient) DescribeStatisticalRanking(req *cdn.DescribeStatisticalRankingRequest) (*cdn.DescribeStatisticalRankingResponse, error)
func (CdnClient) ListDomains ¶
func (c CdnClient) ListDomains(req *cdn.ListCdnDomainsRequest, options ...cdn.OptionArg) (*cdn.ListCdnDomainsResponse, error)
ListDomains 获取加速域名列表
func (CdnClient) SubmitPreloadTask ¶
func (c CdnClient) SubmitPreloadTask(req *cdn.SubmitPreloadTaskRequest) (*cdn.SubmitPreloadTaskResponse, error)
SubmitPreloadTask 提交预热任务 节流限制:您每秒最多可以发送 20 个请求。
默认情况下,每个火山引擎主账号的任务额度如下: 每天最多预热 1,000 个 URL。 每个任务最多预热 100 个 URL。
func (CdnClient) SubmitRefreshTask ¶
func (c CdnClient) SubmitRefreshTask(req *cdn.SubmitRefreshTaskRequest) (*cdn.SubmitRefreshTaskResponse, error)
SubmitRefreshTask 提交刷新任务 节流限制:您每秒最多可以发送 20 个请求。
默认情况下,每个火山引擎主账号的刷新额度如下: 每天最多刷新 1,000 个 URL。 每天最多刷新 50 个目录。 每个任务可以包含 100 个 URL 或目录。
func (CdnClient) UpdateCdnConfig ¶
func (c CdnClient) UpdateCdnConfig(req *cdn.UpdateCdnConfigRequest) (*cdn.UpdateCdnConfigResponse, error)
UpdateCdnConfig 修改加速域名配置
type OssClient ¶
type OssClient struct {
// contains filtered or unexported fields
}
func NewOssClient ¶
func (OssClient) AppendObject ¶
func (c OssClient) AppendObject(ctx context.Context, req *tos.AppendObjectV2Input) (*tos.AppendObjectV2Output, error)
AppendObject 追加上传
func (OssClient) DeleteObject ¶
func (c OssClient) DeleteObject(ctx context.Context, req *tos.DeleteObjectV2Input) (*tos.DeleteObjectV2Output, error)
DeleteObject 删除对象
func (OssClient) HeadObject ¶
func (c OssClient) HeadObject(ctx context.Context, req *tos.HeadObjectV2Input) (*tos.HeadObjectV2Output, error)
HeadObject 查询对象元数据信息(判断对象是否存在)
func (OssClient) ListObjectsType2 ¶
func (c OssClient) ListObjectsType2(ctx context.Context, req *tos.ListObjectsType2Input) (*tos.ListObjectsType2Output, error)
ListObjectsType2 列举对象
func (OssClient) PreSignedPostSignature ¶
func (c OssClient) PreSignedPostSignature(ctx context.Context, req *tos.PreSingedPostSignatureInput) (*tos.PreSingedPostSignatureOutput, error)
PreSignedPostSignature Post表单预签名
func (OssClient) PreSignedURL ¶ added in v0.0.33
func (c OssClient) PreSignedURL(req *tos.PreSignedURLInput) (*tos.PreSignedURLOutput, error)
PreSignedURL 普通预签名上传
func (OssClient) PutObject ¶
func (c OssClient) PutObject(ctx context.Context, req *tos.PutObjectV2Input) (*tos.PutObjectV2Output, error)
PutObject 普通上传
func (OssClient) RenameObject ¶
func (c OssClient) RenameObject(ctx context.Context, req *tos.RenameObjectInput) (*tos.RenameObjectOutput, error)
RenameObject 重命名对象
func (OssClient) RestoreObject ¶
func (c OssClient) RestoreObject(ctx context.Context, req *tos.RestoreObjectInput) (*tos.RestoreObjectOutput, error)
RestoreObject 恢复对象