service

package
v0.0.0-...-98f7181 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyURLs = errors.New("empty urls")
)

error consts

Functions

This section is empty.

Types

type Middleware

type Middleware func(Service) Service

Middleware describes a service middleware.

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) Middleware

LoggingMiddleware takes a logger as a dependency and returns a LoggingMiddleware.

type Service

type Service interface {
	PostURLs(urls []string) ([]crawl.Result, error)
}

Service service interface

func New

func New(crawl crawl.Crawl, maxWorkers int, logger log.Logger) Service

New returns a basic Service with all of the expected middlewares wired in.

func NewBasicService

func NewBasicService(crawl crawl.Crawl, maxWorkers int) Service

NewBasicService returns a native, stateless implementation of Service.

Jump to

Keyboard shortcuts

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