Go client for the EPGL (Regulatory and Licensing) API.
go get github.com/quiqupltd/epglgoclient, err := epglgo.NewClient("https://api-stg.epgl.ae")
if err != nil {
log.Fatal(err)
}resp, err := client.AuthenticateClient(ctx, epglgo.AuthenticateClientJSONRequestBody{
ClientId: "your-client-id",
ClientSecret: "your-client-secret",
})resp, err := client.CreateUpdateShipment(ctx, epglgo.CreateUpdateShipmentJSONRequestBody{
// ... shipment details
})resp, err := client.CreateShipmentInvoice(ctx, epglgo.CreateShipmentInvoiceJSONRequestBody{
// ... invoice details
})client, err := epglgo.NewClient("https://api-stg.epgl.ae",
epglgo.WithRequestEditorFn(func(ctx context.Context, req *http.Request) error {
req.Header.Set("Authorization", "Bearer "+token)
return nil
}),
)The client supports OpenTelemetry tracing out of the box. Use the OTEL-enabled constructors to automatically instrument all HTTP requests with distributed tracing:
// Create a client with OpenTelemetry tracing
client, err := epglgo.NewClientWithResponsesWithOTEL("https://api-stg.epgl.ae")
if err != nil {
log.Fatal(err)
}
// All requests will automatically create spans
resp, err := client.AuthenticateClientWithResponse(ctx, epglgo.AuthenticateClientJSONRequestBody{
ClientId: "your-client-id",
ClientSecret: "your-client-secret",
})You can combine OTEL tracing with other client options:
client, err := epglgo.NewClientWithResponsesWithOTEL("https://api-stg.epgl.ae",
epglgo.WithRequestEditorFn(func(ctx context.Context, req *http.Request) error {
req.Header.Set("Authorization", "Bearer "+token)
return nil
}),
)Note: You must configure an OpenTelemetry trace provider in your application for traces to be exported. See the OpenTelemetry Go documentation for setup instructions.
go generate ./...The OpenAPI specification is at spec/apispec.json.