config

package
v0.0.0-...-07862d9 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	SecretKey string `env:"AUTH_SECRET,required"`
}

type Config

type Config struct {
	Smtp   Smtp
	Server Server
	Auth   Auth
	DB     DB
}

func FromEnv

func FromEnv() (*Config, error)

type DB

type DB struct {
	DSN string `env:"DATABASE_URL,required"`
}

type Server

type Server struct {
	Port         int  `env:"PORT" envDefault:"8080"`
	RedirectMode bool `env:"REDIRECT_MODE" envDefault:"false"`
}

func (*Server) Address

func (s *Server) Address() string

type Smtp

type Smtp struct {
	From               string `env:"SMTP_FROM,required"`
	Password           string `env:"SMTP_PASSWORD,required"`
	Host               string `env:"SMTP_HOST,required"`
	Port               int    `env:"SMTP_PORT" envDefault:"587"`
	WebAddressRedirect string `env:"SMTP_WEB_REDIRECT_URL" envDefault:"http://localhost:3000"`
}

func (*Smtp) Address

func (s *Smtp) Address() string

Jump to

Keyboard shortcuts

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