Skip to content

How to Configure Client

Client is the Go client used to obtain upgrade strategies and other resources. To make requests using the Go SDK, you need to initialize a Client instance and modify the default configuration items of the Client as needed.

Prerequisites

  • Already registered an UpgradeLink account.
  • Obtained AccessKey and AccessSecret.

Get Credentials

img.jpg

Default Configuration Example

go
package test

import (
	"fmt"
	"testing"

	"github.com/toolsetlink/upgradelink-api-go/client"
)

func TestInit(t *testing.T) {

	var config = client.Config{}
	config.SetAccessKey("mui2W50H1j-OC4xD6PgQag")
	config.SetAccessSecret("PEbdHFGC0uO_Pch7XWBQTMsFRxKPQAM2565eP8LJ3gc")

	Client, err := client.NewClient(&config)
	if err != nil {
		return
	}
	
}

Configuration Parameter Summary

Parameter NameRequiredTypeExample ValueDescription
accessKeyYesstring89c8b3d5f2a74e1bAccessKey
secretKeyYesstring89c8b3d5f2a74e1bAccessSecret
protocolNostringHTTPSProtocol, default is HTTP
endpointNostringapi.api.comService domain name, default is api.upgrade.toolsetlink.com, can be switched to your own service domain name.

toolsetlink@163.com