Go
Go SDK
Idiomatic Go SDK with context support and zero dependencies.
$go get github.com/appneural/appneural-go/v2
Context supportZero external dependenciesInterface-based designRace-free concurrencyGo 1.21+ compatibleTable-driven test helpers
Code
Get started in minutes.
initialization.go
import "github.com/appneural/appneural-go/v2"
client := appneural.NewClient(
appneural.WithAPIKey(os.Getenv("APPNEURAL_API_KEY")),
appneural.WithEnvironment("production"),
)authentication.go
// API key
client := appneural.NewClient(
appneural.WithAPIKey(os.Getenv("APPNEURAL_API_KEY")),
)
// OAuth 2.0
client := appneural.NewClient(
appneural.WithOAuth(
os.Getenv("APPNEURAL_CLIENT_ID"),
os.Getenv("APPNEURAL_CLIENT_SECRET"),
),
)usage example.go
run, err := client.Workflows.Trigger(ctx, &appneural.TriggerInput{
WorkflowID: "wf_invoice_audit_01",
Input: map[string]any{
"documentUrl": "https://storage.example.com/invoices/inv_001.pdf",
"validationRules": []string{"vat_matching"},
},
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Workflow started: %s\n", run.ID)Configuration
SDK options.
| Option | Type | Description |
|---|---|---|
| WithAPIKey | string | Your API key |
| WithEnvironment | string | production | sandbox |
| WithTimeout | time.Duration | Request timeout |
| WithMaxRetries | int | Max retry attempts |
Best Practices
Recommended patterns.
Always pass context with timeouts
Use errors.Is for error checking
Leverage interfaces for testing
Use connection pooling
Enterprise Intelligence
Get started with Go SDK.
Idiomatic Go SDK with context support and zero dependencies.
Scope and availability confirmed individually · Written terms define the engagement