config

package
v1.0.1-dev Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Config exports the config object
	Config *Configuration
	// Runtime flags/config
	Runtime      *RuntimeConfig
	RuntimeViper = viper.New()
	// ldflags (set by makefile or goreleaser)
	Build *BuildVars
	// State
	Pvr = make(map[string]*PvrInstance)
)

Functions

func Init

func Init(build *BuildVars) error

func InitRuntime

func InitRuntime() error

Types

type BuildVars

type BuildVars struct {
	// Version
	Version string
	// Timestamp
	Timestamp string
	// Git commit
	GitCommit string
}

BuildVars build details

type Configuration

type Configuration struct {
	Database DatabaseConfiguration
	Server   ServerConfig
	Pvr      []PvrConfig
	Trackers map[string]TrackerConfig
}

func (Configuration) ToJsonString

func (cfg Configuration) ToJsonString() (string, error)

type DatabaseConfiguration

type DatabaseConfiguration struct {
	MaxAgeHours int
}

type MessagePatternType

type MessagePatternType int
const (
	LinePattern MessagePatternType = iota + 1
	MultiLinePattern
)

type PvrConfig

type PvrConfig struct {
	Name    string
	Enabled bool
	URL     string
	ApiKey  string
	Filters *PvrFilters
}

type PvrFilters

type PvrFilters struct {
	Ignores []string
	Accepts []string
	Delays  []string
}

type PvrInstance

type PvrInstance struct {
	Config      *PvrConfig
	IgnoresExpr []*vm.Program
	AcceptsExpr []*vm.Program
	DelaysExpr  []*vm.Program
}

type ReleaseInfo

type ReleaseInfo struct {
	TrackerName string
	ReleaseTime string
	TorrentName string
	TorrentURL  string
	SizeString  string
	SizeBytes   int64
	Category    string
	Encoder     string
	Resolution  string
	Container   string
	Origin      string
	Tags        string
	Files       []string
}

type RuntimeConfig

type RuntimeConfig struct {
	Verbose  int
	Config   string
	Log      string
	DB       string
	Trackers string
	Version  bool
}

type ServerConfig

type ServerConfig struct {
	Host      string
	Port      uint
	ApiKey    string
	PublicURL string
	User      string
	Pass      string
}

type TrackerBencodeConfig

type TrackerBencodeConfig struct {
	Name bool
	Size bool
}

type TrackerConfig

type TrackerConfig struct {
	Enabled  bool
	Bencode  *TrackerBencodeConfig
	Settings map[string]string
	IRC      *TrackerIrcConfig
}

type TrackerIgnore

type TrackerIgnore struct {
	Rxp      *regexp.Regexp
	Expected bool
}

type TrackerInfo

type TrackerInfo struct {
	Name       string
	ShortName  *string
	LongName   string
	Settings   []string
	Servers    []string
	Channels   []string
	Announcers []string

	IgnoreLines       []TrackerIgnore
	LinePatterns      []TrackerPattern
	MultiLinePatterns []TrackerPattern

	LineMatchedRules *xmlquery.Node
}

type TrackerInstance

type TrackerInstance struct {
	Name   string
	Config *TrackerConfig
	Info   *TrackerInfo
	IRC    *irc.Connection
}

type TrackerIrcConfig

type TrackerIrcConfig struct {
	Nickname   string
	Channels   []string
	Announcers []string
	Commands   []string
	Host       *string
	Port       *string
	Verbose    bool
}

type TrackerPattern

type TrackerPattern struct {
	PatternType MessagePatternType
	Rxp         *regexp.Regexp
	Vars        []string
	Optional    bool
}

Jump to

Keyboard shortcuts

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