Moved github PAT and storage path to env vars
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
package envconfig
|
||||
|
||||
import "os"
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
type EnvConfig struct {
|
||||
Port string
|
||||
ConfigDir string
|
||||
Port string
|
||||
ConfigDir string
|
||||
GithubPat string
|
||||
StoragePath string
|
||||
}
|
||||
|
||||
func Load() EnvConfig {
|
||||
@@ -18,8 +22,20 @@ func Load() EnvConfig {
|
||||
configDir = "./"
|
||||
}
|
||||
|
||||
githubPat := os.Getenv("GITHUB_PAT")
|
||||
if githubPat == "" {
|
||||
githubPat = ""
|
||||
}
|
||||
|
||||
storagePath := os.Getenv("STORAGE_PATH")
|
||||
if storagePath == "" {
|
||||
storagePath = "./storage"
|
||||
}
|
||||
|
||||
return EnvConfig{
|
||||
Port: port,
|
||||
ConfigDir: configDir,
|
||||
Port: port,
|
||||
ConfigDir: configDir,
|
||||
GithubPat: githubPat,
|
||||
StoragePath: storagePath,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user