Documentation ¶
Index ¶
Constants ¶
View Source
const ( //SecretFilename file to get keys and configurations SecretFilename = "secrets" //DatabasePath to read database configurations DatabasePath = "database" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppSettings ¶
type AppSettings struct { Generic GenericSettings Database DatabaseSettings }
AppSettings contains application related settings
type DatabaseSettings ¶
type DatabaseSettings struct { Host string `mapstructure:"host" default:"localhost"` Port string `mapstructure:"port" default:"5432"` User string `mapstructure:"user" validate:"required"` Name string `mapstructure:"name" validate:"required"` Password string `mapstructure:"password" validate:"required"` SslMode string `mapstructure:"sslmode" default:"disable"` ConnectionPool string `mapstructure:"connpool" default:"20"` Status bool `default:"false"` }
DatabaseSettings exposes credentials for connecting database
func (*DatabaseSettings) ConnectionString ¶
func (s *DatabaseSettings) ConnectionString() string
ConnectionString returns the concatenated string to connect to db
type GenericSettings ¶
type GenericSettings struct { Debug bool `mapstructure:"debug"` Env string `mapstructure:"env" default:"development"` Expiry int64 `mapstructure:"expiry" default:"10080"` // minutes for 7 days Port int64 `mapstructure:"port" default:"9000"` }
GenericSettings exposes project's generic settings
Click to show internal directories.
Click to hide internal directories.