whois

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

README

whois

WHOIS registration lookups for domain names and IP addresses, for the gollem LLM agent framework.

github.com/gollem-dev/tools/whois

Tools

Name Description
whois_domain Perform a WHOIS lookup for a domain name.
whois_ip Perform a WHOIS lookup for an IP address (IPv4/IPv6).

Usage

ts, err := whois.New()
if err != nil {
	return err
}
if err := ts.Ping(ctx); err != nil { // optional preflight
	return err
}

No credentials are required; WHOIS queries go directly to the responsible registries.

Options

Option Required Default
WithLogger(*slog.Logger) no slog.Default()

Testing

Mock tests run unconditionally. The live-service test runs only when TEST_WHOIS_DOMAIN and TEST_WHOIS_IP are set:

TEST_WHOIS_DOMAIN=example.com TEST_WHOIS_IP=8.8.8.8 go test ./...

Documentation

Overview

Package whois provides a gollem.ToolSet for WHOIS domain and IP lookups.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*ToolSet)

Option configures a ToolSet.

func WithLogger

func WithLogger(logger *slog.Logger) Option

WithLogger sets the logger. A nil logger keeps the default (slog.Default()).

type ToolSet

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

ToolSet implements gollem.ToolSet for WHOIS lookups. Fields are unexported; configure via Option.

func New

func New(opts ...Option) (*ToolSet, error)

New constructs the ToolSet. It only validates static configuration; use Ping to verify connectivity.

func (*ToolSet) Ping

func (t *ToolSet) Ping(ctx context.Context) error

Ping verifies basic WHOIS connectivity by querying a well-known IP address.

func (*ToolSet) Run

func (t *ToolSet) Run(ctx context.Context, name string, args map[string]any) (map[string]any, error)

Run executes the named WHOIS lookup.

func (*ToolSet) Specs

func (t *ToolSet) Specs(_ context.Context) ([]gollem.ToolSpec, error)

Specs returns the WHOIS tool specifications.

Jump to

Keyboard shortcuts

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