Documentation ¶
Index ¶
- Variables
- func BindPFlag(key string, flag *pflag.Flag)
- func Default(key string) any
- func Description(key string) string
- func DownloadOptions() libmangal.DownloadOptions
- func Exists(key string) bool
- func Get(key string) any
- func Init()
- func Keys() []string
- func Load(path string) error
- func ModeStrings() []string
- func ReadOptions() libmangal.ReadOptions
- func Set(key string, value any) error
- func SetDefault(key string, value any) error
- func Validate(key string, value any) error
- func Write() error
- type Mode
- func (i Mode) IsAMode() bool
- func (i Mode) MarshalJSON() ([]byte, error)
- func (i Mode) MarshalText() ([]byte, error)
- func (i Mode) MarshalYAML() (interface{}, error)
- func (i Mode) String() string
- func (i *Mode) UnmarshalJSON(data []byte) error
- func (i *Mode) UnmarshalText(text []byte) error
- func (i *Mode) UnmarshalYAML(unmarshal func(interface{}) error) error
Constants ¶
This section is empty.
Variables ¶
var ( // Path to the config file Path = filepath.Join(dir, filename) Icons = cfg.Icons Cache = cfg.Cache CLI = cfg.CLI Read = cfg.Read Download = cfg.Download TUI = cfg.TUI Providers = cfg.Providers Library = cfg.Library Notification = cfg.Notification )
Exported config
Functions ¶
func DownloadOptions ¶
func DownloadOptions() libmangal.DownloadOptions
DownloadOptions constructs the libmangal.DownloadOptions populated by the Config.
func Load ¶
Load the config file and validates all config keys.
If path is empty, it will try to load from xdg.ConfigHome then from xdg.Home.
func ModeStrings ¶
func ModeStrings() []string
ModeStrings returns a slice of all String values of the enum
func ReadOptions ¶
func ReadOptions() libmangal.ReadOptions
Types ¶
type Mode ¶
type Mode uint8
func ModeString ¶
ModeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (Mode) IsAMode ¶
IsAMode returns "true" if the value is listed in the enum definition. "false" otherwise
func (Mode) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for Mode
func (Mode) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for Mode
func (Mode) MarshalYAML ¶
MarshalYAML implements a YAML Marshaler for Mode
func (*Mode) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for Mode
func (*Mode) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for Mode
func (*Mode) UnmarshalYAML ¶
UnmarshalYAML implements a YAML Unmarshaler for Mode