setting

package
v0.6.12 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2021 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type C

type C struct {
	Global Global           `yaml:"GLOBAL"`
	Tasks  map[string]*Task `yaml:"TASKS"`
}

C :)

func Parse

func Parse(r io.Reader) (config *C, e error)

Parse :)

type ContentSize

type ContentSize struct {
	Min Int64 `yaml:"min"`
	Max Int64 `yaml:"max"`
}

ContentSize :)

type Duration

type Duration struct {
	T time.Duration
}

Duration wraps time.Duration

func (*Duration) UnmarshalYAML

func (t *Duration) UnmarshalYAML(uf func(interface{}) error) (e error)

UnmarshalYAML :)

type Edit

type Edit struct {
	Tracker Tracker `yaml:"tracker"`
}

Edit :)

func (*Edit) EditTorrent

func (edt *Edit) EditTorrent(data []byte) (en []byte, err error)

EditTorrent tmp

type Filter

type Filter struct {
	ContentSize ContentSize  `yaml:"content_size"`
	Regexp      RegexpConfig `yaml:"regexp"`
}

Filter :)

type Global

type Global struct {
	LogFile string `yaml:"log_file"`
	History struct {
		MaxNum int    `yaml:"max_num"`
		Save   string `yaml:"save_to"`
	} `yaml:"history"`
	Timeout Duration `yaml:"timeout"`
}

Global is global configs.

type Header struct {
	H map[string][]string
}

Header :)

func (*Header) UnmarshalYAML

func (h *Header) UnmarshalYAML(uf func(interface{}) error) (e error)

UnmarshalYAML :)

type Int64

type Int64 struct {
	I int64
}

Int64 is int64

func (*Int64) UnmarshalYAML

func (n *Int64) UnmarshalYAML(uf func(interface{}) error) (e error)

UnmarshalYAML :)

type Quota

type Quota struct {
	Num  int   `yaml:"num"`
	Size Int64 `yaml:"size"`
}

Quota :)

type Receiver

type Receiver struct {
	Delay  Duration                          `yaml:"delay"`
	Save   *string                           `yaml:"save_path"`
	Client map[string]map[string]interface{} `yaml:"client"`
}

Receiver defines tasks' receiver(s).

type Reg

type Reg struct {
	R *regexp.Regexp
	C string
}

Reg :)

func (*Reg) UnmarshalYAML

func (r *Reg) UnmarshalYAML(uf func(interface{}) error) (e error)

UnmarshalYAML :)

type RegexpConfig

type RegexpConfig struct {
	Accept []Reg `yaml:"accept"`
	Reject []Reg `yaml:"reject"`
}

RegexpConfig :)

type Rss

type Rss struct {
	URL      string   `yaml:"url"`
	Method   string   `yaml:"method"`
	Headers  Header   `yaml:"headers"`
	Interval Duration `yaml:"interval"`
}

Rss :)

type Task

type Task struct {
	Rss      *Rss     `yaml:"rss"`
	Filter   Filter   `yaml:"filter"`
	Quota    Quota    `yaml:"quota"`
	Edit     *Edit    `yaml:"edit"`
	Receiver Receiver `yaml:"receiver"`
}

Task is task part.

type Tracker

type Tracker struct {
	Delete []Reg    `yaml:"delete"`
	Add    []string `yaml:"add"`
}

Tracker :)

Jump to

Keyboard shortcuts

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