config

package
v0.17.3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScanInterval          = 180     // Every 3 hours
	SubscriptionsInterval = 60 * 24 // Every 24 hours
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host    string `yaml:"host"`
	Port    string `yaml:"port"`
	Logging struct {
		Level        log.Level `yaml:"level"`
		LogToFile    bool      `yaml:"log_to_file"`
		LogToConsole bool      `yaml:"log_to_console"`
	} `yaml:"logging"`
	Paths                  Paths           `yaml:"paths"`
	SessionSecret          *encryption.Key `yaml:"session_secret"`
	ScanInterval           *task.Job       `yaml:"scan_interval_minutes"`
	SubscriptionsInterval  *task.Job       `yaml:"subscriptions_interval_minutes"`
	MaxUploadedFileSizeMiB int             `yaml:"max_uploaded_file_size_mib"`
	DebugMode              bool            `yaml:"debug_mode"`
}

func DefaultConfig

func DefaultConfig() *Config

func LoadConfig

func LoadConfig(fp string) *Config

LoadConfig attempts to read Config from a filepath and returns the default Config if unsuccessful

func (*Config) Save

func (c *Config) Save(fp string) error

type Paths

type Paths struct {
	DB      string // Path to the database and its files i.e. WAL file
	Log     string // Where tanuki should log to
	Library string // Where tanuki stores uploaded/downloaded manga
}

Paths contains directory/file Paths which tanuki uses in order to navigate to the right file

func (Paths) EnsureExist

func (p Paths) EnsureExist(logFile bool) error

EnsureExist ensures that the required directories for the paths exist

Jump to

Keyboard shortcuts

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