config

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventFunc

type EventFunc func(event string)

type FuseGlobal

type FuseGlobal struct {
	AllowOther bool   `yaml:"allow_other,omitempty"`
	Path       string `yaml:"path"`
}

type HTTPGlobal

type HTTPGlobal struct {
	Port   int    `yaml:"port"`
	IP     string `yaml:"ip"`
	HTTPFS bool   `yaml:"httpfs"`
}

type Handler

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

func NewHandler

func NewHandler(path string) *Handler

func (*Handler) Get

func (c *Handler) Get() (*Root, error)

func (*Handler) GetRaw

func (c *Handler) GetRaw() ([]byte, error)

type Log

type Log struct {
	Debug      bool   `yaml:"debug"`
	MaxBackups int    `yaml:"max_backups"`
	MaxSize    int    `yaml:"max_size"`
	MaxAge     int    `yaml:"max_age"`
	Path       string `yaml:"path"`
}

type ReloadFunc

type ReloadFunc func(*Root, EventFunc) error

type Root

type Root struct {
	HTTPGlobal *HTTPGlobal    `yaml:"http"`
	WebDAV     *WebDAVGlobal  `yaml:"webdav"`
	Torrent    *TorrentGlobal `yaml:"torrent"`
	Fuse       *FuseGlobal    `yaml:"fuse"`
	Log        *Log           `yaml:"log"`

	Routes  []*Route  `yaml:"routes"`
	Servers []*Server `yaml:"servers"`
}

Root is the main yaml config object

func AddDefaults

func AddDefaults(r *Root) *Root

func DefaultConfig

func DefaultConfig() *Root

type Route

type Route struct {
	Name          string     `yaml:"name"`
	Torrents      []*Torrent `yaml:"torrents"`
	TorrentFolder string     `yaml:"torrent_folder"`
}

type Server

type Server struct {
	Name       string   `yaml:"name"`
	Path       string   `yaml:"path"`
	Trackers   []string `yaml:"trackers"`
	TrackerURL string   `yaml:"tracker_url"`
}

type Torrent

type Torrent struct {
	MagnetURI   string `yaml:"magnet_uri,omitempty"`
	TorrentPath string `yaml:"torrent_path,omitempty"`
}

type TorrentGlobal

type TorrentGlobal struct {
	ReadTimeout     int    `yaml:"read_timeout,omitempty"`
	AddTimeout      int    `yaml:"add_timeout,omitempty"`
	GlobalCacheSize int64  `yaml:"global_cache_size,omitempty"`
	MetadataFolder  string `yaml:"metadata_folder,omitempty"`
	DisableIPv6     bool   `yaml:"disable_ipv6,omitempty"`
}

type WebDAVGlobal

type WebDAVGlobal struct {
	Port int    `yaml:"port"`
	User string `yaml:"user"`
	Pass string `yaml:"pass"`
}

Jump to

Keyboard shortcuts

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