config

package
v1.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Delimiter = "."
	Config    *Configuration
	K         = koanf.New(Delimiter)
)

Functions

func GetDefaultConfigDirectory added in v1.4.2

func GetDefaultConfigDirectory(app string, filename string) string

func Init

func Init(configFilePath string) error

func ShowUsing

func ShowUsing()

func ValidateStruct

func ValidateStruct(s interface{}) []error

Types

type Configuration

type Configuration struct {
	Clients  map[string]map[string]interface{}
	Filters  map[string]FilterConfiguration
	Trackers tracker.Config
}

type DefaultValidator

type DefaultValidator struct {
}

func (DefaultValidator) Validate

func (v DefaultValidator) Validate(val reflect.Value) (bool, error)

type FilterConfiguration

type FilterConfiguration struct {
	Ignore []string
	Remove []string
	Label  []struct {
		Name   string
		Update []string
	}
}

type RequiredValidator

type RequiredValidator struct {
}

func (RequiredValidator) Validate

func (v RequiredValidator) Validate(val reflect.Value) (bool, error)

type Torrent

type Torrent struct {
	// torrent
	Hash            string   `json:"Hash"`
	Name            string   `json:"Name"`
	Path            string   `json:"Path"`
	TotalBytes      int64    `json:"TotalBytes"`
	DownloadedBytes int64    `json:"DownloadedBytes"`
	State           string   `json:"State"`
	Files           []string `json:"Files"`
	Downloaded      bool     `json:"Downloaded"`
	Seeding         bool     `json:"Seeding"`
	Ratio           float32  `json:"Ratio"`
	AddedSeconds    int64    `json:"AddedSeconds"`
	AddedHours      float32  `json:"AddedHours"`
	AddedDays       float32  `json:"AddedDays"`
	SeedingSeconds  int64    `json:"SeedingSeconds"`
	SeedingHours    float32  `json:"SeedingHours"`
	SeedingDays     float32  `json:"SeedingDays"`
	Label           string   `json:"Label"`
	Seeds           int64    `json:"Seeds"`
	Peers           int64    `json:"Peers"`

	// set by client on GetCurrentFreeSpace
	FreeSpaceGB  func() float64 `json:"-"`
	FreeSpaceSet bool           `json:"-"`

	// tracker
	TrackerName   string `json:"TrackerName"`
	TrackerStatus string `json:"TrackerStatus"`
}

func (*Torrent) IsUnregistered added in v1.1.0

func (t *Torrent) IsUnregistered() bool

type Validator

type Validator interface {
	Validate(reflect.Value) (bool, error)
}

Jump to

Keyboard shortcuts

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