-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodegpenv.go
More file actions
45 lines (36 loc) · 1.01 KB
/
codegpenv.go
File metadata and controls
45 lines (36 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package env
import "os"
var (
isLocal bool
gcloudProjectID string
)
// Lang is a type to represent a language supported by codegp
// the value must be the file extenstion for the language
type Lang string
const (
// LocalStorePath simulates cloud storage by saving files to a local volume when running locally
LocalStorePath string = "/localstore"
// SourcePath is where the source downloader dowloads the projects source files
SourcePath string = "/source"
/*
supported languages
*/
// Go is a Lang constant for the go language
Go Lang = "go"
// Python is a Lang constant for the python language
Python Lang = "py"
// Java is a Lang constant for the java language
Java Lang = "java"
)
func init() {
isLocal = os.Getenv("IS_LOCAL") == "true"
gcloudProjectID = os.Getenv("GCLOUD_PROJECT_ID")
}
// IsLocal returns true if running locally
func IsLocal() bool {
return isLocal
}
// GCloudProjectID returns the google cloud project identifer
func GCloudProjectID() string {
return gcloudProjectID
}