site

package
v0.0.0-...-799c480 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDuplicate = errors.New("site: duplicate key")
)

Functions

func Register

func Register(site Site)

Types

type Mark

type Mark struct {
	Name  string `json:"name"`
	Path  string `json:"path,omitempty"`
	Marks []Mark `json:"marks,omitempty"`
}

type Option

type Option interface {
	Apply(*Site)
}

func Attribution

func Attribution(contentMd string) Option

func Redirects

func Redirects(fromto ...string) Option

func Title

func Title(title string) Option

func TrimPathPrefix

func TrimPathPrefix(prefix string) Option

type OptionFunc

type OptionFunc func(*Site)

func (OptionFunc) Apply

func (f OptionFunc) Apply(c *Site)

type Scraper

type Scraper struct{}

func (Scraper) Run

func (r Scraper) Run(ctx context.Context, s Site) error

type Site

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

func Get

func Get(key string) Site

func New

func New(key string, crawler crawl.Crawler, pipeline pipe.Pipeline, options ...Option) Site

func (Site) Key

func (s Site) Key() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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