server

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package server implements the HTTP server and all api.ServerInterface handlers.

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 holds the HTTP server and implements api.ServerInterface.

func New

func New(addr, socketPath, token string) (*Server, error)

New creates a Server that listens on addr, connects to the knot control socket at socketPath, and authenticates requests using token.

func (*Server) DeleteConfigTransactionItem

func (s *Server) DeleteConfigTransactionItem(w http.ResponseWriter, r *http.Request, params api.DeleteConfigTransactionItemParams)

DeleteConfigTransactionItem unsets a configuration item within the open transaction.

func (*Server) DeleteZoneRecord

func (s *Server) DeleteZoneRecord(w http.ResponseWriter, r *http.Request, zone api.Zone, owner api.RecordOwner, pType api.RecordType, params api.DeleteZoneRecordParams)

DeleteZoneRecord deletes a DNS record with automatic transaction handling. This is a convenience wrapper that begins a transaction, deletes the record, and commits in a single operation.

func (*Server) DeleteZoneTransactionRecord

func (s *Server) DeleteZoneTransactionRecord(w http.ResponseWriter, r *http.Request, zone api.Zone, owner api.RecordOwner, pType api.RecordType, params api.DeleteZoneTransactionRecordParams)

DeleteZoneTransactionRecord removes records within the open transaction.

func (*Server) GetConfig

func (s *Server) GetConfig(w http.ResponseWriter, r *http.Request, params api.GetConfigParams)

GetConfig reads the active configuration.

func (*Server) GetConfigExport

func (s *Server) GetConfigExport(w http.ResponseWriter, r *http.Request, params api.GetConfigExportParams)

GetConfigExport exports the confdb or its JSON schema.

func (*Server) GetConfigTransactionDiff

func (s *Server) GetConfigTransactionDiff(w http.ResponseWriter, r *http.Request, params api.GetConfigTransactionDiffParams)

GetConfigTransactionDiff returns configuration differences within the open transaction.

func (*Server) GetConfigTransactionItem

func (s *Server) GetConfigTransactionItem(w http.ResponseWriter, r *http.Request, params api.GetConfigTransactionItemParams)

GetConfigTransactionItem reads a configuration item within the open transaction.

func (*Server) GetStats

func (s *Server) GetStats(w http.ResponseWriter, r *http.Request, params api.GetStatsParams)

GetStats returns global statistics counters.

func (*Server) GetStatus

func (s *Server) GetStatus(w http.ResponseWriter, r *http.Request, params api.GetStatusParams)

GetStatus checks server status.

func (*Server) GetZoneRecords

func (s *Server) GetZoneRecords(w http.ResponseWriter, r *http.Request, zone api.Zone, params api.GetZoneRecordsParams)

GetZoneRecords reads zone records currently being served.

func (*Server) GetZoneSerial

func (s *Server) GetZoneSerial(w http.ResponseWriter, r *http.Request, zone api.Zone)

GetZoneSerial returns the current SOA serial number.

func (*Server) GetZoneStats

func (s *Server) GetZoneStats(w http.ResponseWriter, r *http.Request, zone api.Zone, params api.GetZoneStatsParams)

GetZoneStats shows zone statistics counters.

func (*Server) GetZoneStatus

func (s *Server) GetZoneStatus(w http.ResponseWriter, r *http.Request, zone api.Zone, params api.GetZoneStatusParams)

GetZoneStatus shows zone status.

func (*Server) GetZoneTransactionDiff

func (s *Server) GetZoneTransactionDiff(w http.ResponseWriter, r *http.Request, zone api.Zone)

GetZoneTransactionDiff returns zone record changes within the open transaction.

func (*Server) GetZoneTransactionRecords

func (s *Server) GetZoneTransactionRecords(w http.ResponseWriter, r *http.Request, zone api.Zone, params api.GetZoneTransactionRecordsParams)

GetZoneTransactionRecords reads zone records within the open transaction.

func (*Server) GetZones added in v0.1.1

func (s *Server) GetZones(w http.ResponseWriter, r *http.Request, params api.GetZonesParams)

GetZoneList returns a list of zones currently being served.

func (*Server) PostConfigCheck

func (s *Server) PostConfigCheck(w http.ResponseWriter, r *http.Request)

PostConfigCheck checks the server configuration for errors.

func (*Server) PostConfigImport

func (s *Server) PostConfigImport(w http.ResponseWriter, r *http.Request)

PostConfigImport imports a configuration file into the confdb.

func (*Server) PostConfigInit

func (s *Server) PostConfigInit(w http.ResponseWriter, r *http.Request)

PostConfigInit initialises the configuration database.

func (*Server) PostConfigTransaction

func (s *Server) PostConfigTransaction(w http.ResponseWriter, r *http.Request)

PostConfigTransaction begins a configuration write transaction.

func (*Server) PostConfigTransactionAbort

func (s *Server) PostConfigTransactionAbort(w http.ResponseWriter, r *http.Request)

PostConfigTransactionAbort rolls back the open configuration transaction.

func (*Server) PostConfigTransactionCommit

func (s *Server) PostConfigTransactionCommit(w http.ResponseWriter, r *http.Request)

PostConfigTransactionCommit commits the open configuration transaction.

func (*Server) PostReload

func (s *Server) PostReload(w http.ResponseWriter, r *http.Request)

PostReload reloads server configuration and modified zones.

func (*Server) PostStop

func (s *Server) PostStop(w http.ResponseWriter, r *http.Request)

PostStop stops the server.

func (*Server) PostZoneBackup

func (s *Server) PostZoneBackup(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneBackup backs up zone data to a server-side directory.

func (*Server) PostZoneCheck

func (s *Server) PostZoneCheck(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneCheck checks if the zone can be loaded from disk.

func (*Server) PostZoneFlush

func (s *Server) PostZoneFlush(w http.ResponseWriter, r *http.Request, zone api.Zone, params api.PostZoneFlushParams)

PostZoneFlush flushes zone journal into the zone file.

func (*Server) PostZoneFreeze

func (s *Server) PostZoneFreeze(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneFreeze temporarily postpones automatic zone-changing events.

func (*Server) PostZoneKSKSubmitted

func (s *Server) PostZoneKSKSubmitted(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneKSKSubmitted confirms that the parent DS record is present after KSK submission.

func (*Server) PostZoneKeyRollover

func (s *Server) PostZoneKeyRollover(w http.ResponseWriter, r *http.Request, zone api.Zone, keyType api.PostZoneKeyRolloverParamsKeyType)

PostZoneKeyRollover triggers an immediate key rollover.

func (*Server) PostZoneKeysLoad

func (s *Server) PostZoneKeysLoad(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneKeysLoad reloads keys from the KASP database and re-signs the zone.

func (*Server) PostZoneNotify

func (s *Server) PostZoneNotify(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneNotify sends a NOTIFY to all configured remotes.

func (*Server) PostZonePurge

func (s *Server) PostZonePurge(w http.ResponseWriter, r *http.Request, zone api.Zone, params api.PostZonePurgeParams)

PostZonePurge purges zone data, zone file, journal, timers, and KASP data.

func (*Server) PostZoneRecord

func (s *Server) PostZoneRecord(w http.ResponseWriter, r *http.Request, zone api.Zone, owner api.RecordOwner, pType api.RecordType)

PostZoneRecord adds or updates a DNS record with automatic transaction handling. This is a convenience wrapper that begins a transaction, adds/updates the record, and commits in a single operation.

func (*Server) PostZoneRecordsBatch

func (s *Server) PostZoneRecordsBatch(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneRecordsBatch performs batch add/update/delete operations with automatic transaction handling. All operations succeed or fail together as a single atomic transaction.

func (*Server) PostZoneRefresh

func (s *Server) PostZoneRefresh(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneRefresh forces a slave zone refresh.

func (*Server) PostZoneReload

func (s *Server) PostZoneReload(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneReload reloads zone from disk.

func (*Server) PostZoneRestore

func (s *Server) PostZoneRestore(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneRestore restores zone data from a server-side backup directory.

func (*Server) PostZoneRetransfer

func (s *Server) PostZoneRetransfer(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneRetransfer forces slave zone retransfer without a serial check.

func (*Server) PostZoneSign

func (s *Server) PostZoneSign(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneSign re-signs the automatically signed zone.

func (*Server) PostZoneThaw

func (s *Server) PostZoneThaw(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneThaw dismisses a zone freeze.

func (*Server) PostZoneTransaction

func (s *Server) PostZoneTransaction(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneTransaction begins a zone transaction.

func (*Server) PostZoneTransactionAbort

func (s *Server) PostZoneTransactionAbort(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneTransactionAbort aborts and rolls back the open zone transaction.

func (*Server) PostZoneTransactionCommit

func (s *Server) PostZoneTransactionCommit(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneTransactionCommit commits the open zone transaction.

func (*Server) PostZoneValidate

func (s *Server) PostZoneValidate(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneValidate triggers DNSSEC validation of the zone.

func (*Server) PostZoneXFRFreeze

func (s *Server) PostZoneXFRFreeze(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneXFRFreeze temporarily disables outgoing AXFR/IXFR.

func (*Server) PostZoneXFRThaw

func (s *Server) PostZoneXFRThaw(w http.ResponseWriter, r *http.Request, zone api.Zone)

PostZoneXFRThaw re-enables outgoing AXFR/IXFR.

func (*Server) PutConfigTransactionItem

func (s *Server) PutConfigTransactionItem(w http.ResponseWriter, r *http.Request)

PutConfigTransactionItem sets a configuration item within the open transaction.

func (*Server) PutZoneSerial

func (s *Server) PutZoneSerial(w http.ResponseWriter, r *http.Request, zone api.Zone)

PutZoneSerial sets or increments the SOA serial number.

func (*Server) PutZoneTransactionRecord

func (s *Server) PutZoneTransactionRecord(w http.ResponseWriter, r *http.Request, zone api.Zone, owner api.RecordOwner, pType api.RecordType)

PutZoneTransactionRecord adds or replaces a record within the open transaction.

func (*Server) Start

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

Start runs the HTTP server until ctx is cancelled, then shuts down gracefully.

Jump to

Keyboard shortcuts

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