config

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONFIGS_DIR_NAME       = ".config"
	PORTAL_CONFIG_DIR_NAME = "portal"
	CONFIG_FILE_NAME       = "config"
	CONFIG_FILE_EXT        = "yml"

	StyleRich = "rich"
	StyleRaw  = "raw"
)

Variables

This section is empty.

Functions

func Init

func Init() error

Init initializes the viper config. `config.yml` is created in $HOME/.config/portal if not already existing. NOTE: The precedence levels of viper are the following: flags -> config file -> defaults.

func IsDefault

func IsDefault(key string) bool

Types

type Config

type Config struct {
	Relay                string `mapstructure:"relay"`
	Verbose              bool   `mapstructure:"verbose"`
	PromptOverwriteFiles bool   `mapstructure:"prompt_overwrite_files"`
	RelayServePort       int    `mapstructure:"relay_serve_port"`
	TuiStyle             string `mapstructure:"tui_style"`
}

func GetDefault

func GetDefault() Config

func (Config) Map

func (config Config) Map() map[string]any

func (Config) Yaml

func (config Config) Yaml() []byte

Jump to

Keyboard shortcuts

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