go-e5e is a support library to help Go developers build Anexia e5e functions.
With a correctly configured Go toolchain:
go get -u go.anx.io/e5e/v2
package main
import (
"context"
"go.anx.io/e5e/v2"
)
type SumData struct {
A int `json:"a"`
B int `json:"b"`
}
func Sum(ctx context.Context, r e5e.Request[SumData, any]) (*e5e.Result, error) {
result := r.Data().A + r.Data().B
return &e5e.Result{
Status: 200,
ResponseHeaders: map[string]string{
"x-custom-response-header": "This is a custom response header",
},
Data: result,
}, nil
}
func main() {
e5e.AddHandlerFunc("Sum", Sum)
e5e.Start(context.Background())
}
- Andreas Stocker AStocker@anexia-it.com, Lead Developer
- Patrick Taibel PTaibel@anexia-it.com, Developer
- Jasmin Oster JOster@anexia.com, Developer