This version of the library is designed for the old custom
e5e runtime. The new version for the binary
runtime is
published in the repository: https://github.com/anexia/go-e5e/
go-e5e is a support library to help Go developers develop Anexia e5e functions.
With a correctly configured Go toolchain:
go get -u github.com/anexia-it/go-e5e
package main
import (
"runtime"
"github.com/anexia-it/go-e5e"
)
type entrypoints struct{}
func (f *entrypoints) MyEntrypoint(event e5e.Event, context e5e.Context) (*e5e.Return, error) {
return &e5e.Return{
Status: 200,
ResponseHeaders: map[string]string{
"x-custom-response-header": "This is a custom response header",
},
Data: map[string]interface{}{
"version": runtime.Version(),
},
}, nil
}
func main() {
if err := e5e.Start(&entrypoints{}); err != nil {
panic(err)
}
}
- Andreas Stocker [email protected], Lead Developer