cycletls

package module
v0.0.0-...-7093d56 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDateString

func ParseDateString(dt string) (time.Time, error)

ParseDateString takes a string and passes it through Approxidate Parses into a time.Time

Types

type ContextKeyHeader

type ContextKeyHeader struct{}

ContextKeyHeader Users of context.WithValue should define their own types for keys

type Cookie struct {
	Name  string `json:"name"`
	Value string `json:"value"`

	Path        string `json:"path"`   // optional
	Domain      string `json:"domain"` // optional
	Expires     time.Time
	JSONExpires Time   `json:"expires"`    // optional
	RawExpires  string `json:"rawExpires"` // for reading cookies only

	// MaxAge=0 means no 'Max-Age' attribute specified.
	// MaxAge<0 means delete cookie now, equivalently 'Max-Age: 0'
	// MaxAge>0 means Max-Age attribute present and given in seconds
	MaxAge   int           `json:"maxAge"`
	Secure   bool          `json:"secure"`
	HTTPOnly bool          `json:"httpOnly"`
	SameSite http.SameSite `json:"sameSite"`
	Raw      string
	Unparsed []string `json:"unparsed"` // Raw text of unparsed attribute-value pairs
}

A Cookie represents an HTTP cookie as sent in the Set-Cookie header of an HTTP response or the Cookie header of an HTTP request.

See https://tools.ietf.org/html/rfc6265 for details. Stolen from Net/http/cookies

type CycleTLS

type CycleTLS struct {
	ReqChan  chan fullRequest
	RespChan chan Response
}

CycleTLS creates full request and response

func Init

func Init(workers ...bool) CycleTLS

Init starts the worker pool or returns a empty cycletls struct

func (CycleTLS) Close

func (client CycleTLS) Close()

Close closes channels

func (CycleTLS) Do

func (client CycleTLS) Do(URL string, options Options, Method string) (response Response, err error)

Do creates a single request

func (CycleTLS) Queue

func (client CycleTLS) Queue(URL string, options Options, Method string)

Queue queues request in worker pool

type Options

type Options struct {
	URL             string            `json:"url"`
	Method          string            `json:"method"`
	Headers         map[string]string `json:"headers"`
	Body            string            `json:"body"`
	Ja3             string            `json:"ja3"`
	UserAgent       string            `json:"userAgent"`
	Proxy           string            `json:"proxy"`
	Cookies         []Cookie          `json:"cookies"`
	Timeout         int               `json:"timeout"`
	DisableRedirect bool              `json:"disableRedirect"`
}

Options sets CycleTLS client options

type Response

type Response struct {
	RequestID string
	Response  respData
}

Response contains Cycletls response data

type Time

type Time struct {
	time.Time
}

Time wraps time.Time overriddin the json marshal/unmarshal to pass timestamp as integer

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(buf []byte) error

UnmarshalJSON implements json.Unmarshaler inferface.

Jump to

Keyboard shortcuts

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