mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-10-14 00:59:21 +00:00
rename config and adjust osc call
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com> Signed-off-by: Julian Strobl <jmastr@mailbox.org>
This commit is contained in:
parent
238e68808b
commit
b92758268d
4
config/config.dev.json
Normal file
4
config/config.dev.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"WATCHMEN_ENDPOINT": "localhost",
|
||||||
|
"WATCHMEN_PORT": 7401
|
||||||
|
}
|
@ -1,14 +1,17 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"path"
|
||||||
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/tkanos/gonfig"
|
"github.com/tkanos/gonfig"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Configuration struct {
|
type Configuration struct {
|
||||||
WATCHMEN_ENDPOINT string
|
WATCHMEN_ENDPOINT string
|
||||||
WATCHMEN_PORT uint32
|
WATCHMEN_PORT int
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetConfig(params ...string) Configuration {
|
func GetConfig(params ...string) Configuration {
|
||||||
@ -19,8 +22,15 @@ func GetConfig(params ...string) Configuration {
|
|||||||
env = params[0]
|
env = params[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
filename := fmt.Sprintf("./%s_config.json", env)
|
filename := []string{"config.", env, ".json"}
|
||||||
gonfig.GetConf(filename, &configuration)
|
_, dirname, _, _ := runtime.Caller(0)
|
||||||
|
filePath := path.Join(filepath.Dir(dirname), strings.Join(filename, ""))
|
||||||
|
|
||||||
|
err := gonfig.GetConf(filePath, &configuration)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
return configuration
|
return configuration
|
||||||
}
|
}
|
||||||
|
4
config/config.prod.json
Normal file
4
config/config.prod.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"WATCHMEN_ENDPOINT": "localhost",
|
||||||
|
"WATCHMEN_PORT": 7401
|
||||||
|
}
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"WATCHMEN_ENDPOINT": "localhost",
|
|
||||||
"WATCHMEN_PORT": 7401
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"WATCHMEN_ENDPOINT": "localhost",
|
|
||||||
"WATCHMEN_PORT": 7401
|
|
||||||
}
|
|
@ -51,9 +51,9 @@ func (k msgServer) reissueMachine(machine *types.Machine) error {
|
|||||||
msg.Append(machine.Name)
|
msg.Append(machine.Name)
|
||||||
msg.Append(machine.Ticker)
|
msg.Append(machine.Ticker)
|
||||||
msg.Append(machine.Domain)
|
msg.Append(machine.Domain)
|
||||||
msg.Append(machine.Amount)
|
msg.Append(int32(machine.Amount))
|
||||||
msg.Append("1")
|
msg.Append("1")
|
||||||
msg.Append(machine.Precision)
|
msg.Append(int32(machine.Precision))
|
||||||
err := client.Send(msg)
|
err := client.Send(msg)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user