ns

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package ns contains the name server implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Addr     string
	Upstream string
	TTL      time.Duration
	TagStore tailscale.Interface
	Timeouts Timeouts
	// contains filtered or unexported fields
}

Server is a DNS server.

func (*Server) Run

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

Run starts the DNS server and blocks until the context is canceled.

func (*Server) SetConfig added in v0.5.0

func (s *Server) SetConfig(cfg config.Config)

SetConfig sets the server configuration.

type Timeouts added in v0.10.0

type Timeouts struct {
	Read     time.Duration `long:"read"  env:"READ"  description:"Read timeout"  default:"2s"`
	Write    time.Duration `long:"write" env:"WRITE" description:"Write timeout" default:"2s"`
	Idle     time.Duration `long:"idle"  env:"IDLE"  description:"Idle timeout"  default:"8s"`
	Upstream struct {
		Read    time.Duration `long:"read"    env:"READ"    description:"Read timeout"    default:"2s"`
		Write   time.Duration `long:"write"   env:"WRITE"   description:"Write timeout"   default:"2s"`
		Dial    time.Duration `long:"dial"    env:"DIAL"    description:"Dial timeout"    default:"2s"`
		Request time.Duration `long:"request" env:"REQUEST" description:"Request timeout"`
	} `group:"upstream" namespace:"upstream"`
}

Timeouts is a collection of various the DNS timeouts.

Jump to

Keyboard shortcuts

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