config

package
v0.0.0-...-dc693dd Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintUsage

func PrintUsage()

PrintUsage displays the help for the env vars

func Read

func Read() error

Read from env variables

Types

type AppConfig

type AppConfig struct {
	// ImapHost is the host address for the IMAP server
	ImapHost HostDecoder `required:"true" split_words:"true"`
	// ImapTlsEnabled is true in case the connection accepts TLS connections or false if it doesn't.
	ImapTlsEnabled bool `default:"true" split_words:"true"`
	// ImapUsername represents the username for the IMAP server
	ImapUsername string `required:"true" split_words:"true"`
	// ImapPassword represents the password set for the user
	ImapPassword string `required:"true" split_words:"true"`
	// NotificationUris contains a list of services that should be notified for mails
	NotificationUris []string `required:"true" split_words:"true"`
}

AppConfig contains the app wide configuration

func Get

func Get() *AppConfig

Get current app configuration, make sure Read has been called before.

type HostDecoder

type HostDecoder HostInfo

HostDecoder converts the given string value into host and port pair

func (*HostDecoder) Decode

func (hd *HostDecoder) Decode(value string) error

Decode string into hostname and port

type HostInfo

type HostInfo struct {
	// Hostname represents the FQDN or IP of the host
	Hostname string
	// Port represents the port to connect to
	Port int
}

HostInfo represents the parsed hostname and port of a host address

Jump to

Keyboard shortcuts

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