Documentation
¶
Index ¶
Constants ¶
const ( // DebugMode indicates mode is debug. DebugMode = "debug" // ReleaseMode indicates mode is release. ReleaseMode = "release" // TestMode indicates mode is test. TestMode = "test" )
const EnvMode = EnvPrefix + "MODE"
EnvMode indicates environment name for mode
const EnvPrefix = "AUTH_"
EnvPrefix is prefix of environment variables to be used in the application.
Variables ¶
This section is empty.
Functions ¶
func SetSMTPPort ¶
func SetSMTPPort(port int)
SetSMTPPort configures the port of the smtp server used global in application.
Types ¶
type AppConfig ¶
type AppConfig struct { ListenPort int SignupTokenExpire int SessionTokenExpire int ResetPasswordTokenExpire int JWTSigninKey string Org string SupportEmail string PageSize string PageSizeLimit int // contains filtered or unexported fields }
AppConfig contains the values needed to operate application.
func App ¶
func App() *AppConfig
App returns the Values needed to operate application. Value not set in environment variable is set to fixed value.
func (*AppConfig) GracefulShutdownDuration ¶
GracefulShutdownDuration is returns duration value to be used when GracefulShutdown.
func (*AppConfig) ResetPasswordURL ¶
ResetPasswordURL is returns reset password url to be used by frontend.
func (*AppConfig) SecretKeyLen ¶
SecretKeyLen is returns key length value required when creating a secretKey.
type DatabaseConfig ¶
DatabaseConfig contains values for database access.
func DB ¶
func DB() (*DatabaseConfig, error)
DB returns the values needed to access the database. If required value constraint is not met, an error is returned.
func (*DatabaseConfig) DBName ¶
func (c *DatabaseConfig) DBName() string
DBName is returns database name to be used in the current application.
func (*DatabaseConfig) DSN ¶
func (c *DatabaseConfig) DSN() string
DSN is returns database source name.
type SMTPConfig ¶
type SMTPConfig struct {
// contains filtered or unexported fields
}
SMTPConfig contains values for smtp server.
func (*SMTPConfig) DialAndQuit ¶
func (c *SMTPConfig) DialAndQuit() error
DialAndQuit is checks smtp server is running. If not running, an error is returned.