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 GetVipStatusByBillingStatus(bs *web3pay.BillingStatus) (*acl.VipStatus, bool)
- func GetVipStatusBySubscriptionStatus(vss *web3pay.VipSubscriptionStatus) (*acl.VipStatus, bool)
- func GetVipTierBySubscription(vi *types.VipInfo) (acl.VipTier, bool)
- func RateLimitAllow(ctx context.Context, name string, n int) bool
- func RealIP(next http.Handler) http.Handler
- func VipStatusFromContext(ctx context.Context) (*acl.VipStatus, 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") )
View Source
const (
VipSubPropTierKey = "tier"
)
Variables ¶
This section is empty.
Functions ¶
func GetAccessToken ¶
func GetIPAddress ¶
GetIPAddress returns the remote IP address.
func GetVipStatusByBillingStatus ¶
func GetVipStatusByBillingStatus(bs *web3pay.BillingStatus) (*acl.VipStatus, bool)
func GetVipStatusBySubscriptionStatus ¶
func GetVipStatusBySubscriptionStatus(vss *web3pay.VipSubscriptionStatus) (*acl.VipStatus, bool)
Types ¶
Click to show internal directories.
Click to hide internal directories.