config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: Apache-2.0 Imports: 5 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 struct {
	Crawlers []Crawler `yaml:"crawlers"`
	Database Database  `yaml:"database"`
}

func Init

func Init() (cfg Config)

type Crawler

type Crawler struct {
	Name      string    `yaml:"name"`
	OnError   string    `yaml:"on_error"`
	Type      string    `yaml:"type"`
	Method    string    `yaml:"method"`
	Link      string    `yaml:"link"`
	Payload   string    `yaml:"payload"`
	Paginator Paginator `yaml:"paginator"`
	Iterator  Iterator  `yaml:"iterator"`
	Headers   []Header  `yaml:"headers"`
}

func (*Crawler) GetPaginatorOrigin

func (c *Crawler) GetPaginatorOrigin() string

type Database

type Database struct {
	Sslmode  string `yaml:"sslmode"`
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Name     string `yaml:"name"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
}
type Header struct {
	Key   string `yaml:"key"`
	Value string `yaml:"value"`
}

type Iterator

type Iterator struct {
	Type              string `yaml:"type"`
	Regexp            string `yaml:"regex"`
	CollectionPath    string `yaml:"collection_path"`
	IdentificatorPath string `yaml:"identificator_path"`
	Separator         string `yaml:"separator"`
}

type Paginator

type Paginator struct {
	Start int      `yaml:"start"`
	End   int      `yaml:"end"`
	Type  string   `yaml:"type"`
	Sleep Sleep    `yaml:"sleep"`
	Key   string   `yaml:"key"`
	Items []string `yaml:"items"`
}

type Sleep

type Sleep struct {
	Min string `yaml:"min"`
	Max string `yaml:"max"`
}

Jump to

Keyboard shortcuts

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