Skip to content

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 NameTypeDescription
request*FileUpgradeRequestSet specific interface request parameters, please refer to File Application Get Upgrade Strategy

Return Value List ​

Return Value NameTypeDescription
result*FileUpgradeResponseInterface return value, valid when err is nil, specific interface return parameters, please refer to File Application Get Upgrade Strategy
errerrorRequest status, when the request fails, err is not nil

Example Code Location ​

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)
	}

}

toolsetlink@163.com