Documentation ¶
Overview ¶
Package shared holds some types that are used between multiple global-ratelimiter packages, and need to be broken out to prevent import cycles.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GlobalKey ¶
type GlobalKey string // GlobalKey represents a "global" / globally unique ratelimit key (i.e. namespaced by collection)
type KeyMapper ¶
type KeyMapper interface { LocalToGlobal(key LocalKey) GlobalKey // GlobalToLocal does the reverse of LocalToGlobal. // // An error will be returned if the global key does not seem to have // come from this mapper. GlobalToLocal(key GlobalKey) (LocalKey, error) }
KeyMapper is used to ensure that all keys that get communicated to aggregators are uniquely identifiable, when multiple collections are used.
A unique prefix / pattern per collection should be sufficient.
Click to show internal directories.
Click to hide internal directories.