Go Get File Application Latest Upgrade Information
This method is used to obtain the latest upgrade strategy for file applications.
Method Definition
go
func (client *Client) FileUpgrade(request *FileUpgradeRequest) (_result *FileUpgradeResponse, _err error)Request Parameter List
| Parameter Name | Type | Description |
|---|---|---|
| request | *FileUpgradeRequest | Set specific interface request parameters, please refer to File Application Get Upgrade Strategy |
Return Value List
| Return Value Name | Type | Description |
|---|---|---|
| result | *FileUpgradeResponse | Interface return value, valid when err is nil, specific interface return parameters, please refer to File Application Get Upgrade Strategy |
| err | error | Request status, when the request fails, err is not nil |
Example Code Location
- github: https://github.com/toolsetlink/upgradelink-api-go/blob/main/test/client_test.go
- gitee: https://gitee.com/toolsetlink/upgradelink-api-go/blob/main/test/client_test.go
Example Code
You can use the following code to obtain the latest upgrade strategy.
go
package test
import (
"fmt"
"testing"
"github.com/toolsetlink/upgradelink-api-go/client"
)
// Get file application upgrade content
func TestGetFileUpgrade(t *testing.T) {
accessKey := "mui2W50H1j-OC4xD6PgQag"
accessSecret := "PEbdHFGC0uO_Pch7XWBQTMsFRxKPQAM2565eP8LJ3gc"
var config = client.Config{
AccessKey: &accessKey,
AccessSecret: &accessSecret,
}
Client, err := client.NewClient(&config)
if err != nil {
return
}
fileKey := "LOYlLXNy7wV3ySuh0XgtSg"
versionCode := 1
appointVersionCode := 0
devModelKey := ""
devKey := ""
// Interface call
request := &client.FileUpgradeRequest{
FileKey: &fileKey,
VersionCode: &versionCode,
AppointVersionCode: &appointVersionCode,
DevModelKey: &devModelKey,
DevKey: &devKey,
}
Info, err := Client.FileUpgrade(request)
if err != nil {
fmt.Println("err: ", err)
} else {
fmt.Println("info: ", Info)
}
}