server

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package server provides an embeddable Northstar DNS server with an explicit configuration struct and a Start/Reload/Shutdown lifecycle, replacing the former blocking, env-driven backend.StartDaemon entrypoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is an authoritative DNS server bound to one or more addresses, backed by a zone database synced from a filesystem dir or an S3 bucket.

func NewServer

func NewServer(cfg config.ServerConfig) (*Server, error)

NewServer constructs a Server from explicit configuration. It does not bind any listeners or read any zones until Start is called.

func (*Server) Reload

func (s *Server) Reload() error

Reload re-reads all zones from the configured source and atomically swaps the in-memory zone database. On a source enumeration failure the existing zone DB is kept untouched, so a transient S3 outage cannot wipe authoritative data.

func (*Server) ReloadZone

func (s *Server) ReloadZone(zone string) error

ReloadZone re-reads a single zone from the configured source and atomically swaps just that zone in the live database, leaving all other zones untouched. This is the control-plane fast-path: a record change is served immediately instead of after the SyncInterval poll, and the cost is one zone fetch rather than a full database rebuild.

func (*Server) Shutdown

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

Shutdown stops the sync loop and all listeners.

func (*Server) Start

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

Start loads zones, binds UDP/TCP (and optional DoT) listeners, and launches the live zone-sync loop. It is non-blocking: listeners run in background goroutines and bind errors are returned synchronously.

Jump to

Keyboard shortcuts

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