config

package
v0.0.0-...-788dbb9 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SMTPConfig      `mapstructure:",squash"`
	EmailsConfig    `mapstructure:",squash"`
	RecaptchaConfig `mapstructure:",squash"`
}

Config contains config for this project.

func GetConfigFromEnvVars

func GetConfigFromEnvVars() (*Config, error)

GetConfigFromEnvVars get config from environment variables.

func GetConfigFromFile

func GetConfigFromFile() (*Config, error)

GetConfigFromFile will get config from YAML file.

type EmailsConfig

type EmailsConfig struct {
	From string   `required:"true" envconfig:"EMAIL_FROM" mapstructure:"emailFrom"`
	To   []string `required:"true" envconfig:"EMAIL_TO" mapstructure:"emailTo"`
}

EmailsConfig contains config for emails to use.

type RecaptchaConfig

type RecaptchaConfig struct {
	Secret string `envconfig:"RECAPTCHA_SECRET" mapstructure:"recaptchaSecret"`
}

RecaptchaConfig contains config for reCAPTCHA.

type SMTPConfig

type SMTPConfig struct {
	Host     string `required:"true" envconfig:"SMTP_HOST" mapstructure:"smtpHost"`
	Port     int    `required:"true" envconfig:"SMTP_PORT" mapstructure:"smtpPort"`
	Password string `required:"true" envconfig:"SMTP_PASSWORD" mapstructure:"smtpPassword"`
}

SMTPConfig contains config for SMTP communication.

Jump to

Keyboard shortcuts

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