Enable global ENV variable to detect environment
This commit is contained in:
parent
ebd5680b7d
commit
5442861cb8
2 changed files with 8 additions and 0 deletions
7
db/db.go
7
db/db.go
|
@ -16,6 +16,7 @@ package db
|
|||
|
||||
import (
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"context"
|
||||
|
||||
|
@ -160,6 +161,12 @@ func Process(fib *fibre.Context, ast *sql.Query, vars map[string]interface{}) (o
|
|||
|
||||
vars[varKeyOrigin] = fib.Origin()
|
||||
|
||||
// Ensure that the specified environment
|
||||
// variable 'ENV' is available to the
|
||||
// request, to detect the environment.
|
||||
|
||||
vars[varKeyEnv] = os.Getenv(varKeyEnv)
|
||||
|
||||
// Ensure that the current authentication
|
||||
// data is made available as a runtime
|
||||
// variable to the query layer.
|
||||
|
|
|
@ -60,6 +60,7 @@ const (
|
|||
const (
|
||||
varKeyId = "id"
|
||||
varKeyIp = "ip"
|
||||
varKeyEnv = "ENV"
|
||||
varKeyAuth = "auth"
|
||||
varKeyKeep = "keep"
|
||||
varKeyThis = "this"
|
||||
|
|
Loading…
Reference in a new issue