feat(pidproxy): read startsecs from env
chore: centralize env prefix
This commit is contained in:
@@ -14,7 +14,6 @@ const (
|
||||
// DummyPath = "/workspaces/wingmate/cmd/experiment/dummy/dummy"
|
||||
DummyPath = "/usr/local/bin/wmdummy"
|
||||
EnvDummyPath = "DUMMY_PATH"
|
||||
EnvPrefix = "WINGMATE"
|
||||
EnvLog = "LOG"
|
||||
EnvLogMessage = "LOG_MESSAGE"
|
||||
EnvDefaultLogMessage = "oneshot executed"
|
||||
@@ -23,7 +22,7 @@ const (
|
||||
)
|
||||
|
||||
func main() {
|
||||
viper.SetEnvPrefix(EnvPrefix)
|
||||
viper.SetEnvPrefix(wingmate.EnvPrefix)
|
||||
viper.BindEnv(EnvDummyPath)
|
||||
viper.BindEnv(EnvLog)
|
||||
viper.BindEnv(EnvLogMessage)
|
||||
|
||||
@@ -5,11 +5,11 @@ import (
|
||||
"os/exec"
|
||||
"time"
|
||||
|
||||
"gitea.suyono.dev/suyono/wingmate"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
const (
|
||||
EnvPrefix = "WINGMATE"
|
||||
EnvOneShotPath = "ONESHOT_PATH"
|
||||
OneShotPath = "/usr/local/bin/wmoneshot"
|
||||
)
|
||||
@@ -20,7 +20,7 @@ func main() {
|
||||
err error
|
||||
t *time.Ticker
|
||||
)
|
||||
viper.SetEnvPrefix(EnvPrefix)
|
||||
viper.SetEnvPrefix(wingmate.EnvPrefix)
|
||||
viper.BindEnv(EnvOneShotPath)
|
||||
viper.SetDefault(EnvOneShotPath, OneShotPath)
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"os/exec"
|
||||
"sync"
|
||||
|
||||
"gitea.suyono.dev/suyono/wingmate"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
@@ -14,7 +15,6 @@ const (
|
||||
// DummyPath = "/workspaces/wingmate/cmd/experiment/dummy/dummy"
|
||||
DummyPath = "/usr/local/bin/wmdummy"
|
||||
EnvDummyPath = "DUMMY_PATH"
|
||||
EnvPrefix = "WINGMATE"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -25,7 +25,7 @@ func main() {
|
||||
err error
|
||||
exePath string
|
||||
)
|
||||
viper.SetEnvPrefix(EnvPrefix)
|
||||
viper.SetEnvPrefix(wingmate.EnvPrefix)
|
||||
viper.BindEnv(EnvDummyPath)
|
||||
viper.SetDefault(EnvDummyPath, DummyPath)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user