Help us shape the future of Go! Take the 2026 Go Developer Survey

rdap

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package rdap is the built-in whois plugin. It asks an RDAP server (RFC 9082/9083) about an IP prefix or an ASN for the troubleshooting API. It only reads: it never announces routes or changes controller state.

Index

Constants

View Source
const (
	DefaultBaseURL  = "https://rdap.org"
	DefaultTimeout  = 5 * time.Second
	DefaultMaxBytes = 256 << 10
)

Defaults.

View Source
const TypeName = "rdap"

TypeName is the config type.

Variables

This section is empty.

Functions

func New

func New(c plugin.Config, _ plugin.Env) (plugin.Whois, error)

New is the plugin factory. It does not touch the network.

func ParseQuery

func ParseQuery(q string) (path, kind string, err error)

ParseQuery classifies a whois query. It returns the RDAP path segment ("ip/<prefix>" or "autnum/<n>") and the kind.

Types

type Client

type Client struct {
	plugin.Base
	// contains filtered or unexported fields
}

Client is the rdap whois plugin.

func (*Client) Lookup

func (c *Client) Lookup(ctx context.Context, query string) (plugin.WhoisResult, error)

Lookup implements plugin.Whois.

type Config

type Config struct {
	// BaseURL is the RDAP service. rdap.org redirects to the right RIR.
	BaseURL  string        `yaml:"base_url"`
	Timeout  time.Duration `yaml:"timeout"`
	MaxBytes int           `yaml:"max_bytes"`
}

Config is the rdap plugin's config block.

Jump to

Keyboard shortcuts

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