Documentation
¶
Index ¶
- Constants
- func AccessLogMiddleware(next http.Handler, logger AccessLoggerPort) http.Handler
- func Auth(next http.Handler, params AuthParams) http.Handler
- func PrivateRoute(endpoint http.Handler, authParams AuthParams) http.Handler
- func PublicRoute(endpoint http.Handler) http.Handler
- func RequestIdMiddleware(next http.Handler) http.Handler
- type AccessLoggerPort
- type AuthParams
- type User
Constants ¶
View Source
const (
UserKey = contextKey("user")
)
Variables ¶
This section is empty.
Functions ¶
func AccessLogMiddleware ¶
func AccessLogMiddleware(next http.Handler, logger AccessLoggerPort) http.Handler
func PrivateRoute ¶ added in v0.13.0
func PrivateRoute(endpoint http.Handler, authParams AuthParams) http.Handler
Types ¶
type AccessLoggerPort ¶
type AuthParams ¶ added in v0.12.0
type AuthParams struct {
Secret string
UserRepo userRepositoryPort
Logger loggerPort
}
func NewAuthParams ¶ added in v0.12.0
func NewAuthParams(secret string, userRepo userRepositoryPort, logger loggerPort) AuthParams
Click to show internal directories.
Click to hide internal directories.