go-e5e
go-e5e is a support library to help Go developers build Anexia e5e functions.
Install
With a correctly configured Go toolchain:
1go get -u go.anx.io/e5e
Getting started
1package main
2
3import (
4 "runtime"
5
6 "go.anx.io/e5e"
7)
8
9type SumData struct {
10 A int `json:"a"`
11 B int `json:"b"`
12}
13
14type SumEvent struct {
15 e5e.Event
16 Data SumData `json:"data"`
17}
18
19type entrypoints struct{}
20
21func (f *entrypoints) MyEntrypoint(event SumEvent, context e5e.Context) (e5e.Result, error) {
22 return e5e.Result{
23 Status: 200,
24 ResponseHeaders: map[string]string{
25 "x-custom-response-header": "This is a custom response header",
26 },
27 Data: map[string]interface{}{
28 "sum": event.Data.A + event.Data.B,
29 "version": runtime.Version(),
30 },
31 }, nil
32}
33
34func main() {
35 e5e.Start(&entrypoints{})
36}
List of developers
- Andreas Stocker AStocker@anexia-it.com, Lead Developer
- Patrick Taibel PTaibel@anexia-it.com, Developer