代码拉取完成,页面将自动刷新
package elasticsearch
import (
"time"
"github.com/elastic/beats/libbeat/outputs"
)
type elasticsearchConfig struct {
Protocol string `config:"protocol"`
Path string `config:"path"`
Params map[string]string `config:"parameters"`
Headers map[string]string `config:"headers"`
Username string `config:"username"`
Password string `config:"password"`
ProxyURL string `config:"proxy_url"`
LoadBalance bool `config:"loadbalance"`
CompressionLevel int `config:"compression_level" validate:"min=0, max=9"`
TLS *outputs.TLSConfig `config:"ssl"`
BulkMaxSize int `config:"bulk_max_size"`
MaxRetries int `config:"max_retries"`
Timeout time.Duration `config:"timeout"`
Backoff Backoff `config:"backoff"`
}
type Backoff struct {
Init time.Duration
Max time.Duration
}
const (
defaultBulkSize = 50
)
var (
defaultConfig = elasticsearchConfig{
Protocol: "",
Path: "",
ProxyURL: "",
Params: nil,
Username: "",
Password: "",
Timeout: 90 * time.Second,
MaxRetries: 3,
CompressionLevel: 0,
TLS: nil,
LoadBalance: true,
Backoff: Backoff{
Init: 1 * time.Second,
Max: 60 * time.Second,
},
}
)
func (c *elasticsearchConfig) Validate() error {
if c.ProxyURL != "" {
if _, err := parseProxyURL(c.ProxyURL); err != nil {
return err
}
}
return nil
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。