Documentation
¶
Index ¶
- func New(base http.RoundTripper, opts ...any) http.RoundTripper
- func NewClient(base http.RoundTripper, opts ...any) *http.Client
- func WithOverrideConfig(ctx context.Context, opts ...any) context.Context
- type PrimaryRateLimiter
- type PrimaryRateLimiterOption
- type SecondaryRateLimiter
- type SecondaryRateLimiterOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(base http.RoundTripper, opts ...any) http.RoundTripper
New creates a combined limiter by stacking a SecondaryRateLimiter on top of a PrimaryRateLimiterOption. It accepts options of both types and creates the RoundTrippers. Check out options.go @ github_primary_ratelimit / github_secondary_ratelimit for available options.
func NewClient ¶ added in v2.0.2
func NewClient(base http.RoundTripper, opts ...any) *http.Client
NewClient creates a new HTTP client with the combined rate limiter.
func WithOverrideConfig ¶
WithOverrideConfig adds config overrides to the context. The overrides are applied on top of the existing config. Allows for request-specific overrides. It accepts options of both types and overrides accordingly.
Types ¶
type PrimaryRateLimiter ¶
type PrimaryRateLimiter = github_primary_ratelimit.PrimaryRateLimiter
func NewPrimaryLimiter ¶
func NewPrimaryLimiter(base http.RoundTripper, opts ...PrimaryRateLimiterOption) *PrimaryRateLimiter
NewPrimaryLimiter is an alias for github_primary_ratelimit.New. Check out options.go @ github_primary_ratelimit for available options.
type PrimaryRateLimiterOption ¶
type PrimaryRateLimiterOption = github_primary_ratelimit.Option
type SecondaryRateLimiter ¶
type SecondaryRateLimiter = github_secondary_ratelimit.SecondaryRateLimiter
func NewSecondaryLimiter ¶
func NewSecondaryLimiter(base http.RoundTripper, opts ...SecondaryRateLimiterOption) *SecondaryRateLimiter
NewSecondaryLimiter is an alias for github_secondary_ratelimit.New. Check out options.go @ github_secondary_ratelimit for available options.
type SecondaryRateLimiterOption ¶
type SecondaryRateLimiterOption = github_secondary_ratelimit.Option