MCPcopy Create free account
hub / github.com/cppla/moto / verify

Method verify

config/setting.go:93–121  ·  view source on GitHub ↗

verify 校验规则配置,并在需要时编译正则。

()

Source from the content-addressed store, hash-verified

91 ProtocolTCP: {},
92 ProtocolSOCKS5: {},
93}
94
95// Config is the complete Moto configuration.
96type Config struct {
97 Log LogConfig `json:"log"`
98 Metrics MetricsConfig `json:"metrics,omitempty"`
99 Rules []*Rule `json:"rules"`
100}
101
102// MetricsConfig controls the optional local-only observability listener.
103// Listen must remain on a numeric loopback address so metrics and health
104// endpoints cannot be exposed accidentally.
105type MetricsConfig struct {
106 Enabled bool `json:"enabled"`
107 Listen string `json:"listen"`
108}
109
110// LogConfig controls the minimum log level and the optional rolling log file.
111// Logs are always written to stdout; Path adds a second, rolling destination.
112type LogConfig struct {
113 Level string `json:"level"`
114 Path string `json:"path"`
115}
116
117// Target is one upstream endpoint. Regexp is used by regex-mode rules and Re
118// holds its validated, compiled form.
119type Target struct {
120 Regexp string `json:"regexp"`
121 Re *regexp.Regexp `json:"-"`
122 Address string `json:"address"`
123 ServerNames []string `json:"serverNames,omitempty"`
124 ALPN []string `json:"alpn,omitempty"`

Callers 2

initFunction · 0.80
ReloadFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected