ing
This commit is contained in:
parent
ae7d8a8d8c
commit
2ffbb7f711
7
config/config.go
Normal file
7
config/config.go
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
package config
|
||||||
|
|
||||||
|
import "flag"
|
||||||
|
|
||||||
|
func FlagConfigDir() *string {
|
||||||
|
return flag.String("config-dir", ".", "The directory path of config")
|
||||||
|
}
|
|
@ -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"`
|
5
config/noauthprobe/noauthprobe.go
Normal file
5
config/noauthprobe/noauthprobe.go
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
package noauthprobe
|
||||||
|
|
||||||
|
const (
|
||||||
|
ConfigFileName = "noauthprobe.json"
|
||||||
|
)
|
|
@ -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
6
config/probe/Config.go
Normal 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"`
|
||||||
|
}
|
5
config/probe/ProbeConfig.go
Normal file
5
config/probe/ProbeConfig.go
Normal 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
5
config/probe/probe.go
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
package probe
|
||||||
|
|
||||||
|
const (
|
||||||
|
ConfigFileName = "config.json"
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user