request

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRequest

type BaseRequest struct {
	URL         string `json:"URL" binding:"required"`
	ContentType string `json:"ContentType" binding:"required"` //Content-Type in http header
	Content     string `json:"Content" binding:"required"`     //base64
	UrlParsed   *url.URL
	BaseURL     *url.URL
	Responsec   chan interface{}
}

BaseRequest is base request

func (BaseRequest) Url

func (b BaseRequest) Url() string

type ExtractRequest

type ExtractRequest struct {
	BaseRequest
	Template *pgextract.Template `json:"template" binding:"required"`
	Exfunc   func(*ExtractRequest)
}

ExtractRequest is Extract related request

func (ExtractRequest) Executor

func (e ExtractRequest) Executor(req interface{})

func (*ExtractRequest) UnmarshalJSON

func (e *ExtractRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON Deserialization

type Request

type Request struct {
	BaseRequest
	IfRegexp             bool     `json:"IfRegexp,omitempty"`
	OnlyHomeSite         bool     `json:"OnlyHomeSite,omitempty"`
	CSSSelectors         []string `json:"CSSSelectors,omitempty"`
	XPathQuerys          []string `json:"XPathQuerys,omitempty"`
	AllowedDomains       []string `json:"AllowedDomains,omitempty"`
	DisallowedDomains    []string `json:"DisallowedDomains,omitempty"`
	DisallowedURLFilters []string `json:"DisallowedURLFilters,omitempty"`
	AllowedURLFilters    []string `json:"AllowedURLFilters,omitempty"`
	AllowedExts          []string `json:"AllowedExts,omitempty"`

	Exfunc func(*Request)
	// contains filtered or unexported fields
}

Request TODO

func (*Request) AbsoluteURL

func (r *Request) AbsoluteURL(u string) string

func (Request) Executor

func (e Request) Executor(req interface{})

func (*Request) IsAllowed

func (r *Request) IsAllowed(u string) bool

func (*Request) UnmarshalJSON

func (r *Request) UnmarshalJSON(b []byte) error

UnmarshalJSON Deserialization

type Response

type Response = sth.Result

Response TODO

Jump to

Keyboard shortcuts

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