Go License Client
Importing the License Client
import (
"gitlab.com/l3178/sdk-go/license_client"
"gitlab.com/l3178/sdk-go/core/auth"
core_request "gitlab.com/l3178/sdk-go/core/models/request"
)Create LicenseClient
config := license_client.NewLicenseClientConfiguration("apiKey", "sharedKey", "productCode")
client := license_client.NewLicenseClient(config)Create Custom LicenseClient
// implement the interface:
//type CryptoProvider interface {
// Encrypt(core_models.LicenseFile, string) (interface{}, error)
// Decrypt(interface{}, string) (interface{}, error)
//}
type CustomCryptoProvider struct{}
func (d CustomCryptoProvider) Encrypt(license_file core_models.LicenseFile, password string) (interface{}, error) {
// your custom implementation
}
func (d CustomCryptoProvider) Decrypt(data interface{}, password string) (interface{}, error) {
// your custom implementation
}
// implement the interface:
//type DataLocation interface {
// DataDirectory() (string, error)
// LicenseFileName(string) string
//}
type CustomDataLocation struct{}
func (d CustomDataLocation) DataDirectory() (string, error) {
// your custom implementation
}
func (d CustomDataLocation) LicenseFileName(productCode string) string {
// your custom implementation
}
config := license_client.NewLicenseClientConfigurationCustom(CustomCryptoProvider, CustomDataLocation, "apiKey", "sharedKey", "productCode")
client := license_client.NewLicenseClient(config)Activate Key-Based License
Activate User-Based License
Deactivate Key-Based License
Deactivate User-Based License
Check Key-Based License
Check User-Based License
Activate Offline License
Deactivate Offline License
Local License Check
Add Consumption
Add Feature Consumption
Trial Key
Product Details
Track Device Variables
Get Device Variables
Floating Borrow
Floating Release
Change Password
Versions
Installation File
Customer License Users
SSO URL
Air-Gap Initialization
Air-Gap Activation
Was this helpful?