1 Star 0 Fork 0

sqos/beats

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
config.go 1.02 KB
Copy Edit Raw Blame History
package tcp
import (
"errors"
"time"
"github.com/elastic/beats/libbeat/outputs"
"github.com/elastic/beats/libbeat/outputs/transport"
"github.com/elastic/beats/heartbeat/monitors"
)
type Config struct {
Name string `config:"name"`
// check all ports if host does not contain port
Hosts []string `config:"hosts" validate:"required"`
Ports []uint16 `config:"ports"`
Mode monitors.IPSettings `config:",inline"`
Socks5 transport.ProxyConfig `config:",inline"`
// configure tls
TLS *outputs.TLSConfig `config:"ssl"`
Timeout time.Duration `config:"timeout"`
// validate connection
SendString string `config:"check.send"`
ReceiveString string `config:"check.receive"`
}
var DefaultConfig = Config{
Name: "tcp",
Timeout: 16 * time.Second,
Mode: monitors.DefaultIPSettings,
}
func (c *Config) Validate() error {
if c.Socks5.URL != "" {
if c.Mode.Mode != monitors.PingAny && !c.Socks5.LocalResolve {
return errors.New("ping all ips only supported if proxy_use_local_resolver is enabled`")
}
}
return nil
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sqos/beats.git
git@gitee.com:sqos/beats.git
sqos
beats
beats
v6.0.0-rc2

Search