web

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Crawler

type Crawler interface {
	BasicAuth(username, password string) Crawler
	DigestAuth(username, password string) Crawler
	Download(options Request) (filePath string, err error)
	Probe(Request) (int, []byte, error)
}

func New added in v0.9.0

func New() Crawler

type DigestHeaders added in v0.12.0

type DigestHeaders struct {
	Realm     string
	Qop       string
	Method    string
	Nonce     string
	Opaque    string
	Algorithm string
	HA1       string
	HA2       string
	Cnonce    string
	Path      string
	Nc        int16
	Username  string
	Password  string
}

DigestHeaders tracks the state of authentication

func (*DigestHeaders) ApplyAuth added in v0.12.0

func (d *DigestHeaders) ApplyAuth(req *http.Request)

ApplyAuth adds proper auth header to the passed request

func (*DigestHeaders) Auth added in v0.12.0

func (d *DigestHeaders) Auth(username string, password string, uri string) (*DigestHeaders, error)

Auth authenticates against a given URI

type Request

type Request struct {
	Method  string
	Url     string
	Body    []byte
	Headers []map[string]string
	Timeout time.Duration
}

Request ...

Jump to

Keyboard shortcuts

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