Example #1
0
File: config.go Project: jawr/wall
func Get() *jconfig.Config {
	if config == nil {
		if !flag.Parsed() {
			flag.Parse()
		}
		config = jconfig.LoadConfig(configPath)
	}
	return config
}
Example #2
0
func init() {
	config := jconfig.LoadConfig("careless.conf")
	ConsumerKey = config.GetString("ConsumerKey")
	ConsumerSecret = config.GetString("ConsumerSecret")
	AccessToken = config.GetString("AccessToken")
	AccessTokenSecret = config.GetString("AccessTokenSecret")
	DatabaseFile = config.GetString("DatabaseFile")
	DatabaseBucket = config.GetString("DatabaseBucket")
}
Example #3
0
func init() {
	accessKey = os.Getenv("AWS_SES_ACCESS_KEY")
	secretKey = os.Getenv("AWS_SES_SECRET_KEY")

	if accessKey == "" || secretKey == "" {
		config := jconfig.LoadConfig("/etc/aws.conf")
		if accessKey == "" {
			accessKey = config.GetString("aws_access_key")
		}
		if secretKey == "" {
			secretKey = config.GetString("aws_secret_key")
		}
	}
}