networkprobe

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: AGPL-3.0 Imports: 35 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 networkprobe checks an operator-enrolled node through its public ingress.

Index

Constants

View Source
const OriginCount = 3

Variables

This section is empty.

Functions

func AuthorityOrigin

func AuthorityOrigin(raw string) (string, error)

AuthorityOrigin validates and canonicalizes an authority HTTPS origin so operator overrides cannot transmit credentials over plaintext HTTP or inject paths, queries, or fragments.

func Check

func Check(ctx context.Context, client *http.Client, work Work, shares [OriginCount]SyntheticShare) error

func Client

func Client() *http.Client

func Fetch

func Fetch(ctx context.Context, client *http.Client, address string, limit int64) ([]byte, error)

func LoadRelease

func LoadRelease(path string) (*networkconfig.Config, error)

LoadRelease returns the compiled-in release configuration when path is empty, or reads and verifies an explicit release manifest file for operator tools.

func ReleaseClient

func ReleaseClient() *http.Client

ReleaseClient follows the host's DNS policy for release-configured authority URLs.

func ResolveAuthority

func ResolveAuthority(config *networkconfig.Config, override string) (string, error)

ResolveAuthority selects an explicit authority override when provided, or falls back to the release manifest's authority URL.

Types

type AuthorityError

type AuthorityError struct {
	Action     string
	StatusCode int
	Kind       string
	Reason     string
}

AuthorityError records a non-200 HTTP response from the network authority, including any validated fault kind and reason parsed from its JSON body.

func ReadAuthorityError

func ReadAuthorityError(action string, res *http.Response) *AuthorityError

ReadAuthorityError builds a structured diagnostic error from a non-200 authority HTTP response. Non-JSON, oversized, or non-token payloads fall back to the bare HTTP status so intermediary pages cannot pollute logs.

func (*AuthorityError) Error

func (e *AuthorityError) Error() string

type Observation

type Observation struct {
	OperationID string `json:"operation_id"`
	TCP         bool   `json:"tcp"`
	TLSExpires  *int64 `json:"tls_expires"`
	HTTPS       bool   `json:"https"`
	Relay       *bool  `json:"relay"`
	STUN        *bool  `json:"stun"`
}

func Observe

func Observe(ctx context.Context, client *http.Client, target Target) Observation

Observe keeps the UDP and HTTPS paths independent so a broken reverse proxy does not mask a working STUN server in monitoring reports.

type SyntheticShare

type SyntheticShare struct {
	// contains filtered or unexported fields
}

func NewShare

func NewShare() (SyntheticShare, error)

func (SyntheticShare) ID

type Target

type Target struct {
	OperationID string             `json:"operation_id"`
	Node        nodedirectory.Node `json:"spec"`
}

type Work

type Work struct {
	OperationID string             `json:"operation_id"`
	Lease       string             `json:"lease"`
	Node        nodedirectory.Node `json:"spec"`
	Origins     []string           `json:"origins"`
	Tickets     []string           `json:"tickets"`
}

Jump to

Keyboard shortcuts

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