Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( IPV4 = IPProtocol("ip4") IPV6 = IPProtocol("ip6") )
View Source
var IPProtocol2Gauge = map[IPProtocol]float64{ IPV4: 4, IPV6: 6, }
Functions ¶
This section is empty.
Types ¶
type HTTPProbe ¶
type HTTPProbe struct { ValidStatusCode []int `mapstructure:"valid_status_code"` // Verify response code ValidHTTPVersions []string `mapstructure:"valid_status_code"` // Adapt to HTTP1.x/HTTP2 IPProtocol IPProtocol `mapstructure:"preferred_ip_protocol"` // Adapt to IPV4/IPV6 IPProtocolFallback bool `mapstructure:"ip_protocol_fallback"` // 允许IPV6协议降级 SkipResolvePhaseWithProxy bool `mapstructure:"skip_resolve_phase_with_proxy"` // 解析域名时不使用代理 NoFollowRedirects *bool `mapstructure:"no_follow_redirects"` // 禁止重定向 FailIfSSL bool `mapstructure:"fail_if_ssl"` // 如果被监控项为HTTPS,则失败 FailIfNotSSL bool `mapstructure:"fail_if_not_ssl"` // 如果被监控项不是HTTPS,则失败 Method string `mapstructure:"method"` Headers map[string]string `mapstructure:"headers"` // Request Headers FailIfBodyMatchesRegexp []Regexp `mapstructure:"fail_if_body_matches_regexp"` // if Response Headers not include origin strings, return failed Regexp是对regex.Regexp的封装,包含了源正则字符串 FailIfBodyNotMatchesRegexp []Regexp `mapstructure:"fail_if_body_not_matches_regexp"` FailIfHeaderMatchesRegexp []HeaderMatch `mapstructure:"fail_if_header_matches"` FailIfHeaderNotMatchesRegexp []HeaderMatch `mapstructure:"fail_if_header_not_matches"` Body string `mapstructure:"body,omitempty"` Compression string `mapstructure:"compression"` // 指定压缩算法 e.g. gzip BodySizeLimit units.Base2Bytes `mapstructure:"body_size_limit"` // units是一个单位转换工作 e.g. 1Mi => 1024*1024 HTTPClientConfig config.HTTPClientConfig `mapstructure:"http_client_config"` // prometheus 官方的工具包,包括了BearToken、BasicAuth、TLS、SSL等协议的认证,主要作用是配置http request }
func NewDefaultHTTPProbe ¶
func NewDefaultHTTPProbe() *HTTPProbe
type HeaderMatch ¶
type IPProtocol ¶
type IPProtocol string
type Module ¶
type Module struct { Prober string `mapstructure:"prober" validate:"required"` Timeout time.Duration `mapstructure:"timeout"` HTTP *HTTPProbe `mapstructure:"http"` }
func NewDefaultModule ¶
func NewDefaultModule() *Module
type Regexp ¶
func MustNewRegexp ¶
MustNewRegexp works like NewRegexp, but panics if the regular expression does not compile.
type SafeConfig ¶
SafeConfig Adjust multi threads condition
func (*SafeConfig) ReloadConfig ¶
func (sc *SafeConfig) ReloadConfig(configFile string) (err error)
Click to show internal directories.
Click to hide internal directories.