scheduler

package
v0.51.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Record

type Record struct {
	Name    string `json:"name"`
	Network string `json:"network"`
	IP      string `json:"ip"`
	VMID    string `json:"vm_id"`
}

Record describes a resolvable VM name inside a network scope.

type Resolver

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

Resolver resolves VM names to IP addresses using in-memory VM state.

func NewResolver

func NewResolver(vms VMSource) *Resolver

NewResolver creates a Resolver backed by a VM source.

func (*Resolver) List

func (r *Resolver) List(network string) []Record

List returns all resolvable records, optionally filtered by network.

func (*Resolver) Resolve

func (r *Resolver) Resolve(name, network string) (Record, error)

Resolve returns a DNS record for name and optional network. Accepted names are VM ID and VM name. If name is of the form host.network and network is empty, the network is inferred from the suffix.

func (*Resolver) ResolveAll

func (r *Resolver) ResolveAll(name, network string) ([]Record, error)

ResolveAll returns all DNS records matching a name within a network scope. For services with multiple replicas, this returns all healthy replica IPs, enabling round-robin DNS load balancing.

type VMSource

type VMSource interface {
	List() []*vm.VM
}

VMSource provides access to VMs for DNS-like name resolution.

Jump to

Keyboard shortcuts

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