Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTooManyRequestsIn24Hours = errors.New("too many Klaytn RPC requests have been sent this 24 hour period")
Functions ¶
Types ¶
type RateLimiter ¶
type RateLimiter interface { Wait(ctx context.Context) error Start(ctx context.Context, checkpointInterval time.Duration) error // contains filtered or unexported methods }
RateLimiter is the interface one must satisfy to be considered a RateLimiter
func New ¶
func New(maxRequestsPer24Hrs int, maxRequestsPerSecond float64, meshDB *meshdb.MeshDB, aClock clock.Clock) (RateLimiter, error)
New instantiates a new RateLimiter
func NewUnlimited ¶
func NewUnlimited() RateLimiter
NewUnlimited returns a new RateLimiter without any limits. It will always allow requests immediately. It still keeps track of the number of requests that are allowed.
Click to show internal directories.
Click to hide internal directories.