mirror of
https://github.com/cuigh/swirl
synced 2024-12-30 15:53:24 +00:00
33 lines
736 B
Go
33 lines
736 B
Go
package misc
|
|
|
|
import (
|
|
"github.com/cuigh/auxo/config"
|
|
)
|
|
|
|
const (
|
|
keyDockerEndpoint = "swirl.docker_endpoint"
|
|
keyDBType = "swirl.db_type"
|
|
keyDBAddress = "swirl.db_address"
|
|
envDockerEndpoint = "DOCKER_ENDPOINT"
|
|
envDBType = "DB_TYPE"
|
|
envDBAddress = "DB_ADDRESS"
|
|
)
|
|
|
|
var Options = &struct {
|
|
DockerEndpoint string
|
|
DBType string
|
|
DBAddress string
|
|
}{}
|
|
|
|
func BindOptions() {
|
|
config.BindEnv(keyDockerEndpoint, envDockerEndpoint)
|
|
config.BindEnv(keyDBType, envDBType)
|
|
config.BindEnv(keyDBAddress, envDBAddress)
|
|
}
|
|
|
|
func LoadOptions() {
|
|
Options.DockerEndpoint = config.GetString(keyDockerEndpoint)
|
|
Options.DBType = config.GetString(keyDBType)
|
|
Options.DBAddress = config.GetString(keyDBAddress)
|
|
}
|