gobattlenet: github.com/munsy/gobattlenet/quota Index | Files

package quota

import "github.com/munsy/gobattlenet/quota"

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

Package Files

doc.go quota.go

type Quota Uses

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 Uses

func (q *Quota) QPSAllotted() int

QPSAllotted returns the allotted QPS.

func (*Quota) QPSCurrent Uses

func (q *Quota) QPSCurrent() int

QPSCurrent returns the current QPS.

func (*Quota) QuotaAlloted Uses

func (q *Quota) QuotaAlloted() int

QuotaAlloted returns the alloted quota.

func (*Quota) QuotaCurrent Uses

func (q *Quota) QuotaCurrent() int

QuotaCurrent returns the current quota.

func (*Quota) QuotaReset Uses

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

QuotaReset returns the time the quota will reset.

func (*Quota) Set Uses

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

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

Package quota imports 4 packages (graph). Updated 2018-08-20. Refresh now. Tools for package owners.