Skip to content
/ go-e5e Public

Support library to help Go developers build Anexia e5e functions

License

Notifications You must be signed in to change notification settings

anexia/go-e5e

Repository files navigation

go-e5e

PkgGoDev Build Status Test Coverage Go Report Card

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

Install

With a correctly configured Go toolchain:

go get -u go.anx.io/e5e/v2

Getting started

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

List of developers

Links

About

Support library to help Go developers build Anexia e5e functions

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages