address

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: Apache-2.0 Imports: 11 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 address provides utilities for resolving addresses from Kubernetes resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressesToStrings

func AddressesToStrings(addresses []ResolvedAddress) []string

AddressesToStrings converts ResolvedAddresses to a string slice.

func DetermineRecordType

func DetermineRecordType(addr ResolvedAddress) string

DetermineRecordType determines the DNS record type based on the address.

Types

type ResolveResult

type ResolveResult struct {
	// Addresses contains all resolved addresses.
	Addresses []ResolvedAddress
	// ResourceVersion is the source resource's resourceVersion.
	ResourceVersion string
	// SourceExists indicates whether the source resource exists.
	SourceExists bool
}

ResolveResult contains the result of address resolution.

type ResolvedAddress

type ResolvedAddress struct {
	// Value is the IP address or hostname.
	Value string
	// IsIPv4 indicates if this is an IPv4 address.
	IsIPv4 bool
	// IsIPv6 indicates if this is an IPv6 address.
	IsIPv6 bool
	// IsHostname indicates if this is a hostname (not an IP).
	IsHostname bool
}

ResolvedAddress represents a single resolved address.

func ParseAddress

func ParseAddress(addr string) ResolvedAddress

ParseAddress parses an address string and returns a ResolvedAddress.

func SelectAddresses

func SelectAddresses(addresses []ResolvedAddress, policy v1alpha2.AddressSelectionPolicy) []ResolvedAddress

SelectAddresses applies the selection policy to choose addresses.

type Resolver

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

Resolver resolves addresses from Kubernetes resources.

func NewResolver

func NewResolver(c client.Client) *Resolver

NewResolver creates a new address resolver.

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, sourceRef *v1alpha2.DNSRecordSourceRef, defaultNamespace string) (*ResolveResult, error)

Resolve resolves addresses from the given source reference. The defaultNamespace is used when the source doesn't specify a namespace.

Jump to

Keyboard shortcuts

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