requests

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthProvider

type AuthProvider interface {
	AuthorizationHeader(ctx context.Context) (string, error)
}

AuthProvider sets the Authorization header authenticate you with the API

type Option

type Option func(opts *Options)

Option is a request option

type Options

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

Options is options

func BuildOptions

func BuildOptions(opt ...Option) *Options

BuildOptions turns a list of opt into *Options

func (*Options) AllPreviews

func (o *Options) AllPreviews() bool

AllPreviews returns bool

func (*Options) AuthProvider

func (o *Options) AuthProvider() AuthProvider

AuthProvider returns AuthProvider

func (*Options) BaseURL

func (o *Options) BaseURL() url.URL

BaseURL returns baseURL

func (*Options) HttpClient

func (o *Options) HttpClient() *http.Client

HttpClient return httpClient

func (*Options) RequiredPreviews

func (o *Options) RequiredPreviews() bool

RequiredPreviews returns bool

func (*Options) SetAllPreviews

func (o *Options) SetAllPreviews(allPreviews bool)

SetAllPreviews sets bool

func (*Options) SetAuthProvider

func (o *Options) SetAuthProvider(authProvider AuthProvider)

SetAuthProvider sets AuthProvider

func (*Options) SetBaseURL

func (o *Options) SetBaseURL(baseURL url.URL)

SetBaseURL sets baseURL

func (*Options) SetHttpClient

func (o *Options) SetHttpClient(httpClient *http.Client)

SetHttpClient sets httpClient

func (*Options) SetRequiredPreviews

func (o *Options) SetRequiredPreviews(requiredPreviews bool)

SetRequiredPreviews sets bool

func (*Options) SetUserAgent

func (o *Options) SetUserAgent(userAgent string)

SetUserAgent sets userAgent

func (*Options) UserAgent

func (o *Options) UserAgent() string

UserAgent returns userAgent

type RequestError

type RequestError struct {
	Message string
}

RequestError is an error building an *http.Request

func (*RequestError) Error

func (e *RequestError) Error() string

Jump to

Keyboard shortcuts

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