bootstrap

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// Refresh forces a fetch attempt even if a fresh cache entry exists.
	// A failed fetch still falls back to a stale cache or the embedded
	// snapshot rather than erroring.
	Refresh bool
	// Timeout bounds the network fetch. Defaults to 5s.
	Timeout time.Duration
}

Options controls Load's behavior.

type Resolver

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

Resolver maps a TLD to its RDAP service base URL, as published by IANA's RDAP bootstrap registry (RFC 9224).

func Load

func Load(ctx context.Context, opts Options) (*Resolver, error)

Load resolves a Resolver using, in order of preference: a fresh local cache, a freshly fetched copy of the IANA bootstrap file (which it then caches), a stale local cache, or the embedded fallback snapshot. It only returns an error if the embedded snapshot itself fails to parse, which should not happen in practice — Load never fails startup purely because the network is unavailable.

func (*Resolver) BaseURL

func (r *Resolver) BaseURL(tld string) (string, bool)

BaseURL returns the RDAP base URL for tld and whether the TLD has RDAP coverage at all. tld should not include a leading dot.

Jump to

Keyboard shortcuts

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