dns

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	*dns.Server
	// contains filtered or unexported fields
}

func New

func New(addr string, entityClient *entityserver_v1alpha.EntityAccessClient, log *slog.Logger) (*Server, error)

New creates a new DNS forwarding server

func NewTestServer added in v0.10.0

func NewTestServer() *Server

NewTestServer creates a minimal Server for testing without binding to a port.

func (*Server) AddSandboxMapping added in v0.10.0

func (s *Server) AddSandboxMapping(sandboxID, ipAddr, appName, service string)

AddSandboxMapping registers a sandbox's IP address for DNS resolution.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe starts the DNS server

func (*Server) LookupSandboxByIP added in v0.10.0

func (s *Server) LookupSandboxByIP(ip string) (sandboxID, appName string, ok bool)

LookupSandboxByIP returns the sandbox entity ID and app name for a given IP. On a cache miss, falls back to an entity store lookup to handle watcher lag.

func (*Server) Shutdown

func (s *Server) Shutdown() error

Shutdown gracefully shuts down the server

func (*Server) Watch

func (s *Server) Watch(ctx context.Context) error

Watch starts watching sandbox entities and maintains in-memory DNS mappings. It processes the initial snapshot synchronously so DNS is warm before returning, then consumes live changes in the background.

Jump to

Keyboard shortcuts

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