pool

package
v0.0.0-...-06fd498 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// HeaderXRateLimitRemaining -
	HeaderXRateLimitRemaining = "X-RateLimit-Remaining"
	// HeaderXRateLimitReset -
	HeaderXRateLimitReset = "X-RateLimit-Reset"
)

Variables

View Source
var (
	// MinResetInterval -
	MinResetInterval = time.Minute
	// ResetPeriod -
	ResetPeriod = time.Hour
	// ResetIntervalOffset -
	ResetIntervalOffset = 1.2
	// MinReuseNum -
	MinReuseNum = 10
)

Functions

This section is empty.

Types

type Client

type Client struct {
	*github.Client
	// contains filtered or unexported fields
}

Client -

func (*Client) HandleResponse

func (c *Client) HandleResponse(resp *github.Response) error

HandleResponse -

func (*Client) Reset

func (c *Client) Reset()

Reset -

type Pool

type Pool interface {
	Get(string) (*Client, error)
	Put(*Client) error
	AddClient(tokens ...*Token) error
	ResetInterval(time.Duration)
}

Pool -

func NewPool

func NewPool(interval time.Duration, tokens ...*Token) (Pool, error)

NewPool -

type Token

type Token struct {
	Tag   string
	Token string
}

Token -

Jump to

Keyboard shortcuts

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