Documentation
¶
Index ¶
- Constants
- Variables
- type AsyncData
- type AsyncResp
- type CheckResponseReq
- type CheckResponseResp
- type CreateServiceData
- type CreateServiceReq
- type CreateServiceResp
- type DeletePackagesReq
- type DeletePackagesResp
- type DeletePackagesSinglePackage
- type DeleteServiceReq
- type DeleteServiceResp
- type Diff
- func (d *Diff) CheckResponse(request *CheckResponseReq) (response *CheckResponseResp, result interface{}, status int, err error)
- func (d *Diff) CreateService(request *CreateServiceReq, appid int64) (response *CreateServiceResp, status int, err error)
- func (d *Diff) DeletePackages(request *DeletePackagesReq, appid int64) (response *DeletePackagesResp, status int, err error)
- func (d *Diff) DeleteService(request *DeleteServiceReq, appid int64) (response *DeleteServiceResp, status int, err error)
- func (d *Diff) GenByCount(request *GenByCountReq, appid int64) (response *AsyncResp, status int, err error)
- func (d *Diff) GenByPkg(request *GenByPkgReq, appid int64) (response *AsyncResp, status int, err error)
- func (d *Diff) GenByVersion(request *GenByVersionReq, appid int64) (response *AsyncResp, status int, err error)
- func (d *Diff) QueryPatchByService(request *QueryPatchByServiceReq, appid int64) (response *QueryPatchByServiceResp, status int, err error)
- func (d *Diff) Validate(request *ValidateReq) (response *AsyncResp, status int, err error)
- type GenByCountReq
- type GenByPkgReq
- type GenByVersionReq
- type GenResult
- type QueryPatchByServiceReq
- type QueryPatchByServiceResp
- type RespInfo
- type RespPatch
- type RespQueryPatchByService
- type RespQueryPatchByServiceOverview
- type RespQueryPatchByServicePatch
- type ValidateData
- type ValidateReq
- type ValidateResult
Constants ¶
View Source
const ( ServiceName = "veMARS" ApiVersion = "2022-04-19" DefaultTimeout = 10 * time.Second //DefaultHost = "vemars.volcengineapi.com" DefaultHost = "open.volcengineapi.com" DefaultRegion = "cn-north-1" )
Variables ¶
View Source
var DefaultInstance = newInstance()
Functions ¶
This section is empty.
Types ¶
type AsyncData ¶
type AsyncData struct {
TaskId int64 `json:"task_id"` // 生成差分包请求的id(后续用这个id查询生成结果)
}
type CheckResponseReq ¶
type CheckResponseReq struct {
TaskId int64 `json:"task_id"` // 任务ID
}
CheckResponseReq check_response
type CheckResponseResp ¶
type CheckResponseResp struct {
RespInfo
Data *checkResponseData `json:"data"`
}
type CreateServiceData ¶
type CreateServiceData struct {
ServiceId int `json:"service_id"` // 新建好服务的id
}
type CreateServiceReq ¶
type CreateServiceReq struct {
Name string `json:"name"` // 服务名称
Comment string `json:"comment"` // 备注信息(可选)
}
CreateServiceReq create_service
type CreateServiceResp ¶
type CreateServiceResp struct {
RespInfo
Data *CreateServiceData `json:"data"`
}
type DeletePackagesReq ¶
type DeletePackagesReq struct {
ServiceId int `json:"service_id"` // 服务id
OldVersions []uint64 `json:"old_versions"` // 需要删除差分包的版本
}
DeletePackagesReq 删除原始包
type DeletePackagesResp ¶
type DeletePackagesResp struct {
RespInfo
Data *[]DeletePackagesSinglePackage `json:"data"`
}
type DeletePackagesSinglePackage ¶
type DeletePackagesSinglePackage struct {
Code int `json:"code"` // 删除状态
CreatedAt int64 `json:"created_at"` // 上传时间
ServiceId int `json:"service_id"` // 原始包所在Service
Url string `json:"package_url"` // 原始包下载地址
Md5 string `json:"package_md5"` // 原始包MD5
Size int64 `json:"package_size"` // 原始包Size
Version uint64 `json:"version"` // 原始包版本
NewPackageCount int `json:"new_package_count"` // 删除的该包作为新包的差分包个数
OldPackageCount int `json:"old_package_count"` // 删除的该包作为原始包的差分包个数
}
type DeleteServiceReq ¶
type DeleteServiceReq struct {
ServiceId int `json:"service_id"` // 需要删除的服务的ID
}
DeleteServiceReq 删除服务
type DeleteServiceResp ¶
type DeleteServiceResp struct {
RespInfo
}
type Diff ¶
func (*Diff) CheckResponse ¶
func (d *Diff) CheckResponse(request *CheckResponseReq) (response *CheckResponseResp, result interface{}, status int, err error)
CheckResponse : 查询某个任务是否完成,如果完成会返回任务的处理结果 当response.Code = 0时,任务处理完成,result中会有值 当任务为生成差分包时(response.Data.Api = 0),result会返回GenResult结构体 当任务为验证差分包时(response.Data.Api = 1),result会返回ValidateResult结构体
func (*Diff) CreateService ¶
func (d *Diff) CreateService(request *CreateServiceReq, appid int64) (response *CreateServiceResp, status int, err error)
CreateService : 新建服务
func (*Diff) DeletePackages ¶
func (d *Diff) DeletePackages(request *DeletePackagesReq, appid int64) (response *DeletePackagesResp, status int, err error)
DeletePackages : 删除原始包
func (*Diff) DeleteService ¶
func (d *Diff) DeleteService(request *DeleteServiceReq, appid int64) (response *DeleteServiceResp, status int, err error)
DeleteService : 删除服务
func (*Diff) GenByCount ¶
func (d *Diff) GenByCount(request *GenByCountReq, appid int64) (response *AsyncResp, status int, err error)
GenByCount : 根据传入的个数生成差分包
func (*Diff) GenByPkg ¶
func (d *Diff) GenByPkg(request *GenByPkgReq, appid int64) (response *AsyncResp, status int, err error)
GenByPkg : 根据传入的原始包和新包生成差分包
func (*Diff) GenByVersion ¶
func (d *Diff) GenByVersion(request *GenByVersionReq, appid int64) (response *AsyncResp, status int, err error)
GenByVersion : 根据传入的版本生成差分包
func (*Diff) QueryPatchByService ¶
func (d *Diff) QueryPatchByService(request *QueryPatchByServiceReq, appid int64) (response *QueryPatchByServiceResp, status int, err error)
QueryPatchByService : 查看服务中的包信息
type GenByCountReq ¶
type GenByCountReq struct {
ServiceId int `json:"service_id"` // 服务id
Alg string `json:"alg"` // 差分算法
Options map[string]interface{} `json:"options"` // 配置项, key-value字典
NewUrl string `json:"new_url"` // 新包url
NewVersion uint64 `json:"new_version"` // 新包版本
NewExtraInfo string `json:"new_extra_info"` // 业务方对于新包的附带信息
Count int8 `json:"count"` // 需要生成的差分包的个数
}
GenByCountReq gen_by_count
type GenByPkgReq ¶
type GenByPkgReq struct {
ServiceId int `json:"service_id"` // 服务id
Alg string `json:"alg"` // 差分算法
Options map[string]interface{} `json:"options"` // 配置项, key-value字典
OldUrl string `json:"old_url"` // 原始包url
OldVersion uint64 `json:"old_version"` // 原始包版本
OldExtraInfo string `json:"old_extra_info"` // 业务方对于原始包的附带信息
NewUrl string `json:"new_url"` // 新包url
NewVersion uint64 `json:"new_version"` // 新包版本
NewExtraInfo string `json:"new_extra_info"` // 业务方对于新包的附带信息
}
GenByPkgReq gen_by_pkg
type GenByVersionReq ¶
type GenByVersionReq struct {
ServiceId int `json:"service_id"` // 服务id
Alg string `json:"alg"` // 差分算法
Options map[string]interface{} `json:"options"` // 配置项
NewUrl string `json:"new_url"` // 新包url
NewVersion uint64 `json:"new_version"` // 新包版本
NewExtraInfo string `json:"new_extra_info"` // 业务方对于新包的附带信息
OldVersions []uint64 `json:"old_versions"` // 需要生成差分包的原始包版本
}
GenByVersionReq gen_by_version
type QueryPatchByServiceReq ¶
type QueryPatchByServiceReq struct {
ServiceId int `json:"service_id"` // service id
StartTime int64 `json:"start_time"` // 起始时间(包含)(可选)
EndTime int64 `json:"end_time"` // 结束时间(包含)(可选)
StartVersion uint64 `json:"start_version"` // 起始版本(包含)(可选)
EndVersion uint64 `json:"end_version"` // 最终版本(包含)(可选)
NoPatches bool `json:"no_patches"` // 不包含差分包信息(可选)
}
QueryPatchByServiceReq 查看服务中的包信息
type QueryPatchByServiceResp ¶
type QueryPatchByServiceResp struct {
RespInfo
Data *RespQueryPatchByServiceOverview `json:"data"`
}
type RespPatch ¶
type RespPatch struct {
Code int `json:"code"` // 差分包状态
ID uint `json:"id"` // 唯一ID
CreatedAt int64 `json:"created_at"` // 创建时间(毫秒)
Url string `json:"patch_url"` // patch包地址
Md5 string `json:"patch_md5"` // patch包MD5
Size int64 `json:"patch_size"` // patch包Size
Alg string `json:"alg"` // 差分算法类型
Ratio float64 `json:"ratio"` // 差分效率
NewVersion uint64 `json:"new_version"` // 新包版本
NewExtraInfo string `json:"new_extra_info"` // 业务方传入的新包附带信息
OldVersion uint64 `json:"old_version"` // 原始包版本
OldInfo string `json:"old_info"` // 真正参与差分的原始包的信息
OldExtraInfo string `json:"old_extra_info"` // 业务方传入的原始包包附带信息
MinSdkVersion int `json:"min_sdk_version"` // 最小支持的sdk版本号
}
type RespQueryPatchByService ¶
type RespQueryPatchByService struct {
Version uint64 `json:"version"` // 完整包版本号
Md5 string `json:"md5"` // 完整包MD5
CreatedAt int64 `json:"created_at"` // 上传时间
Size int64 `json:"size"` // 完整包大小
Url string `json:"url"` // 完整包下载地址
ExtraInfo string `json:"extra_info"` // 业务方随包传入的附带信息
PatchList []RespQueryPatchByServicePatch `json:"patch_list"` // 差分包列表
}
type RespQueryPatchByServiceOverview ¶
type RespQueryPatchByServiceOverview struct {
ServiceName string `json:"service_name"`
Packages []RespQueryPatchByService `json:"packages"`
}
type RespQueryPatchByServicePatch ¶
type RespQueryPatchByServicePatch struct {
OldVersion uint64 `json:"old_version"` // 原始包版本
OldMd5 string `json:"old_md5"` // 原始包MD5
OldSize int64 `json:"old_size"` // 原始包大小
OldUrl string `json:"old_url"` // 原始包下载地址
CreatedAt int64 `json:"created_at"` // 创建时间
Md5 string `json:"md5"` // 差分包MD5
Size int64 `json:"size"` // 差分包大小
Url string `json:"url"` // 差分包下载地址
Alg string `json:"alg"` // 算法
}
type ValidateData ¶
type ValidateReq ¶
type ValidateReq struct {
OldUrl string `json:"old_url"` // 原始包url
PatchUrl string `json:"patch_url"` // 新包url
}
ValidateReq validate
type ValidateResult ¶
type ValidateResult struct {
RespInfo
Data *ValidateData `json:"data"`
}
ValidateResult 验证差分包的返回结构
Click to show internal directories.
Click to hide internal directories.