request

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClient = NewClient(NewClientOptions{})

Functions

This section is empty.

Types

type Client added in v0.6.1

type Client struct {
	*http.Client
	Header  http.Header
	Cookies []*http.Cookie
}

func NewClient added in v0.6.1

func NewClient(opts NewClientOptions) *Client

func (*Client) WithCookies added in v0.6.1

func (c *Client) WithCookies(cookies []*http.Cookie) *Client

func (*Client) WithHeader added in v0.7.2

func (c *Client) WithHeader(header http.Header) *Client

type NewClientOptions added in v0.6.1

type NewClientOptions struct {
	Timeout   time.Duration
	RateLimit int // requests per second
	ProxyURL  *url.URL

	Header  http.Header
	Cookies []*http.Cookie
}

type Operation added in v0.3.1

type Operation struct {
	*Client `json:"-" yaml:"-"`

	Method          string                `json:"method" yaml:"method"`
	URL             *url.URL              `json:"url" yaml:"url"`
	Body            *bytes.Buffer         `json:"body,omitempty" yaml:"body,omitempty"`
	Cookies         []*http.Cookie        `json:"cookies,omitempty" yaml:"cookies,omitempty"`
	Header          http.Header           `json:"header,omitempty" yaml:"header,omitempty"`
	SecuritySchemes []auth.SecurityScheme `json:"security_schemes" yaml:"security_schemes"`

	ID   string   `json:"id" yaml:"id"`
	Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"`
}

func NewOperation added in v0.3.1

func NewOperation(method string, operationUrl string, body *bytes.Buffer, client *Client) (*Operation, error)

func NewOperationFromRequest added in v0.4.0

func NewOperationFromRequest(r *Request) *Operation

func (*Operation) Clone added in v0.3.1

func (o *Operation) Clone() *Operation

func (*Operation) GetID added in v0.6.1

func (operation *Operation) GetID() string

func (*Operation) GetPath added in v0.6.1

func (operation *Operation) GetPath() string

func (*Operation) GetSecuritySchemes added in v0.7.2

func (operation *Operation) GetSecuritySchemes() []auth.SecurityScheme

func (*Operation) GetTags added in v0.6.1

func (operation *Operation) GetTags() []string

func (*Operation) IsReachable added in v0.7.1

func (operation *Operation) IsReachable() error

func (*Operation) NewRequest added in v0.7.2

func (operation *Operation) NewRequest() (*Request, error)

func (*Operation) SetID added in v0.6.1

func (operation *Operation) SetID(id string) *Operation

func (*Operation) SetSecuritySchemes added in v0.7.2

func (operation *Operation) SetSecuritySchemes(securitySchemes []auth.SecurityScheme) *Operation

func (*Operation) SetTags added in v0.6.1

func (operation *Operation) SetTags(tags []string) *Operation

func (*Operation) WithCookies added in v0.7.2

func (operation *Operation) WithCookies(cookies []*http.Cookie) *Operation

func (*Operation) WithHeader added in v0.7.2

func (operation *Operation) WithHeader(header http.Header) *Operation

func (*Operation) WithOpenapiOperation added in v0.6.1

func (operation *Operation) WithOpenapiOperation(openapiOperation openapi3.Operation) *Operation

type Operations added in v0.3.1

type Operations []*Operation

func (Operations) Len added in v0.3.1

func (o Operations) Len() int

func (Operations) Less added in v0.3.1

func (o Operations) Less(i, j int) bool

func (Operations) Swap added in v0.3.1

func (o Operations) Swap(i, j int)

type Request added in v0.3.1

type Request struct {
	*Client
	*http.Request
}

func NewRequest added in v0.3.0

func NewRequest(method string, reqUrl string, body io.Reader, client *Client) (*Request, error)

func (*Request) Do added in v0.3.1

func (r *Request) Do() (*http.Response, error)

func (*Request) WithCookies added in v0.6.1

func (r *Request) WithCookies(cookies []*http.Cookie) *Request

func (*Request) WithHeader added in v0.7.2

func (r *Request) WithHeader(header http.Header) *Request

func (*Request) WithSecurityScheme added in v0.3.1

func (r *Request) WithSecurityScheme(securityScheme auth.SecurityScheme) *Request

Jump to

Keyboard shortcuts

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