Documentation ¶
Index ¶
- Variables
- type InvitationTokenRequest
- type ResetPasswordTokenRequest
- type Router
- func (ar *Router) AuthMiddleware(next http.Handler) http.Handler
- func (ar *Router) Error(w http.ResponseWriter, locale string, status int, errID l.LocalizedString, ...)
- func (ar *Router) MustParseJSON(w http.ResponseWriter, r *http.Request, out interface{}) error
- func (ar *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (ar *Router) ServeJSON(w http.ResponseWriter, locale string, status int, v interface{})
- type RouterSettings
Constants ¶
This section is empty.
Variables ¶
View Source
var KeyIDHeaderKey = http.CanonicalHeaderKey("X-Nl-Key-Id")
Functions ¶
This section is empty.
Types ¶
type InvitationTokenRequest ¶
type ResetPasswordTokenRequest ¶
type ResetPasswordTokenRequest struct {
Email string `json:"email"`
}
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func NewRouter ¶
func NewRouter(settings RouterSettings) (*Router, error)
NewRouter creates and inits new router.
func (*Router) AuthMiddleware ¶ added in v2.4.5
func (*Router) Error ¶
func (ar *Router) Error(w http.ResponseWriter, locale string, status int, errID l.LocalizedString, details ...any)
Error writes an API error message to the response and logger.
func (*Router) MustParseJSON ¶
MustParseJSON parses request body json data to the `out` struct. If error happens, writes it to ResponseWriter.
type RouterSettings ¶
Click to show internal directories.
Click to hide internal directories.