aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/_nuts/github.com/go-martini/martini/env.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/_nuts/github.com/go-martini/martini/env.go')
-rw-r--r--vendor/_nuts/github.com/go-martini/martini/env.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/vendor/_nuts/github.com/go-martini/martini/env.go b/vendor/_nuts/github.com/go-martini/martini/env.go
new file mode 100644
index 0000000..54d5857
--- /dev/null
+++ b/vendor/_nuts/github.com/go-martini/martini/env.go
@@ -0,0 +1,31 @@
+package martini
+
+import (
+ "os"
+)
+
+// Envs
+const (
+ Dev string = "development"
+ Prod string = "production"
+ Test string = "test"
+)
+
+// Env is the environment that Martini is executing in. The MARTINI_ENV is read on initialization to set this variable.
+var Env = Dev
+var Root string
+
+func setENV(e string) {
+ if len(e) > 0 {
+ Env = e
+ }
+}
+
+func init() {
+ setENV(os.Getenv("MARTINI_ENV"))
+ var err error
+ Root, err = os.Getwd()
+ if err != nil {
+ panic(err)
+ }
+}