Documentation ¶
Overview ¶
Package for web app configuration
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DBConfig ¶
func DBConfig() string
DBConfig gets the configuration string to connect to the database
func GetCnReaderHome ¶
func GetCnReaderHome() string
GetCnReaderHome gets the home directory of the Chinese Notes project
func GetCnWebHome ¶
func GetCnWebHome() string
GetCnWebHome gets the home directory of the web application
func GetEnvIntValue ¶
GetEnvIntValue gets a value from the environment
func PasswordProtected ¶ added in v0.0.17
func PasswordProtected() bool
PasswordProtected gets whether the web site is password projected.
func UseDatabase ¶ added in v0.0.17
func UseDatabase() bool
PasswordProtected gets whether the web site is password projected.
Types ¶
type WebAppConfig ¶ added in v0.0.25
type WebAppConfig struct { // A map of project configuration variables ConfigVars map[string]string }
WebAppConfig holds application configuration data that is specific to the web app
func InitWeb ¶ added in v0.0.24
func InitWeb() WebAppConfig
InitWeb loads the WebAppConfig data. If an error occurs, default values are used
func (WebAppConfig) GetAll ¶ added in v0.0.25
func (c WebAppConfig) GetAll() map[string]string
GetAll gets all configuration variables
func (WebAppConfig) GetFromEmail ¶ added in v0.0.25
func (c WebAppConfig) GetFromEmail() string
GetFromEmail gets the environment or config variable for sending email from
func (WebAppConfig) GetPasswordResetURL ¶ added in v0.0.25
func (c WebAppConfig) GetPasswordResetURL() string
GetPasswordResetURL get the password reset URL for inclusion in email
func (WebAppConfig) GetVar ¶ added in v0.0.25
func (c WebAppConfig) GetVar(key string) string
GetVar gets a configuration variable value, default empty string
func (WebAppConfig) GetVarWithDefault ¶ added in v0.0.25
func (c WebAppConfig) GetVarWithDefault(key, defaultVal string) string
GetVarWithDefault gets a configuration value with given default