Versions in this module Expand all Collapse all v0 v0.2.0 Aug 16, 2026 Changes in this version type ETagOptions + MaxBodyBytes int v0.1.0 Aug 16, 2026 Changes in this version + const DefaultETagEntries + const DefaultRequestTimeout + const DefaultTokenEnvGH + const DefaultTokenEnvGITHUB + var DefaultRateLimitOptions = RateLimitOptions + var DefaultRetryOptions = RetryOptions + var ErrAPIUnavailable = errors.New("github: API unavailable") + var ErrAuthRequired = errors.New("github: authentication required") + var ErrForbidden = errors.New("github: forbidden") + var ErrInvalidPagination = errors.New("githubkit: PaginationOptions.MaxPages must be at least 1") + var ErrNotFound = errors.New("github: resource not found") + var ErrRateLimited = errors.New("github: rate limit exceeded") + func ClassifyError(err error) error + func FetchPages[T any](ctx context.Context, opts PaginationOptions, ...) ([]T, error) + type ETagCache struct + func NewETagCache(opts ETagOptions) *ETagCache + func (c *ETagCache) Stats() ETagStats + type ETagOptions struct + MaxEntries int + type ETagStats struct + Entries int + Hits int64 + Stored int64 + type Kernel struct + func New(opts ...Option) (*Kernel, error) + func (k *Kernel) ETagStats() (ETagStats, bool) + func (k *Kernel) RateLimitSnapshot() (RateLimitSnapshot, bool) + func (k *Kernel) RefreshRateLimit(ctx context.Context) (RateLimitSnapshot, error) + type Option func(*Options) + func WithAuthTokenFromEnv(vars ...string) Option + func WithBaseURL(rawURL string) Option + func WithETagCache(opts *ETagOptions) Option + func WithHTTPClient(client *http.Client) Option + func WithPAT(token string) Option + func WithRateLimitOptions(opts RateLimitOptions) Option + func WithRetryOptions(opts RetryOptions) Option + func WithTimeout(d time.Duration) Option + func WithoutRateLimit() Option + func WithoutRetry() Option + type Options struct + BaseURL string + ETag *ETagOptions + HTTPClient *http.Client + RateLimit RateLimitOptions + RequestTimeout time.Duration + Retry RetryOptions + Token string + TokenEnvVars []string + type PaginationOptions struct + Concurrency int + MaxPages int + OnProgress func(page, totalPages, cumulative int) + PerPage int + type RateLimitCache struct + func NewRateLimitCache() *RateLimitCache + func (c *RateLimitCache) Decrement(n int) + func (c *RateLimitCache) Get() (RateLimitSnapshot, bool) + func (c *RateLimitCache) Update(snapshot RateLimitSnapshot) + type RateLimitOptions struct + Enabled bool + MaxWait time.Duration + MinRemaining int + type RateLimitSnapshot struct + Limit int + Remaining int + ResetAt time.Time + func ParseRateLimitHeaders(header rateLimitHeaderSource) (RateLimitSnapshot, bool) + type RetryOptions struct + Enabled bool + InitialBackoff time.Duration + MaxBackoff time.Duration + MaxRetries int + type StatusError struct + Method string + Sentinel error + Status int + URL string + func (e *StatusError) Error() string + func (e *StatusError) Unwrap() []error