scraper

package
Version: v0.0.0-...-fdaaeef Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2016 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config map[string]*Endpoint

the configuration file

type Endpoint

type Endpoint struct {
	Name    string                `json:"name,omitempty"`
	Method  string                `json:"method,omitempty"`
	URL     string                `json:"url"`
	Body    string                `json:"body,omitempty"`
	Headers map[string]string     `json:"headers,omitempty"`
	List    string                `json:"list,omitempty"`
	Result  map[string]Extractors `json:"result"`
}

type Extractor

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

func MustExtractor

func MustExtractor(value string) *Extractor

func NewExtractor

func NewExtractor(value string) (*Extractor, error)

func (*Extractor) Set

func (e *Extractor) Set(value string) (err error)

sets the current string Value as the Extractor function

type Extractors

type Extractors []*Extractor

func (Extractors) MarshalJSON

func (ex Extractors) MarshalJSON() ([]byte, error)

func (*Extractors) UnmarshalJSON

func (ex *Extractors) UnmarshalJSON(data []byte) error

type Handler

type Handler struct {
	Auth   string
	Log    bool
	Config Config
}

func (*Handler) LoadConfig

func (h *Handler) LoadConfig(b []byte) error

func (*Handler) LoadConfigFile

func (h *Handler) LoadConfigFile(path string) error

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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