config

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScanInterval = 180 // Every 3 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                *logging.Config `yaml:"logging"`
	Paths                  *Paths          `yaml:"paths"`
	SessionSecret          *encryption.Key `yaml:"session_secret"`
	ScanInterval           *task.Job       `yaml:"scan_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
	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() 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