Help us shape the future of Go! Take the 2026 Go Developer Survey

githubapi

package
v0.0.0-...-3d73ba5 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package githubapi holds GitHub API plumbing every host shares: the GraphQL transport that recognises primary and secondary rate limits, and the GraphQL scalars GitHub's schema adds. It makes no requests of its own.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RateLimitTransport

func RateLimitTransport(base http.RoundTripper) http.RoundTripper

RateLimitTransport preserves rate-limit information that the GraphQL client otherwise reduces to a generic HTTP error: a limited response becomes a *RateLimitError. It inspects at most a small prefix and streams the remainder of larger successful responses unchanged.

Types

type BigInt

type BigInt int64

BigInt decodes GitHub's BigInt scalar, which arrives as a JSON string or number; null decodes as zero.

func (*BigInt) UnmarshalJSON

func (value *BigInt) UnmarshalJSON(data []byte) error

type GitObjectID

type GitObjectID string

GitObjectID is a commit SHA passed as a GraphQL variable, typed as GitHub's GitObjectID scalar.

func (GitObjectID) GetGraphQLType

func (GitObjectID) GetGraphQLType() string

type RateLimitError

type RateLimitError struct {
	ResumeAt time.Time
}

RateLimitError is GitHub refusing a GraphQL request for a primary or secondary rate limit. ResumeAt is when GitHub said to try again, and zero when it did not say.

func (*RateLimitError) Error

func (e *RateLimitError) Error() string

Jump to

Keyboard shortcuts

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