Go SDK
The AstraLog Go SDK is ideal for high-performance microservices and workers. It handles asynchronous batching and provides a thread-safe client for concurrent environments.
Installation
go get github.com/yourusername/astralog/sdk/go
Usage
func main() {
client := astralog.NewClient(astralog.Config{
Endpoint: "http://localhost:8080/v1/drain",
AuthToken: "default-secret-token",
ProjectID: "my-startup",
Service: "worker-process",
})
// Ensures remaining logs are flushed when main() exits
defer client.Close()
client.Info("Worker started", map[string]interface{}{
"worker_id": 42,
"region": "eu-west-1",
})
}