Go
Last updated
Add the SDK dependency.
go get github.com/hackle-io/hackle-go-sdkhackle.Client must be a singleton.
HackleClient manages state internally to distribute users to Variations immediately without network calls.
This uses additional resources for that purpose.
Do not instantiate a new client for every request; instead, manage it as a single instance throughout the application lifecycle.
hackle.Client is the class that provides methods for using SDK features.
To use the SDK, you need to initialize hackle.Client.
Instantiate hackle.Client by passing the SDK Key.
hackle.Client periodically synchronizes with the Hackle server as a background task to obtain the necessary information.
You can find the SDK Key in SDK Integration Info located inside the Hackle Service Dashboard.
import "github.com/hackle-io/hackle-go-sdk/hackle"
// YOUR_SERVER_SDK_KEY 자리에 SDK 키를 넣습니다.
hackleClient := hackle.NewClient(YOUR_SERVER_SDK_KEY, nil)You must call the close() method when the application shuts down.
This releases resources in use and sends any remaining events.
If the application shuts down without calling close(), events may be lost.
Last updated
import "github.com/hackle-io/hackle-go-sdk/hackle"
hackleClient.Close()