getter

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: MIT Imports: 15 Imported by: 2

README

getter

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrRateLimited ...
	ErrRateLimited = &Error{ErrorString: "rate limited"}
	// ErrRateLimitingDown ...
	ErrRateLimitingDown = &Error{ErrorString: "rate limiting is down"}
	// ErrRateLimitingInvalid ...
	ErrRateLimitingInvalid = &Error{ErrorString: "invalid internal data in rate limiting"}
)

Functions

This section is empty.

Types

type Error

type Error struct {
	ErrorString string
}

Error ...

func (*Error) Error

func (ge *Error) Error() string

type Getter

type Getter interface {
	SetDefaultTimeout(timeout time.Duration)
	SetUserAgent(useragent string)
	SetCache(cache rediscache.Cache)
	AddRateLimit(host, bucket string, count int64) error
	FetchResponse(r Request) *Response
}

Getter definition

func NewGetter

func NewGetter(log *logger.Logger) Getter

NewGetter ...

type RateLimit

type RateLimit struct {
	// contains filtered or unexported fields
}

RateLimit ...

type RateLimits

type RateLimits struct {
	// contains filtered or unexported fields
}

RateLimits ...

type Request

type Request struct {
	Timeout       time.Duration
	Method        string
	Path          string
	Query         map[string]string
	Headers       map[string]string
	SendFormData  bool
	FormData      url.Values
	FormDataMap   map[string]string
	SendJSONData  bool
	JSONData      []byte
	JSONInterface interface{}
	SaveToDisk    bool
}

Request ...

type Response

type Response struct {
	Code        int
	ContentType string
	Data        []byte
	DataPath    string
	Error       error
}

Response ...

Jump to

Keyboard shortcuts

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