Documentation ¶
Index ¶
- Constants
- func ControllerHandler[T any](handler func(*http.Request) (*HTTPResponse[T], error)) http.HandlerFunc
- func GetContextParam[T any](varName string, ctx context.Context) T
- func Router() chi.Router
- func SetContextParam(varName string, value any, ctx context.Context) context.Context
- type CtxKey
- type HTTPError
- type HTTPResponse
Constants ¶
View Source
const (
SessionKey = "sessionKey"
)
View Source
const (
UserIDKey = "userID"
)
Variables ¶
This section is empty.
Functions ¶
func ControllerHandler ¶
func ControllerHandler[T any](handler func(*http.Request) (*HTTPResponse[T], error)) http.HandlerFunc
Types ¶
type HTTPError ¶
type HTTPResponse ¶
func NewOKResponse ¶
func NewOKResponse[T any](body T) *HTTPResponse[T]
func NewResponse ¶
func NewResponse[T any](code int, body T) *HTTPResponse[T]
func NewStatusResponse ¶
func NewStatusResponse[T any](code int) *HTTPResponse[T]
Click to show internal directories.
Click to hide internal directories.