request

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2024 License: MIT Imports: 8 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) WithHTTPHeaders added in v0.6.1

func (c *Client) WithHTTPHeaders(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 {
	*Request `json:"-" yaml:"-"`

	ID     string   `json:"id" yaml:"id"`
	Tags   []string `json:"tags,omitempty" yaml:"tags,omitempty"`
	Method string   `json:"method" yaml:"method"`
	Path   string   `json:"path" yaml:"path"`

	SecuritySchemes []auth.SecurityScheme `json:"security_schemes" yaml:"security_schemes"`
}

func NewOperation added in v0.3.1

func NewOperation(client *Client, method string, url string, header http.Header, cookies []*http.Cookie, securitySchemes []auth.SecurityScheme) (*Operation, error)

func NewOperationFromRequest added in v0.4.0

func NewOperationFromRequest(r *Request, securitySchemes []auth.SecurityScheme) *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) GetTags added in v0.6.1

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

func (*Operation) SetID added in v0.6.1

func (operation *Operation) SetID(id string)

func (*Operation) SetPath added in v0.6.1

func (operation *Operation) SetPath(path string)

func (*Operation) SetTags added in v0.6.1

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

func (*Operation) WithOpenapiOperation added in v0.6.1

func (operation *Operation) WithOpenapiOperation(path string, 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

	Header  http.Header
	Cookies []*http.Cookie

	SecurityScheme *auth.SecurityScheme
}

func NewRequest added in v0.3.0

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

func (*Request) Clone added in v0.6.1

func (r *Request) Clone(ctx context.Context) *Request

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) WithHTTPHeaders added in v0.6.1

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

func (*Request) WithSecurityScheme added in v0.3.1

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

Jump to

Keyboard shortcuts

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