quota

package
v0.0.0-...-3525954 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package quota contains usage data about the Battle.net API, which comes back as part of the response headers after you make a call with one of the gobattlenet clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Quota

type Quota struct {
	// contains filtered or unexported fields
}

Quota contains data about the Battle.net API usage. The following is a breakdown of the headers:

X-Plan-Qps-Allotted: The maximum QPS (queries per second) capacity set on your API key. This is the maximum number of calls that can be made in any given second.

X-Plan-Qps-Current: The current count of calls being applied against the above limit; in this case, it is a representation of how many calls your key is making at that particular second in time.

X-Plan-Quota-Allotted: The maximum number of calls that can be made on daily basis.

X-Plan-Quota-Current: The current count of calls made in the current limit period, i.e. the current day.

X-Plan-Quota-Reset: The time when the quota count will reset to 0.

func (*Quota) QPSAllotted

func (q *Quota) QPSAllotted() int

QPSAllotted returns the allotted QPS.

func (*Quota) QPSCurrent

func (q *Quota) QPSCurrent() int

QPSCurrent returns the current QPS.

func (*Quota) QuotaAlloted

func (q *Quota) QuotaAlloted() int

QuotaAlloted returns the alloted quota.

func (*Quota) QuotaCurrent

func (q *Quota) QuotaCurrent() int

QuotaCurrent returns the current quota.

func (*Quota) QuotaReset

func (q *Quota) QuotaReset() time.Time

QuotaReset returns the time the quota will reset.

func (*Quota) Set

func (q *Quota) Set(r *http.Response) error

Set sets the quota according to values returned by the given http.Response.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL