Documentation ¶
Index ¶
- Constants
- func GetAccessToken(r *http.Request) string
- func GetAccessTokenFromContext(ctx context.Context) (string, bool)
- func GetIPAddress(r *http.Request) string
- func GetIPAddressFromContext(ctx context.Context) (string, bool)
- func RateLimitAllow(ctx context.Context, name string, n int) bool
- func RealIP(next http.Handler) http.Handler
- func WhiteListAllow(ctx context.Context) bool
- type CtxKey
- type Middleware
Constants ¶
View Source
const ( CtxKeyRealIP = CtxKey("Infura-Real-IP") CtxKeyRateRegistry = CtxKey("Infura-Rate-Limit-Registry") CtxAccessToken = CtxKey("Infura-Access-Token") )
Variables ¶
This section is empty.
Functions ¶
func GetAccessToken ¶
func GetIPAddress ¶
GetIPAddress returns the remote IP address.
func WhiteListAllow ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.