Documentation ¶
Index ¶
- Constants
- type Config
- type TypeBlocklistURI
- type TypeBytes
- type TypeDuration
- type TypeErrorRate
- type TypeHTTPPath
- type TypeHostPort
- func (c TypeHostPort) HostValue(defaultValue net.IP) net.IP
- func (c TypeHostPort) MarshalText() ([]byte, error)
- func (c TypeHostPort) PortValue(defaultValue uint) uint
- func (c TypeHostPort) String() string
- func (c *TypeHostPort) UnmarshalText(data []byte) error
- func (c TypeHostPort) Value(defaultHostValue net.IP, defaultPortValue uint) string
- type TypeIP
- type TypeMetricPrefix
- type TypePort
- type TypePreferIP
- type TypeStatsdTagFormat
- type TypeURL
Constants ¶
View Source
const ( TypePreferIPPreferIPv4 = "prefer-ipv4" TypePreferIPPreferIPv6 = "prefer-ipv6" TypePreferOnlyIPv4 = "only-ipv4" TypePreferOnlyIPv6 = "only-ipv6" )
View Source
const ( TypeStatsdTagFormatInfluxdb = "influxdb" TypeStatsdTagFormatDatadog = "datadog" TypeStatsdTagFormatGraphite = "graphite" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Debug bool `json:"debug"` Secret mtglib.Secret `json:"secret"` BindTo TypeHostPort `json:"bind-to"` TCPBuffer TypeBytes `json:"tcp-buffer"` PreferIP TypePreferIP `json:"prefer-ip"` DomainFrontingPort TypePort `json:"domain-fronting-port"` TolerateTimeSkewness TypeDuration `json:"tolerate-time-skewness"` Concurrency uint `json:"concurrency"` Defense struct { AntiReplay struct { Enabled bool `json:"enabled"` MaxSize TypeBytes `json:"max-size"` ErrorRate TypeErrorRate `json:"error-rate"` } `json:"anti-replay"` Blocklist struct { Enabled bool `json:"enabled"` DownloadConcurrency uint `json:"download-concurrency"` URLs []TypeBlocklistURI `json:"urls"` UpdateEach TypeDuration `json:"update-each"` } `json:"blocklist"` } `json:"defense"` Network struct { Timeout struct { TCP TypeDuration `json:"tcp"` HTTP TypeDuration `json:"http"` Idle TypeDuration `json:"idle"` } `json:"timeout"` DOHIP TypeIP `json:"doh-ip"` Proxies []TypeURL `json:"proxies"` } `json:"network"` Stats struct { StatsD struct { Enabled bool `json:"enabled"` Address TypeHostPort `json:"address"` MetricPrefix TypeMetricPrefix `json:"metric-prefix"` TagFormat TypeStatsdTagFormat `json:"tag-format"` } `json:"statsd"` Prometheus struct { Enabled bool `json:"enabled"` BindTo TypeHostPort `json:"bind-to"` HTTPPath TypeHTTPPath `json:"http-path"` MetricPrefix TypeMetricPrefix `json:"metric-prefix"` } `json:"prometheus"` } `json:"stats"` }
type TypeBlocklistURI ¶
type TypeBlocklistURI struct {
// contains filtered or unexported fields
}
func (TypeBlocklistURI) IsRemote ¶
func (c TypeBlocklistURI) IsRemote() bool
func (TypeBlocklistURI) MarshalText ¶
func (c TypeBlocklistURI) MarshalText() ([]byte, error)
func (TypeBlocklistURI) String ¶
func (c TypeBlocklistURI) String() string
func (*TypeBlocklistURI) UnmarshalText ¶
func (c *TypeBlocklistURI) UnmarshalText(data []byte) error
func (TypeBlocklistURI) Value ¶
func (c TypeBlocklistURI) Value(defaultValue string) string
type TypeBytes ¶
type TypeBytes struct {
// contains filtered or unexported fields
}
func (TypeBytes) MarshalText ¶
func (*TypeBytes) UnmarshalText ¶
type TypeDuration ¶
type TypeDuration struct {
// contains filtered or unexported fields
}
func (TypeDuration) MarshalText ¶
func (c TypeDuration) MarshalText() ([]byte, error)
func (TypeDuration) String ¶
func (c TypeDuration) String() string
func (*TypeDuration) UnmarshalText ¶
func (c *TypeDuration) UnmarshalText(data []byte) error
type TypeErrorRate ¶
type TypeErrorRate struct {
// contains filtered or unexported fields
}
func (*TypeErrorRate) MarshalText ¶
func (c *TypeErrorRate) MarshalText() ([]byte, error)
func (TypeErrorRate) String ¶
func (c TypeErrorRate) String() string
func (*TypeErrorRate) UnmarshalJSON ¶
func (c *TypeErrorRate) UnmarshalJSON(data []byte) error
func (TypeErrorRate) Value ¶
func (c TypeErrorRate) Value(defaultValue float64) float64
type TypeHTTPPath ¶
type TypeHTTPPath struct {
// contains filtered or unexported fields
}
func (TypeHTTPPath) MarshalText ¶
func (c TypeHTTPPath) MarshalText() ([]byte, error)
func (TypeHTTPPath) String ¶
func (c TypeHTTPPath) String() string
func (*TypeHTTPPath) UnmarshalText ¶
func (c *TypeHTTPPath) UnmarshalText(data []byte) error
func (TypeHTTPPath) Value ¶
func (c TypeHTTPPath) Value(defaultValue string) string
type TypeHostPort ¶
type TypeHostPort struct {
// contains filtered or unexported fields
}
func (TypeHostPort) MarshalText ¶
func (c TypeHostPort) MarshalText() ([]byte, error)
func (TypeHostPort) PortValue ¶
func (c TypeHostPort) PortValue(defaultValue uint) uint
func (TypeHostPort) String ¶
func (c TypeHostPort) String() string
func (*TypeHostPort) UnmarshalText ¶
func (c *TypeHostPort) UnmarshalText(data []byte) error
type TypeIP ¶
type TypeIP struct {
// contains filtered or unexported fields
}
func (*TypeIP) MarshalText ¶
func (*TypeIP) UnmarshalText ¶
type TypeMetricPrefix ¶
type TypeMetricPrefix struct {
// contains filtered or unexported fields
}
func (TypeMetricPrefix) MarshalText ¶
func (c TypeMetricPrefix) MarshalText() ([]byte, error)
func (TypeMetricPrefix) String ¶
func (c TypeMetricPrefix) String() string
func (*TypeMetricPrefix) UnmarshalText ¶
func (c *TypeMetricPrefix) UnmarshalText(data []byte) error
func (TypeMetricPrefix) Value ¶
func (c TypeMetricPrefix) Value(defaultValue string) string
type TypePort ¶
type TypePort struct {
// contains filtered or unexported fields
}
func (*TypePort) MarshalJSON ¶
func (*TypePort) UnmarshalJSON ¶
type TypePreferIP ¶
type TypePreferIP struct {
// contains filtered or unexported fields
}
func (TypePreferIP) MarshalText ¶
func (c TypePreferIP) MarshalText() ([]byte, error)
func (*TypePreferIP) String ¶
func (c *TypePreferIP) String() string
func (*TypePreferIP) UnmarshalText ¶
func (c *TypePreferIP) UnmarshalText(data []byte) error
func (*TypePreferIP) Value ¶
func (c *TypePreferIP) Value(defaultValue string) string
type TypeStatsdTagFormat ¶
type TypeStatsdTagFormat struct {
// contains filtered or unexported fields
}
func (TypeStatsdTagFormat) MarshalText ¶
func (c TypeStatsdTagFormat) MarshalText() ([]byte, error)
func (*TypeStatsdTagFormat) String ¶
func (c *TypeStatsdTagFormat) String() string
func (*TypeStatsdTagFormat) UnmarshalText ¶
func (c *TypeStatsdTagFormat) UnmarshalText(data []byte) error
func (*TypeStatsdTagFormat) Value ¶
func (c *TypeStatsdTagFormat) Value(defaultValue string) string
type TypeURL ¶
type TypeURL struct {
// contains filtered or unexported fields
}
func (*TypeURL) MarshalText ¶
func (*TypeURL) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.