Documentation ¶
Overview ¶
Package config contains app config.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadFromEnv ¶
LoadFromEnv load config from env.
func ToPrettyString ¶
ToPrettyString convert any config to pretty string.
Types ¶
type Config ¶
type Config struct { ServerAddress string `env:"SERVER_ADDRESS,default=localhost:8080" flag:"server-address a" desc:"(env SERVER_ADDRESS) server address"` BaseURL string `env:"BASE_URL,default=http://localhost:8080" flag:"base-url b" desc:"(env BASE_URL) base url"` StorageFilePath string `env:"FILE_STORAGE_PATH" flag:"storage-file-path f" desc:"(env FILE_STORAGE_PATH) storage file path"` UserCookieName string `env:"USER_COOKIE_NAME,default=kkk" flag:"user-cookie-name" desc:"(env USER_COOKIE_NAME) user cookie name"` SecretKey string `env:"SECRET_KEY" flag:"secret-key" desc:"(env SECRET_KEY) server secret key"` DatabaseDsn string `env:"DATABASE_DSN" flag:"database-dsn d" desc:"(env DATABASE_DSN) database dsn"` // contains filtered or unexported fields }
Config is main app config struct.
func (*Config) GetSecretKey ¶
GetSecretKey get secret key.
func (*Config) SetStorage ¶
SetStorage set storage.
Click to show internal directories.
Click to hide internal directories.