Releases: anexia/go-e5e
Releases · anexia/go-e5e
v2.1.0
v2.0.1
Fixed
- Documentation fixes
v2.0.0
Changed
- Set minimum Go version to 1.18.
- Rewritten the library to follow the Mux pattern of the
net/http
library.
This ensures that there are no longer runtime errors for wrong entrypoint signatures, since everything
needs to implement the newe5e.Handler
interface now. - Add support for cancellation using
context.Context
. - Add support for strongly-typed request parameters, using the generics of Go 1.18.
A possible migration looks like this (old version first, new version second).
package main
import (
"go.anx.io/e5e"
)
type SumEventData struct {
A int `json:"a,omitempty"`
B int `json:"b,omitempty"`
}
type entrypoints struct{}
func (e entrypoints) Sum(d SumEventData, _ e5e.Context) (e5e.Result, error) {
return e5e.Result{Data: d.A + d.B}, nil
}
func main() {
e5e.Start(&entrypoints{})
}
package main
import (
"context"
"log"
"go.anx.io/e5e/v2"
)
type SumEventData struct {
A int `json:"a,omitempty"`
B int `json:"b,omitempty"`
}
func Sum(ctx context.Context, request e5e.Request[SumEventData, any]) (*e5e.Result, error) {
d := request.Data()
return &e5e.Result{Data: d.A + d.B}, nil
}
func main() {
e5e.AddHandlerFunc("Sum", Sum)
e5e.Start(context.Background())
}
Added
- Table-driven tests for tests
- Add detailed documentation for all public types
v1.2.1
Fixed
- Allow value
nil
forData
ine5e.Result
v1.2.0
Changed
- Reimplemented with new binary runtime support (breaks support with previous custom runtime)
- Moved repository to https://github.com/anexia/go-e5e
- Use the Anexia vanity import path in the documentation