Documentation
¶
Index ¶
- Variables
- func AsStatus(code codes.Code, err error, details ...proto.Message) error
- func HTMLHandler[I act.Input, O any, D act.Deps](initDeps InitDeps[D], handler HandlerFunc[I, O, D], tmpl *template.Template) http.HandlerFunc
- func Handler[I act.Input, O any, D act.Deps](initDeps InitDeps[D], handler HandlerFunc[I, O, D]) http.HandlerFunc
- func RetryAfter(after time.Duration) proto.Message
- func Translate[O act.Input](t Translator[O], h http.HandlerFunc) http.HandlerFunc
- type HandlerFunc
- type InitDeps
- type NoDeps
- type StubFunc
- type Translator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotOK = errors.New("non-OK response") ErrExhausted = status.New(codes.ResourceExhausted, "resource exhausted").Err() )
View Source
var NoDepsInit = act.NoDepsInit
Functions ¶
func AsStatus ¶
AsStatus creates a gRPC status with the given code and error message. Optionally accepts status details to attach to the error.
func HTMLHandler ¶
func Handler ¶
func Handler[I act.Input, O any, D act.Deps](initDeps InitDeps[D], handler HandlerFunc[I, O, D]) http.HandlerFunc
func RetryAfter ¶
RetryAfter is a convenience function for creating a detail proto for retry information. NOTE: For HTTP, should be limited to use with Unavailable and ResourceExhausted codes.
func Translate ¶
func Translate[O act.Input](t Translator[O], h http.HandlerFunc) http.HandlerFunc
Translate applies a Translator on the Request to populate the Request.URL params.
Types ¶
type HandlerFunc ¶
func WithTimeout ¶
func WithTimeout[I act.Input, O any, D act.Deps](timeout time.Duration, handler HandlerFunc[I, O, D]) HandlerFunc[I, O, D]
type StubFunc ¶
func StubFromHandler ¶
Click to show internal directories.
Click to hide internal directories.