requester

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrListSessions = fmt.Errorf("failed to list sessions")
)

Functions

This section is empty.

Types

type FlareSolverr

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

func NewFlareSolverr

func NewFlareSolverr(url string, timeoutMilli int) *FlareSolverr

func (*FlareSolverr) CreateSession

func (f *FlareSolverr) CreateSession() string

func (*FlareSolverr) FillSessionPool

func (f *FlareSolverr) FillSessionPool() error

func (*FlareSolverr) Get

func (f *FlareSolverr) Get(_url string) (io.ReadCloser, error)

func (*FlareSolverr) ListSessions

func (f *FlareSolverr) ListSessions() ([]string, error)

func (*FlareSolverr) RetrieveSession

func (f *FlareSolverr) RetrieveSession() string

type Requster

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

func NewRequester

func NewRequester(fs *FlareSolverr, c *cache.Redis) *Requster

func (*Requster) GetDocument

func (i *Requster) GetDocument(ctx context.Context, url string) (io.ReadCloser, error)

func (*Requster) SetShortLivedCacheExpiration added in v0.8.0

func (i *Requster) SetShortLivedCacheExpiration(expiration time.Duration)

type Response

type Response struct {
	Status   string `json:"status"`
	Message  string `json:"message"`
	Solution struct {
		Url     string `json:"url"`
		Status  int    `json:"status"`
		Cookies []struct {
			Domain   string `json:"domain"`
			Expiry   int    `json:"expiry"`
			HttpOnly bool   `json:"httpOnly"`
			Name     string `json:"name"`
			Path     string `json:"path"`
			SameSite string `json:"sameSite"`
			Secure   bool   `json:"secure"`
			Value    string `json:"value"`
		} `json:"cookies"`
		UserAgent string            `json:"userAgent"`
		Headers   map[string]string `json:"headers"`
		Response  string            `json:"response"`
	} `json:"solution"`
}

Jump to

Keyboard shortcuts

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