Documentation
¶
Index ¶
- Variables
- func AsStatus(code codes.Code, err error) error
- func Handler[I Message, O any, D Dependencies](initDeps InitT[D], handler HandlerT[I, O, D]) http.HandlerFunc
- func Translate[O Message](t Translator[O], h http.HandlerFunc) http.HandlerFunc
- type Dependencies
- type HandlerT
- type InitT
- type Message
- type NoDeps
- type NoReturn
- type StubT
- type Translator
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotOK = errors.New("non-OK response")
Functions ¶
func Handler ¶
func Handler[I Message, O any, D Dependencies](initDeps InitT[D], handler HandlerT[I, O, D]) http.HandlerFunc
func Translate ¶
func Translate[O Message](t Translator[O], h http.HandlerFunc) http.HandlerFunc
Types ¶
type Dependencies ¶
type Dependencies interface{}
type Message ¶
type Message interface {
Validate() error
}
A message is a request/response type, used in api.Stub
type StubT ¶
func StubFromHandler ¶
func StubFromHandler[I Message, O any, D Dependencies](client httpx.BasicClient, u url.URL, handler HandlerT[I, O, D]) StubT[I, O]
type Translator ¶
type Translator[O Message] func(io.ReadCloser) (O, error)
Click to show internal directories.
Click to hide internal directories.