protocol

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiSpec added in v0.5.1

type ApiSpec interface {
	IsCrypto() bool
	SetCryptoKey(key string)
	Url() string
	Payload() Payload
	Parse(r io.Reader) (err error)
}

ApiSpec describes the specification of an API.

type Client

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

func NewClient

func NewClient(hc plugin.HttpClient) *Client

func (*Client) ExecuteApi added in v0.5.1

func (c *Client) ExecuteApi(spec ApiSpec) (err error)

func (*Client) ExportCookies

func (c *Client) ExportCookies(url string) map[string]string

func (*Client) Get

func (c *Client) Get(url string, headers map[string]string) (body io.ReadCloser, err error)

func (*Client) GetContent

func (c *Client) GetContent(url string) (data []byte, err error)

func (*Client) GetUserAgent

func (c *Client) GetUserAgent() string

func (*Client) ImportCookies

func (c *Client) ImportCookies(cookies map[string]string, domains ...string)

func (*Client) Post

func (c *Client) Post(url string, payload Payload) (body io.ReadCloser, err error)

func (*Client) SetUserAgent

func (c *Client) SetUserAgent(name string)

func (*Client) SetupValve

func (c *Client) SetupValve(cdMin, cdMax uint)

func (*Client) Touch

func (c *Client) Touch(url string) error

type Payload

type Payload interface {
	io.Reader
	ContentType() string
	ContentLength() int64
}

type Valve

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

func (*Valve) ClockIn

func (v *Valve) ClockIn()

func (*Valve) Wait

func (v *Valve) Wait()

Jump to

Keyboard shortcuts

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