2 Star 0 Fork 0

TeamsHub/backend-gopkg

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
cdn_service.go 2.06 KB
一键复制 编辑 原始数据 按行查看 历史
HCY 提交于 2024-05-10 13:07 . edit pkg
package cdn
import (
"errors"
"gitee.com/wuzheng0709/backend-gopkg/infrastructure/pkg/live/aliyun-live-go-sdk/client"
)
// 服务操作接口
// -------------------------------------------------------------------------------
// OpenCdnService 开通CDN服务
// internetChargeType 开通服务的计费类型(默认按流量) 按流量(PayByTraffic)、按带宽峰值(PayByBandwidth)。
//
// 常量 PayByTrafficType(PayByTraffic)和PayByBandwidthType(PayByBandwidth)
//
// @link https://help.aliyun.com/document_detail/27157.html?spm=0.0.0.0.t6wFRF
func (c *CDN) OpenCdnService(internetChargeType CdnPayType, resp interface{}) (err error) {
req := c.cdnReq.Clone().(*client.CDNRequest)
req.Action = OpenCdnServiceAction
if PayNullType == internetChargeType {
internetChargeType = PayByTrafficType
}
req.SetArgs("InternetChargeType", string(internetChargeType))
err = c.rpc.Query(req, resp)
return
}
// ScanCdnService 查询CDN服务状态。包括:当前计费类型,服务开通时间,下次生效的计费类型,当前业务状态等。
//
// @link https://help.aliyun.com/document_detail/27158.html?spm=0.0.0.0.2RRuSQ
func (c *CDN) ScanCdnService(resp interface{}) (err error) {
req := c.cdnReq.Clone().(*client.CDNRequest)
req.Action = DescribeCdnServiceAction
err = c.rpc.Query(req, resp)
return
}
// ModifyCdnServicePayType 变更CDN服务的计费类型.
// internetChargeType 开通服务的计费类型(默认按流量) 按流量(PayByTraffic)、按带宽峰值(PayByBandwidth)。
// 常量 PayByTrafficType(PayByTraffic)和PayByBandwidthType(PayByBandwidth)
//
// @link https://help.aliyun.com/document_detail/27159.html?spm=0.0.0.0.AuPm7B
func (c *CDN) ModifyCdnServicePayType(internetChargeType CdnPayType, resp interface{}) (err error) {
req := c.cdnReq.Clone().(*client.CDNRequest)
req.Action = ModifyCdnServiceAction
if PayNullType == internetChargeType {
err = errors.New("internetChargeType should not be empty")
return
}
req.SetArgs("InternetChargeType", string(internetChargeType))
err = c.rpc.Query(req, resp)
return
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wuzheng0709/backend-gopkg.git
git@gitee.com:wuzheng0709/backend-gopkg.git
wuzheng0709
backend-gopkg
backend-gopkg
v1.4.16

搜索帮助