Пример #1
0
func (a *app) LoadConfig() gappconfig.Config {
	config = gappconfig.New("MYAPP_", gappconfig.Map{
		{"ENV", "dev"},
		{"PRETTY", true},
		{"HOST", "localhost"},
		{"PORT", 4001},
	})
	return config
}
Пример #2
0
package gapp

import (
	"net/http"
	"testing"
	"time"

	"github.com/Hearst-DD/gappconfig"
	"github.com/codegangsta/negroni"
	"github.com/gorilla/mux"
	"github.com/stretchr/testify/assert"
)

var conf = gappconfig.New("FOO_", gappconfig.Map{
	{"BAR", "baz"},
})

var handlers = []negroni.Handler{
	RecoveryMiddleware(func(rw http.ResponseWriter, r *http.Request) {}),
}

// used for asserting order of API methods called
var state = "start"

type testapp struct {
	t *testing.T
}

func (a *testapp) LoadConfig() gappconfig.Config {
	assert.Equal(a.t, "start", state)
	state = "LoadConfigCalled"