Documentation
¶
Overview ¶
Package probepolicy parses the local policy of a probe (ADR 0044): the targets it may connect to, the HTTP methods and monitor types it may run and how much of a result it reports. The operator of the probe sets the policy locally; the cluster can neither relax nor see its entries.
Index ¶
Constants ¶
const ( DetailFull = "full" DetailMinimal = "minimal" )
Result detail levels (ADR 0044, section 3).
const Any = "any"
Any disables a restriction on purpose (ADR 0044, section 1).
const DefaultPrivateMethods = "GET,HEAD"
DefaultPrivateMethods are the HTTP methods of a private probe without PROBE_ALLOW_HTTP_METHODS (ADR 0044, section 2).
Variables ¶
This section is empty.
Functions ¶
func ParseTypes ¶
ParseTypes parses a comma-separated list of monitor types. An empty value returns nil, which allows every registered type. Whether a type exists is checked against the checker registry at startup.
Types ¶
type Methods ¶
type Methods struct {
// contains filtered or unexported fields
}
Methods is a parsed PROBE_ALLOW_HTTP_METHODS value.
func ParseMethods ¶
ParseMethods parses a comma-separated list of HTTP methods or Any. An empty value returns nil.
type Targets ¶
type Targets struct {
// contains filtered or unexported fields
}
Targets is a parsed PROBE_ALLOW_TARGETS value. A nil *Targets means the setting is unset.
func ParseTargets ¶
ParseTargets parses a comma-separated list of IP or CIDR entries, each optionally followed by :port or :from-to; IPv6 entries with a port use brackets, e.g. "10.20.0.0/16:443,[2001:db8::/48]:443,10.0.0.53". The value Any allows every target outside the always blocked ranges. An empty value returns nil.
func (*Targets) AllowAddrPort ¶
AllowAddrPort reports whether a TCP or UDP connection to ap is allowed.
func (*Targets) AllowIP ¶
AllowIP reports whether ip may be contacted on some port. It serves checks without a port: ICMP and DNS answers (ADR 0044, section 1).