refactoring
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
package config
|
||||
|
||||
type CentralConfig struct {
|
||||
URL string `json:"url" yaml:"url" toml:"url"`
|
||||
EntryPoints map[string]string `json:"entryPoints" yaml:"entryPoints" toml:"entryPoints"`
|
||||
}
|
||||
@@ -4,9 +4,20 @@ const (
|
||||
ConfigFileName = "config.json"
|
||||
)
|
||||
|
||||
var Config AllConfig
|
||||
var ConfigDir *string
|
||||
var ConfigFilePath *string
|
||||
var CFG *Config
|
||||
|
||||
type AllConfig struct {
|
||||
Domain DomainConfig `json:"domain" yaml:"domain" toml:"domain"`
|
||||
type Config struct {
|
||||
Central CentralConfig `json:"central" yaml:"central" toml:"central"`
|
||||
Probe ProbeConfig `json:"probe" yaml:"probe" toml:"probe"`
|
||||
}
|
||||
|
||||
type CentralConfig struct {
|
||||
URL *string `json:"url" yaml:"url" toml:"url"`
|
||||
APIKey *string `json:"apiKey" yaml:"apiKey" toml:"apiKey"`
|
||||
}
|
||||
|
||||
type ProbeConfig struct {
|
||||
Key *string `json:"key,omitempty" yaml:"key" toml:"key"`
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
package config
|
||||
|
||||
type DomainConfig struct {
|
||||
APIKey string `json:"apiKey" yaml:"apiKey" toml:"apiKey"`
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package config
|
||||
|
||||
const (
|
||||
ProbeConfigFileName = "probe.json"
|
||||
)
|
||||
|
||||
type ProbeConfig struct {
|
||||
ID *string `json:"id,omitempty" yaml:"id" toml:"id"`
|
||||
}
|
||||
Reference in New Issue
Block a user