config

package
v0.0.0-...-3ddbc71 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package config is responsible for application configuration init.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	RootDevice     string          `json:"root_device"`
	Path           string          `json:"path"` // needs to save config file from app.
	DBPath         string          `json:"db_path"`
	ToRemove       []string        `json:"to_remove"`
	BtrfsSupported bool            `json:"btrfs_supported"`
	Schedule       domain.Schedule `json:"schedule"`
	Volumes        []domain.Volume `json:"volumes"`
	FileMode       os.FileMode     `json:"file_mode"`
	KernelVersion  string
}

Config represents configuration of application. It keeps all needed settings. Config is saved on a disk.

func New

func New() (*Config, error)

New returns config that is stored in default config path.

func (*Config) Save

func (cfg *Config) Save() error

Save flushes current config to file.

func (*Config) VolumeInRootFs

func (cfg *Config) VolumeInRootFs(vol domain.Volume) bool

VolumeInRootFs checks if the volume is in root.

Jump to

Keyboard shortcuts

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