config

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2021 License: Apache-2.0, BSD-3-Clause, CC-BY-4.0, + 2 more Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(path string)

func SaveConfig

func SaveConfig(path string) error

Types

type Config

type Config struct {
	Webserver                WebserverConfig `toml:"webserver"`
	ZFS                      ZFSConfig       `toml:"zfs"`
	UseCacheDirForBackups    bool            `toml:"use-cache-dir-for-backups"`
	DaysToScan               int             `toml:"days-to-scan"`
	MaxArchiveUnpackedSizeMB int             `toml:"max-archive-unpacked-size-mb"`
	SnapshotNameTemplate     string          `toml:"snapshot-name-template"`
	CompareMethod            string          `toml:"compare-method"`
	DiffContextSize          int             `toml:"diff-context-size"`
}
var Get Config = Config{
	Webserver:                NewDefaultWebserverConfig(),
	ZFS:                      NewDefaultZFSConfig(),
	UseCacheDirForBackups:    true,
	DaysToScan:               2,
	MaxArchiveUnpackedSizeMB: 200,
	SnapshotNameTemplate:     "zfs-snap-diff-%FT%H:%M",
	CompareMethod:            "auto",
	DiffContextSize:          5,
}

type WebserverConfig

type WebserverConfig struct {
	// listen
	ListenIp   string `toml:"listen-ip"`
	ListenPort int    `toml:"listen-port"`

	// tls
	UseTLS   bool   `toml:"use-tls"`
	CertFile string `toml:"cert-file"`
	KeyFile  string `toml:"key-file"`
	// webapp
	WebappDir string `toml:"webapp-dir,omitempty"`
}

func NewDefaultWebserverConfig

func NewDefaultWebserverConfig() WebserverConfig

func (*WebserverConfig) ListenAddress

func (self *WebserverConfig) ListenAddress() string

type ZFSConfig

type ZFSConfig struct {
	UseSudo        bool `toml:"use-sudo"`
	MountSnapshots bool `toml:"mount-snapshots"`
}

func NewDefaultZFSConfig

func NewDefaultZFSConfig() ZFSConfig

Jump to

Keyboard shortcuts

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