config

package
v0.0.0-...-5f4d607 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDefaultConfig

func CopyDefaultConfig()

func CreateDefaults

func CreateDefaults() error

func Dir

func Dir() string

Types

type Config

type Config struct {
	Currency  string              `yaml:"currency"`
	Watchlist []string            `yaml:"watchlist"`
	SMTP      EmailNotifierConfig `yaml:"smtp"`
}

func Conf

func Conf() *Config

Conf returns the Config singleton instance.

func Load

func Load(filepath string) (*Config, error)

Load parses, returns, and sets the singleton Config.

func Parse

func Parse(file string) (*Config, error)

Parse parses the yaml configuration file, returning a Config, or error.

type EmailNotifierConfig

type EmailNotifierConfig struct {
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

func (EmailNotifierConfig) Auth

func (edc EmailNotifierConfig) Auth() smtp.Auth

type Recipient

type Recipient struct {
	Default string `yaml:"default"`
	Name    string `yaml:"name"`
	Email   string `yaml:"email"`
	SMS     string `yaml:"sms"`
}

Jump to

Keyboard shortcuts

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