config

package
v0.0.0-...-dd85d06 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 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 {
	Server        Server        `env:""`
	EmailerConfig EmailerConfig `env:""`
	SlackerConfig SlackerConfig `env:""`
	SMSConfig     SMSConfig     `env:""`
	DB            DB            `env:""`
	Processor     Processor     `env:""`
}

func NewConfig

func NewConfig() (*Config, error)

type DB

type DB struct {
	Host     string `env:"DB_HOST"`
	Port     string `env:"DB_PORT"`
	User     string `env:"DB_USER"`
	Password string `env:"DB_PASSWORD"`
	DBName   string `env:"DB_NAME"`
	SSLMode  string `env:"DB_SSL_MODE"`
}

type EmailerConfig

type EmailerConfig struct {
	Host     string `env:"SMTP_HOST"`
	Port     int    `env:"SMTP_PORT"`
	Username string `env:"SMTP_USERNAME"`
	Password string `env:"SMTP_PASSWORD"`
	Sender   string `env:"EMAIL_SENDER"`
}

type Processor

type Processor struct {
	FetchInterval time.Duration `env:"PROCESSOR_FETCH_INTERVAL"`
	BatchSize     int           `env:"PROCESSOR_BATCH_SIZE"`
}

type SMSConfig

type SMSConfig struct {
	SID    string `env:"SMS_SID"`
	Secret string `env:"SMS_SECRET"`
	Sender string `env:"SMS_SENDER"`
}

type Server

type Server struct {
	Host            string `env:"SERVER_HOST"`
	Port            int    `env:"SERVER_PORT"`
	ShutdownTimeout int    `env:"SERVER_SHUTDOWN_TIMEOUT"`
}

type SlackerConfig

type SlackerConfig struct {
	Webhook string `env:"SLACK_WEBHOOK"`
}

Jump to

Keyboard shortcuts

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