Common

circle-info

LicenseSpring’s new Go SDK V2 is now available! This version is a complete rewrite with breaking changes and will receive all future updates and support.

The legacy Go SDK (v1) is deprecated and maintained for backward compatibility only. New users should use v2.

Go SDK is divided into 3 clients:

  • Floating client

  • License client

  • Management client

Response Types

There are 3 response wrapper types. These are used for future extendability and ease of use.

  • Client.Response

  • Management_response.SearchResult

  • Error

Client.Response

Response type is used by all 3 clients, and it's a generic wrapper for any request:

type Response[T any] struct {
	Payload []byte // raw response JSON
	Value   T      // typed value
	Error   error  // error, if it exists
}

As an example, license_client.ActivateLicense would return client.Response[LicenseResponse], so response.Value would be of type LicenseResponse. Example:

Management_response.SearchResult

SearchResult is used only in management client to wrap search/list request responses. For example, for ListCustomersarrow-up-right requests.

Error

Error type is commonly used as response for Delete requests, e.g. DeleteCustomerarrow-up-right.

Was this helpful?