config

package
v0.1.3-0...-17f0bc2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: Unlicense Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigPath = ".config/srv/config.yml"

ConfigPath defines where the configuration is stored

Variables

View Source
var DefaultConfiguration = Configuration{
	Feeds: []string{
		"https://aws.amazon.com/blogs/security/feed/",
		"https://www.phoronix.com/rss.php",
		"https://www.zdnet.com/topic/security/rss.xml",
	},
}

DefaultConfiguration can be used if a config is missing

Functions

func DetermineExternalViewer

func DetermineExternalViewer() (string, error)

DetermineExternalViewer checks the OS to decide the default viewer

func EnsureConfigDirExists

func EnsureConfigDirExists(d string) error

EnsureConfigDirExists ensures directory exists with correct permissions

func GetUserConfigPath

func GetUserConfigPath() (string, error)

GetUGetUGetUserConfigPath returns the full configuration path for the current user

func WriteConfig

func WriteConfig(config Configuration, f string) error

WriteConfig writes a config to disk

Types

type Configuration

type Configuration struct {
	Feeds              []string `yaml:"feeds"`
	ExternalViewer     string   `yaml:"externalViewer,omitempty"`
	ExternalViewerArgs []string `yaml:"externalViewerArgs,omitempty"`
}

Configuration stores the global config

func LoadConfiguration

func LoadConfiguration(f string) (Configuration, error)

LoadConfiguration loads a configuration from a file

Jump to

Keyboard shortcuts

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