Documentation ¶
Index ¶
- func CreateCheckSearchBotMiddleware(next http.Handler) http.Handler
- func GetAccessTokenInfo(ctx context.Context) *credentials.AccessTokenInfo
- func GetClientIP(ctx context.Context) string
- func GetRefreshToken(ctx context.Context) *uuid.UUID
- func IsTrustedClient(ctx context.Context) bool
- func IsTrustedSearchBot(ctx context.Context) bool
- func RequestID(next http.Handler) http.Handler
- func RequireAuth(next http.Handler) http.Handler
- type Middleware
- func CreateAccessLogMiddleware(logger log.Interface) Middleware
- func CreateAccessTokenMiddleware(sessionGetter sessionGetter, decodeKey string) Middleware
- func CreateCheckClientMiddleware(needToCheckClient bool) Middleware
- func CreateClientIPMiddleware(logger log.Interface) Middleware
- func CreateCorrectUUIDInParamMiddleware(logger log.Interface, contextKey string, paramName string) Middleware
- func CreateRecoverMiddleware(logger log.Interface) Middleware
- func CreateRefreshTokenMiddleware(decodeKey string) Middleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAccessTokenInfo ¶
func GetAccessTokenInfo(ctx context.Context) *credentials.AccessTokenInfo
func GetClientIP ¶
func IsTrustedClient ¶
func IsTrustedSearchBot ¶
Types ¶
type Middleware ¶
Middleware is chi router middleware type
func CreateAccessLogMiddleware ¶
func CreateAccessLogMiddleware(logger log.Interface) Middleware
CreateAccessLogMiddleware create middleware to log every request
func CreateAccessTokenMiddleware ¶
func CreateAccessTokenMiddleware(sessionGetter sessionGetter, decodeKey string) Middleware
@TODO add logging
func CreateCheckClientMiddleware ¶
func CreateCheckClientMiddleware(needToCheckClient bool) Middleware
func CreateClientIPMiddleware ¶
func CreateClientIPMiddleware(logger log.Interface) Middleware
func CreateCorrectUUIDInParamMiddleware ¶
func CreateCorrectUUIDInParamMiddleware(logger log.Interface, contextKey string, paramName string) Middleware
func CreateRecoverMiddleware ¶
func CreateRecoverMiddleware(logger log.Interface) Middleware
This middleware have to be used only for unexpected errors like "Index is out of range" and so on. Do not panic inside app
func CreateRefreshTokenMiddleware ¶
func CreateRefreshTokenMiddleware(decodeKey string) Middleware
Click to show internal directories.
Click to hide internal directories.