~evanj/cms

b53a6d9d8f8352e9e85badd15fad406666215e58 — Evan M Jones 1 year, 5 months ago 4d1a47b
Chore(os.Getenv): Condense os.Getenv usage to one location.
1 files changed, 15 insertions(+), 13 deletions(-)

M cms.go
M cms.go => cms.go +15 -13
@@ 26,11 26,17 @@ import (
var (
	app *App

	port    = os.Getenv("PORT")
	dbtype  = os.Getenv("DBTYPE")
	dbcreds = os.Getenv("DB")
	url     = os.Getenv("URL")
	secret  = os.Getenv("SECRET")
	port           = os.Getenv("PORT")
	dbtype         = os.Getenv("DBTYPE")
	dbcreds        = os.Getenv("DB")
	url            = os.Getenv("URL")
	secret         = os.Getenv("SECRET")
	memcacheKey    = os.Getenv("MEMCACHE_KEY")
	memcacheServer = os.Getenv("MEMCACHE_SERVER")
	e3user         = os.Getenv("E3_USER")
	e3pass         = os.Getenv("E3_PASS")
	e3url          = os.Getenv("E3_URL")
	signupEnabled  = os.Getenv("SIGNUP_ENABLE") == "true"
)

type App struct {


@@ 100,18 106,14 @@ func init() {
	cacher, err := cache.New(
		log.New(w, "[cms:cache] ", 0),
		db,
		os.Getenv("MEMCACHE_KEY"),
		os.Getenv("MEMCACHE_SERVER"),
		memcacheKey,
		memcacheServer,
	)
	if err != nil {
		applogger.Fatal(err)
	}

	fs := e3.New(
		os.Getenv("E3_USER"),
		os.Getenv("E3_PASS"),
		os.Getenv("E3_URL"),
	)
	fs := e3.New(e3user, e3pass, e3url)

	app = &App{
		log: applogger,


@@ 132,7 134,7 @@ func init() {
		user: user.New(
			log.New(w, "[cms:user] ", 0),
			cacher,
			os.Getenv("SIGNUP_ENABLE") == "true",
			signupEnabled,
		),
		hook: hook.New(
			log.New(w, "[cms:hook] ", 0),