- Service binding via reflection with 4 method signatures - Dependency injection (Wired/auto tags) and guards - Streamable HTTP (NDJSON) streaming responses - Go/TypeScript client code generation (self-contained, with interceptors) - Enum support, structured Result, logging - 16 regression tests covering all fixed bugs
27 lines
479 B
Go
27 lines
479 B
Go
package fun
|
|
|
|
import (
|
|
"errors"
|
|
"reflect"
|
|
)
|
|
|
|
type enum interface {
|
|
Names() []string
|
|
}
|
|
|
|
type displayEnum interface {
|
|
DisplayNames() []string
|
|
Names() []string
|
|
}
|
|
|
|
var (
|
|
enumType = reflect.TypeFor[enum]()
|
|
displayEnumType = reflect.TypeFor[displayEnum]()
|
|
)
|
|
|
|
var (
|
|
errMethodNotFound = errors.New("method not found")
|
|
errEmptyFields = errors.New("serviceName and methodName cannot be empty")
|
|
errDTORequired = errors.New("method requires a DTO but none provided")
|
|
)
|