Exemple #1
0
// LoadEnvironmentFile loads the correct envfile based on the convention
// envfile name ==> .<env>
func LoadEnvironmentFile(env string) {
	envfile := config.DOT + string(os.PathSeparator) + config.DOT + s.ToLower(env)
	error := gotenv.Load(envfile)
	if error != nil {
		logger.Info("ERROR loading environment file: " + error.Error())
	}
}
Exemple #2
0
func init() {
	gotenv.Load(".env")

	access = os.Getenv("AWS_ACCESS")
	secret = os.Getenv("AWS_SECRET")
	bucket = os.Getenv("AWS_BUCKET")
	region = os.Getenv("AWS_REGION")
}
func init() {
	gotenv.Load(".env")
	host = os.Getenv("ES_HOST")
	index = os.Getenv("ES_INDEX")
	namespace = os.Getenv("ES_NAMESPACE")
	scheme = os.Getenv("ES_SCHEME")
	awsKey = os.Getenv("AWS_KEY")
	awsSecret = os.Getenv("AWS_SECRET")
}
Exemple #4
0
func init() {
	// attempt to load env vars in memcache pacakge.
	gotenv.Load(".env")

	v := os.Getenv("MEMCACHED_HOSTS")

	if v != "" {
		hosts = strings.Split(v, ",")
		return
	}
}
Exemple #5
0
func checkEnv(t *testing.T) {
	if envLoaded == false {
		gotenv.Load(".env")

		access = os.Getenv("AWS_ACCESS")
		secret = os.Getenv("AWS_SECRET")
		region = os.Getenv("AWS_REGION")
		dbtable = os.Getenv("DYNAMO_DB_TABLE")
		envLoaded = true
	}

	if access == "" || secret == "" || region == "" || dbtable == "" {
		t.Skip("env vars not defined")
	}
}
Exemple #6
0
func init() {
	gotenv.Load()
	r = rand.New(rand.NewSource(time.Now().UnixNano()))

	if os.Getenv("PUSHERAPPID") == "" {
		panic(".env file or Pusher AppID missing! Ensure .env file from the #gosimulateyourself channel has been placed in this directory")
	}

	pushClient = pusher.Client{
		AppId:  os.Getenv("PUSHERAPPID"),
		Key:    os.Getenv("PUSHERKEY"),
		Secret: os.Getenv("PUSHERSECRET"),
	}

	fmt.Println("Loaded Pusher credentials from .env: AppId, Key, Secret: ", pushClient)
}
Exemple #7
0
// Read the evironment file, populating the environment variables to use.
func loadConfig(envFile string) {
	gotenv.Load()
}
Exemple #8
0
func init() {
	gotenv.Load(".env")

	host, port = os.Getenv("REDIS_HOST"), os.Getenv("REDIS_PORT")
}
Exemple #9
0
func init() {
	gotenv.Load()
}
Exemple #10
0
func init() {
	gotenv.Load()
	setEnvVars()
}