refactoring

This commit is contained in:
crusader
2017-09-28 19:09:33 +09:00
parent 6e88452b1b
commit 0ece619ffb
13 changed files with 120 additions and 120 deletions

View File

@@ -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"`
}

View File

@@ -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"`
}

View File

@@ -1,5 +0,0 @@
package config
type DomainConfig struct {
APIKey string `json:"apiKey" yaml:"apiKey" toml:"apiKey"`
}

View File

@@ -1,9 +0,0 @@
package config
const (
ProbeConfigFileName = "probe.json"
)
type ProbeConfig struct {
ID *string `json:"id,omitempty" yaml:"id" toml:"id"`
}