http

package
v0.0.0-...-8fe63c4 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetURL

func GetURL(r data.Request, parser BodyParser) (data.Response, error)

GetURL sends all links found in page back http.Client misbehaves and might create too many goroutines

func Server

func Server(port string, filterRequests chan<- data.Request) error

Server starts new HTTP server that receives external requests sends request to be filtered on Crawler

func WebClient

func WebClient(parser BodyParser, webRequests <-chan data.Request, responses chan<- data.Response, shutdown <-chan bool) error

WebClient that runs through external requests to crawl

Types

type BasicBodyParser

type BasicBodyParser struct {
	MaxLinks int
}

BasicBodyParser basic implementation for a href

func (BasicBodyParser) Parse

func (r BasicBodyParser) Parse(body io.Reader, request data.Request) data.Response

Parse handling links from body reader out to Response moving ioReader to chan would create issues with pointer links are A tag, Link Tag and Nav tag but we check A no JS parsing

type BodyParser

type BodyParser interface {
	Parse(body io.Reader, request data.Request) data.Response
}

BodyParser interface for new ways to parse body

type NewRequestHandler

type NewRequestHandler struct {
	FilterRequests chan<- data.Request
}

NewRequestHandler Parses and sends requests to Crawler

func (NewRequestHandler) Post

Post Parses Post and sends to Crawler queue

Jump to

Keyboard shortcuts

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