Documentation ¶
Index ¶
- Variables
- func AddWorkerHeader(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func AddWorkerVersion(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func ImportUsers(ctx context.Context, userInfos ...UserInfo) error
- func MiddlewarePeerRateLimiter(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func Models() []model.Model
- func RegisterOpenSessionRateLimiter(ctx context.Context, rateLimit ratelimiter.RateLimitInfo) context.Context
- func RegisterRateLimiter(ctx context.Context, rateLimit ratelimiter.RateLimitInfo) context.Context
- type Api
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRateLimit = errors.New("RateLimitReached") DefaultPeerRequestPerSecond = ratelimiter.RateLimitInfo{ Limit: redis_rate.Limit{ Period: time.Second, Rate: 100, Burst: 100, }, KeyPrefix: "PeerRequest", } DefaultOpenSessionPerMinute = ratelimiter.RateLimitInfo{ Limit: redis_rate.Limit{ Period: time.Minute, Rate: 10, Burst: 10, }, KeyPrefix: "OpenSession", } )
Functions ¶
func AddWorkerHeader ¶
func AddWorkerHeader(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
AddWorkerHeader - adds header of which node actually processed request
func AddWorkerVersion ¶
func AddWorkerVersion(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
AddWorkerVersion - adds header of which version is installed
func MiddlewarePeerRateLimiter ¶
func MiddlewarePeerRateLimiter(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
MiddlewarePeerRateLimiter return StatusTooManyRequests if rate limite is reached
func RegisterOpenSessionRateLimiter ¶
func RegisterOpenSessionRateLimiter(ctx context.Context, rateLimit ratelimiter.RateLimitInfo) context.Context
func RegisterRateLimiter ¶
func RegisterRateLimiter(ctx context.Context, rateLimit ratelimiter.RateLimitInfo) context.Context
Types ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
services package is au json-rpc service for session management.
|
services package is au json-rpc service for session management. |
Click to show internal directories.
Click to hide internal directories.