Requirements
The Gcore Go SDK requires Go 1.22 or higher. Make sure you have a compatible Go version installed:Installation
Install via go get
To install the latest version of the Gcore Go SDK, run:Pin to a Specific Version
For production applications, it’s recommended to pin to a specific version:Replace
v0.37.0 with the specific version you want to use. Check the releases page for the latest version.Import Paths
Once installed, import the SDK in your Go code:Package Structure
The SDK is organized into service-specific packages:Environment Variables
The SDK reads configuration from environment variables by default. This makes it easy to configure your application without hardcoding credentials.Required Variables
Optional Variables
Depending on which services you’re using, you may need to set additional environment variables:Environment Variable Reference
| Variable | Description | Required |
|---|---|---|
GCORE_API_KEY | Your Gcore API key for authentication | Yes |
GCORE_CLOUD_PROJECT_ID | Default Cloud project ID (for Cloud services) | Optional |
GCORE_CLOUD_REGION_ID | Default Cloud region ID (for Cloud services) | Optional |
GCORE_BASE_URL | Custom API base URL (defaults to production) | Optional |
You can also configure these values programmatically when creating the client, which will override environment variables. See the Quickstart guide for examples.
Verifying Installation
Create a simple test file to verify your installation:test.go
Next Steps
Quickstart
Learn how to make your first API call
Authentication
Configure API authentication
Core Concepts
Understand key SDK concepts
API Reference
Explore the full API documentation
