Documentation ¶
Index ¶
- func Decode(r *http.Request, val any) error
- func GetTime(ctx context.Context) time.Time
- func GetTraceID(ctx context.Context) string
- func IsShutdown(err error) bool
- func NewShutdownError(message string) error
- func Respond(ctx context.Context, w http.ResponseWriter, data any, statusCode int) error
- func SetStatusCode(ctx context.Context, statusCode int)
- func SetValues(ctx context.Context, v *Values) context.Context
- type App
- type Handler
- type Middleware
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTraceID ¶
GetTraceID returns the trace id from the context.
func IsShutdown ¶
IsShutdown checks to see if the shutdown error is contained in the specified error value.
func NewShutdownError ¶
NewShutdownError returns an error that causes the framework to signal a graceful shutdown.a
func SetStatusCode ¶
SetStatusCode sets the status code back into the context.
Types ¶
type App ¶
func (*App) Handle ¶
func (a *App) Handle(path string, method string, handler Handler, mw ...Middleware)
Handle sets a handler function for a given HTTP method and path pair to the application server mux.
func (*App) SignalShutdown ¶
func (a *App) SignalShutdown()
type Middleware ¶
Middleware is a function designed to run some code before and/or after another Handler. It is designed to remove boilerplate or other concerns not direct to any given Handler.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.