1 Star 0 Fork 0

sqos/beats

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
config.go 769 Bytes
Copy Edit Raw Blame History
package server
import (
"errors"
"github.com/elastic/beats/libbeat/common"
)
type HttpServerConfig struct {
Paths []PathConfig `config:"paths"`
DefaultPath PathConfig `config:"default_path"`
}
type PathConfig struct {
Path string `config:"path"`
Fields common.MapStr `config:"fields"`
Namespace string `config:"namespace"`
}
func defaultHttpServerConfig() HttpServerConfig {
return HttpServerConfig{
DefaultPath: PathConfig{
Path: "/",
Namespace: "http",
},
}
}
func (p PathConfig) Validate() error {
if p.Namespace == "" {
return errors.New("`namespace` can not be empty in path configuration")
}
if p.Path == "" {
return errors.New("`path` can not be empty in path configuration")
}
return nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sqos/beats.git
git@gitee.com:sqos/beats.git
sqos
beats
beats
v6.1.0

Search