Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfig ¶
func DefaultConfig(key string) api.EquinoxConfig
Returns the default equinox config.
Logger with zerolog.WarnLevel. Retry with a limit of 3 and jitter of 500 milliseconds.
func DefaultLogger ¶
Returns the default Logger config.
- Level : zerolog.WarnLevel
- Pretty : false
- TimeFieldFormat : zerolog.TimeFormatUnix
- EnableTimestamp : true
- EnableConfigurationLogging : false
func DefaultRateLimit ¶
Returns the default RateLimit.
- StoreType : InternalRateLimit
- LimitUsageFactor : 0.99
- IntervalOverhead : 1 second
Types ¶
type Equinox ¶
type Equinox struct {
Internal *internal.Client
Cache *cache.Cache
RateLimit *ratelimit.RateLimit
Riot *riot.Client
LOL *lol.Client
TFT *tft.Client
VAL *val.Client
LOR *lor.Client
Riftbound *riftbound.Client
}
func NewClient ¶
Returns an equinox client with the default configuration:
- Key : The provided Riot API key.
- HTTPClient : Default http.Client.
- Cache : BigCache with a TTL of 4 minutes.
- RateLimit : InternalRateLimit with a limit usage factor of 0.99 and interval overhead of 1 second.
- Logger : Logger with zerolog.WarnLevel. Will log if rate limited or when retrying a request.
- Retry : Will retry a request a maximum of 3 times with a jitter of 500 milliseconds.
func NewCustomClient ¶
func NewCustomClient(config api.EquinoxConfig, httpClient *http.Client, cache *cache.Cache, rateLimit *ratelimit.RateLimit) (*Equinox, error)
Returns an equinox client using a custom configuration.
- Config : The api.EquinoxConfig.
- HTTPClient : Can be nil.
- Cache : Can be nil.
- RateLimit : Can be nil, only disable it if you know what you're doing.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package used to share common constants and structs.
|
Package used to share common constants and structs. |
|
Cache package to provide an interface to interact with cache stores.
|
Cache package to provide an interface to interact with cache stores. |
|
clients
|
|
|
lol
This package is used to interact with all LOL endpoints.
|
This package is used to interact with all LOL endpoints. |
|
lor
This package is used to interact with all LOR endpoints.
|
This package is used to interact with all LOR endpoints. |
|
riftbound
This package is used to interact with all Riftbound endpoints.
|
This package is used to interact with all Riftbound endpoints. |
|
riot
This package is used to interact with all Riot endpoints.
|
This package is used to interact with all Riot endpoints. |
|
tft
This package is used to interact with all TFT endpoints.
|
This package is used to interact with all TFT endpoints. |
|
val
This package is used to interact with all VAL endpoints.
|
This package is used to interact with all VAL endpoints. |
|
test
|
|
|
integration
This package only contains integration tests and are meant to be run manually.
|
This package only contains integration tests and are meant to be run manually. |
Click to show internal directories.
Click to hide internal directories.