config

package
v0.0.9-beta Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = "watch-go"
)

Variables

View Source
var (
	File string

	Debug         bool
	General       = &cfg.General
	FileSystemCfg = &cfg.FileSystem
)

Functions

func GetStaticBackupFolder

func GetStaticBackupFolder() string

func LoadConfig

func LoadConfig(configFile string) error

LoadConfig Read and parse config file.

func ReloadConfig

func ReloadConfig() error

ReloadConfig parse yml config.

func Watch

func Watch(ctx context.Context, pathFile string) (<-chan string, error)

Watch starts watching the given file for changes, and returns a channel to get notified on. Errors are also passed through this channel: Receiving a nil from the channel indicates the file is updated.

Types

type CompressConfig

type CompressConfig struct {
	Enabled bool `yaml:"enabled"`
	Quality int  `yaml:"quality"`
}

type FileSystemConfig

type FileSystemConfig struct {
	Paths       []string       `yaml:"paths"`
	Compress    CompressConfig `yaml:"compress"`
	MaxFileSize int64          `yaml:"max_file_size"`
	Backup      struct {
		HardDrivePath string   `yaml:"hard_drive_path"`
		Prefix        []string `yaml:"prefix"`
	} `yaml:"backup"`
}

Jump to

Keyboard shortcuts

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