Skip to content

Latest commit

 

History

History
57 lines (42 loc) · 1.51 KB

README.md

File metadata and controls

57 lines (42 loc) · 1.51 KB

DEPRECATED

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

PkgGoDev Build Status codecov Go Report Card

go-e5e is a support library to help Go developers develop Anexia e5e functions.

Install

With a correctly configured Go toolchain:

go get -u github.com/anexia-it/go-e5e

Getting started

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)
	}
}

List of developers