This is the official Go SDK for LicenseSpring.
go get -u gitlab.com/l3178/sdk-go/...
If you want to install a specific version, see the list of versions here.
This SDK contains 3 different modules:
The samples/ directory contains examples demonstrating both online and offline activations and deactivation using the SDK.
Before running the samples, you need to provide API credentials and product information in the samples/config.yaml file.
Open the samples/config.yaml file and provide the following information:
- API Key: Your API key.
- Shared Key: A shared key.
- Product Details: Add product-specific information (e.g., license key or username/password for user-based licenses).
- verbose: If true, enables detailed logging for debugging purposes.
- verify_signature: If true, verifies the server’s signature to ensure message integrity.
Once the config file is ready, call the sample from main.go by passing the product name as an argument:
You can build your application using either of the following methods:
go build -o your-programGo Build with Garble (Recommended)
Install Garble:
go install mvdan.cc/garble@latestBuild with Garble:
garble build -o your-programFor stronger obfuscation, use:
garble -literals -tiny build -o your-program- Obfuscation: Makes your binaries harder to reverse-engineer by renaming symbols and stripping debug information.
- Security: Protects sensitive logic and proprietary algorithms.
- Intellectual Property Protection: Reduces the risk of code theft or analysis.
- Simple Integration: Works directly with your existing Go toolchain.
Note: For development builds, use
go buildfor faster iteration and easier debugging.
| Build Method | Pros | Cons |
|---|---|---|
go build |
Fast, easy, better for debugging | No obfuscation |
garble build |
Obfuscates binary, protects IP | Slower, harder to debug |