sys

package
v0.14.0-rc.51 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package sys holds the production implementations of the control plane's system seams — the wall Clock, a crypto/rand ID source, the DNS Resolver, and the publish pre-flight's authoritative resolver and HTTP probe — the concrete values cmd/burrowd injects in place of the test fakes (ADR-0010). It lives under controlplane/ (not controlplane/internal) so cmd/burrowd and the managed module can wire it; it is licensed Apache-2.0.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthoritativeResolver

type AuthoritativeResolver struct{}

AuthoritativeResolver answers a lookup at the nameservers the host's own zone is delegated to, which is the resolver the publish pre-flight wants: a record written moments ago is already there, while a recursive resolver may still be inside the negative TTL of the answer it cached before the record existed (ADR-0041 §3).

func (AuthoritativeResolver) LookupHostAuthoritative

func (AuthoritativeResolver) LookupHostAuthoritative(ctx context.Context, host string) ([]string, error)

LookupHostAuthoritative finds the nameservers for the closest zone containing host and asks one of them directly. It errors when no zone in the name has a nameserver that will answer; the caller falls back to the recursive Resolver rather than treating that as "does not resolve".

type Clock

type Clock struct{}

Clock is the real wall clock.

func (Clock) Now

func (Clock) Now() time.Time

Now returns the current time.

type HTTPProbe

type HTTPProbe struct{}

HTTPProbe makes the publish pre-flight's one plain-HTTP request (ADR-0041 §3). It follows no redirect — a 301 to HTTPS still proves the cluster answered on port 80 for that host — and it reads no body, because the only question is whether the request arrived at all.

func (HTTPProbe) ProbeHTTP

func (HTTPProbe) ProbeHTTP(ctx context.Context, url string) (int, error)

ProbeHTTP requests url over plain HTTP and returns the status code it got back.

type IDs

type IDs struct{}

IDs mints release identifiers from crypto/rand: 128 bits of randomness, hex-encoded.

func (IDs) NewID

func (IDs) NewID() string

NewID returns a fresh random identifier. It panics only if the system's secure random source fails, which is unrecoverable and does not happen in normal operation.

type Resolver

type Resolver struct{}

Resolver answers reachability's DNS lookups against public recursive resolvers (publicDNS), falling back to the system resolver only when none are reachable (e.g. a cluster with restricted egress), so the check still works there.

func (Resolver) LookupHost

func (Resolver) LookupHost(ctx context.Context, host string) ([]string, error)

LookupHost returns the addresses host resolves to in public DNS. A genuine "not found" from a public resolver is returned as-is (the host really does not resolve); any other failure — unreachable resolver, timeout — falls back to the system resolver rather than reporting the host unresolved.

type Tokens

type Tokens struct{}

Tokens mints credential tokens from crypto/rand: 256 bits of randomness, hex-encoded (ADR-0084 §2). It is the production controlplane.TokenSource.

The value it returns IS the credential — burrowd stores only a hash of it and hands the string itself to its holder once — so the entropy is the whole of the security property. 256 bits rather than the 128 an identifier gets, because an identifier only has to be unique and this has to be unguessable.

func (Tokens) NewToken

func (Tokens) NewToken() string

NewToken returns a fresh credential token. It panics only if the system's secure random source fails, which is unrecoverable: returning a weak or empty token instead would hand out a credential somebody could guess.

Jump to

Keyboard shortcuts

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