github_ratelimit_test

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidBodyContent = `{"message": "not as expected"}`
)

Variables

This section is empty.

Functions

func IsInvalidBody added in v1.0.4

func IsInvalidBody(resp *http.Response) (bool, error)

Types

type SecondaryRateLimitInjecter

type SecondaryRateLimitInjecter struct {
	AbuseAttempts int
	// contains filtered or unexported fields
}

func (*SecondaryRateLimitInjecter) CurrentSleepEnd

func (r *SecondaryRateLimitInjecter) CurrentSleepEnd() time.Time

func (*SecondaryRateLimitInjecter) NextSleepStart

func (r *SecondaryRateLimitInjecter) NextSleepStart() time.Time

func (*SecondaryRateLimitInjecter) RoundTrip

func (t *SecondaryRateLimitInjecter) RoundTrip(request *http.Request) (*http.Response, error)

type SecondaryRateLimitInjecterOptions

type SecondaryRateLimitInjecterOptions struct {
	Every               time.Duration
	Sleep               time.Duration
	UseXRateLimit       bool
	UsePrimaryRateLimit bool
	InvalidBody         bool
}

func (*SecondaryRateLimitInjecterOptions) IsNoop

func (*SecondaryRateLimitInjecterOptions) Validate

Jump to

Keyboard shortcuts

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