Go SDK V2
License Manager
The LicenseManager is the core module responsible for managing licenses, communicating with the LicenseSpring server, and handling authentication.
Struct Definition
type LicenseManager struct {
LicenseClient license_client.LicenseClient
LicenseData *types.LicenseData
types.OfflineActivationGuard
}Constructor Functions
To create a new license manager, use:
NewLicenseManager(apiKey, sharedKey, productCode string, authData auth.Auth, opts ...ConfigurationOption) (*LicenseManager, error)License Client Configuration
The LicenseManager includes a LicenseClient, which contains all configuration for interacting with the server:
type LicenseClient struct {
c *client.Client
LicenseClientConfiguration
}Storage
Storage is responsible for securely persisting license-related data such as license files, guard files, and encrypted custom data.
License Handler
The LicenseHandler is the user-facing layer that wraps the LicenseManager and Storage. It acts as a coordinator:
Calls the license manager to perform actions (e.g. activation)
Persists the resulting data to storage (e.g. license file)
Manages offline guard file storage
Decouples core logic (license manager) from the storage mechanism
Example: License Activation Flow
More details about license handler in next section.
Was this helpful?