Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client reads immutable repository snapshots through GitHub's Git data API.
func (*Client) Materialize ¶
func (c *Client) Materialize(ctx context.Context, repository serving.Repository, baseCommit string, record store.Annotation) (serving.Materialization, error)
func (*Client) Snapshot ¶
func (c *Client) Snapshot(ctx context.Context, repository serving.Repository) (*application.RepositorySnapshot, error)
type RateLimit ¶ added in v1.1.0
type RateLimit struct {
Limit int
Remaining int
Used int
Resource string
// Reset is when the primary budget refills.
Reset time.Time
// RetryAfter is what a secondary limit asks for instead. GitHub sends it
// on abuse detection, where Reset is absent and the only honest answer to
// "when may I retry" is the number of seconds it just gave us.
RetryAfter time.Duration
}
RateLimit is what GitHub said about the budget a response spent from. Every response carries it, including the successful ones, so a caller can see a limit approaching instead of only discovering it at zero.
func (RateLimit) Exhausted ¶ added in v1.1.0
Exhausted reports whether the budget is spent. A secondary limit reports no remaining count at all, so Retry-After alone is enough to mean "stop".
func (RateLimit) RecoversAt ¶ added in v1.1.0
RecoversAt is the earliest a caller should try again. It never returns a time in the past for an exhausted budget, because a caller that treats "already reset" as "go ahead" is the caller that spends the next window in one burst.