zeroms

package module
v0.0.0-...-985e7da Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package zeroms is a CoreDNS plugin that provides landing page and statistics functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stats

type Stats struct {
	StartTime        time.Time
	TotalRequests    uint64
	ErrorCount       uint64
	UpstreamRequests uint64
	CacheHits        uint64
	CacheMisses      uint64
	TotalLatency     int64
	UpstreamLatency  int64
	// contains filtered or unexported fields
}

Stats holds DNS server statistics

func (*Stats) AddLatency

func (s *Stats) AddLatency(duration time.Duration)

AddLatency atomically adds latency measurement

func (*Stats) AddUpstreamLatency

func (s *Stats) AddUpstreamLatency(duration time.Duration)

AddUpstreamLatency atomically adds upstream latency measurement

func (*Stats) Clone

func (s *Stats) Clone() *Stats

Clone creates a safe copy of Stats without copying mutex

func (*Stats) GetStats

func (s *Stats) GetStats() map[string]interface{}

GetStats returns current DNS server statistics with enhanced metrics

func (*Stats) IncrementCounter

func (s *Stats) IncrementCounter(counter *uint64)

IncrementCounter atomically increments a counter

func (*Stats) Reset

func (s *Stats) Reset()

Reset clears all statistics counters

func (*Stats) RestoreFrom

func (s *Stats) RestoreFrom(other *Stats)

RestoreFrom safely restores stats data from another Stats instance

type Zeroms

type Zeroms struct {
	Next plugin.Handler
	// contains filtered or unexported fields
}

Zeroms is the main plugin struct that holds configuration and stats

func (Zeroms) Name

func (z Zeroms) Name() string

Name implements the Handler interface

func (Zeroms) ServeDNS

func (z Zeroms) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

ServeDNS implements the plugin.Handler interface

Jump to

Keyboard shortcuts

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