Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cnf = &Config{ Database: DatabaseConfig{ Type: "postgres", Host: "localhost", Port: 5432, User: "example_api", Password: "", DatabaseName: "example_api", MaxIdleConns: 5, MaxOpenConns: 5, }, Oauth: OauthConfig{ AccessTokenLifetime: 3600, RefreshTokenLifetime: 1209600, AuthCodeLifetime: 3600, }, Facebook: FacebookConfig{ AppID: "facebook_app_id", AppSecret: "facebook_app_secret", }, Sendgrid: SendgridConfig{ APIKey: "sendgrid_api_key", }, Web: WebConfig{ Scheme: "http", Host: "localhost:8080", AppScheme: "http", AppHost: "localhost:8000", }, AppSpecific: AppSpecificConfig{ PasswordResetLifetime: 604800, CompanyName: "Your Company", CompanyNoreplyEmail: "noreply@example.com", }, IsDevelopment: true, }
Cnf ... Let's start with some sensible defaults
Functions ¶
func RefreshConfig ¶
func RefreshConfig(newCnf *Config)
RefreshConfig sets config through the pointer so config actually gets refreshed
Types ¶
type AppSpecificConfig ¶
type AppSpecificConfig struct { PasswordResetLifetime int CompanyName string CompanyNoreplyEmail string }
AppSpecificConfig stores app specific config
type Config ¶
type Config struct { Database DatabaseConfig Oauth OauthConfig Facebook FacebookConfig Sendgrid SendgridConfig Web WebConfig AppSpecific AppSpecificConfig IsDevelopment bool }
Config stores all configuration options
func LoadConfig ¶
LoadConfig gets the JSON from ETCD and unmarshals it to the config object
type DatabaseConfig ¶
type DatabaseConfig struct { Type string Host string Port int User string Password string DatabaseName string MaxIdleConns int MaxOpenConns int }
DatabaseConfig stores database connection options
type FacebookConfig ¶
FacebookConfig stores Facebook app config
type OauthConfig ¶
OauthConfig stores oauth service configuration options
type SendgridConfig ¶
type SendgridConfig struct {
APIKey string
}
SendgridConfig stores sengrid configuration options
Click to show internal directories.
Click to hide internal directories.