probepolicy

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const (
	DetailFull    = "full"
	DetailMinimal = "minimal"
)

Result detail levels (ADR 0044, section 3).

View Source
const Any = "any"

Any disables a restriction on purpose (ADR 0044, section 1).

View Source
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

func ParseTypes(raw string) ([]string, error)

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

func ParseMethods(raw string) (*Methods, error)

ParseMethods parses a comma-separated list of HTTP methods or Any. An empty value returns nil.

func (*Methods) Allows

func (m *Methods) Allows(method string) bool

Allows reports whether method may be used. A nil *Methods allows nothing.

func (*Methods) String

func (m *Methods) String() string

String lists the methods for the local startup log.

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

func ParseTargets(raw string) (*Targets, error)

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

func (t *Targets) AllowAddrPort(ap netip.AddrPort) bool

AllowAddrPort reports whether a TCP or UDP connection to ap is allowed.

func (*Targets) AllowIP

func (t *Targets) AllowIP(ip netip.Addr) bool

AllowIP reports whether ip may be contacted on some port. It serves checks without a port: ICMP and DNS answers (ADR 0044, section 1).

func (*Targets) Any

func (t *Targets) Any() bool

Any reports whether the target restriction is switched off with Any.

func (*Targets) String

func (t *Targets) String() string

String lists the entries for the local startup log.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL