This commit is contained in:
crusader 2017-12-01 18:44:28 +09:00
parent ae7d8a8d8c
commit 2ffbb7f711
7 changed files with 30 additions and 19 deletions

7
config/config.go Normal file
View File

@ -0,0 +1,7 @@
package config
import "flag"
func FlagConfigDir() *string {
return flag.String("config-dir", ".", "The directory path of config")
}

View File

@ -1,11 +1,7 @@
package config package noauthprobe
import "git.loafle.net/overflow/overflow_commons_go/util" import "git.loafle.net/overflow/overflow_commons_go/util"
const (
NoAuthProbeConfigFileName = "noauthprobe.json"
)
type NoAuthProbeConfig struct { type NoAuthProbeConfig struct {
TempKey *string `json:"tempKey,omitempty" yaml:"tempKey" toml:"tempKey"` TempKey *string `json:"tempKey,omitempty" yaml:"tempKey" toml:"tempKey"`
DenyDate *util.Timestamp `json:"denyDate,omitempty" yaml:"denyDate" toml:"denyDate"` DenyDate *util.Timestamp `json:"denyDate,omitempty" yaml:"denyDate" toml:"denyDate"`

View File

@ -0,0 +1,5 @@
package noauthprobe
const (
ConfigFileName = "noauthprobe.json"
)

View File

@ -1,13 +1,4 @@
package config package probe
const (
ConfigFileName = "config.json"
)
type Config struct {
Central CentralConfig `json:"central" yaml:"central" toml:"central"`
Probe ProbeConfig `json:"probe" yaml:"probe" toml:"probe"`
}
type CentralConfig struct { type CentralConfig struct {
URL string `required:"true" json:"url" yaml:"url" toml:"url"` URL string `required:"true" json:"url" yaml:"url" toml:"url"`
@ -15,7 +6,3 @@ type CentralConfig struct {
ReadBufferSize int `default:"8192" json:"readBufferSize" yaml:"readBufferSize" toml:"readBufferSize"` ReadBufferSize int `default:"8192" json:"readBufferSize" yaml:"readBufferSize" toml:"readBufferSize"`
WriteBufferSize int `default:"8192" json:"writeBufferSize" yaml:"writeBufferSize" toml:"writeBufferSize"` WriteBufferSize int `default:"8192" json:"writeBufferSize" yaml:"writeBufferSize" toml:"writeBufferSize"`
} }
type ProbeConfig struct {
Key *string `json:"key,omitempty" yaml:"key" toml:"key"`
}

6
config/probe/Config.go Normal file
View File

@ -0,0 +1,6 @@
package probe
type Config struct {
Central CentralConfig `json:"central" yaml:"central" toml:"central"`
Probe ProbeConfig `json:"probe" yaml:"probe" toml:"probe"`
}

View File

@ -0,0 +1,5 @@
package probe
type ProbeConfig struct {
Key *string `json:"key,omitempty" yaml:"key" toml:"key"`
}

5
config/probe/probe.go Normal file
View File

@ -0,0 +1,5 @@
package probe
const (
ConfigFileName = "config.json"
)