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{})
- func (ar *Router) ServeJSONOk(w http.ResponseWriter)
- 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.
func (*Router) ServeHTTP ¶
func (ar *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements identifo.Router interface.
func (*Router) ServeJSON ¶
func (ar *Router) ServeJSON(w http.ResponseWriter, locale string, status int, v interface{})
ServeJSON sends status code, headers and data and send it back to the user
func (*Router) ServeJSONOk ¶ added in v2.10.0
func (ar *Router) ServeJSONOk(w http.ResponseWriter)
type RouterSettings ¶
type RouterSettings struct { Server model.Server LoggerSettings model.LoggerSettings Storage model.ManagementKeysStorage Locale string SupportedLoginWays model.LoginWith }
Click to show internal directories.
Click to hide internal directories.