Documentation
¶
Index ¶
Constants ¶
View Source
const Name = "dso"
Variables ¶
View Source
var ( DefaultTCPPort = 0 DefaultTLSPort = 0 DefaultInactivityTimeout = 1 * time.Minute DefaultKeepAliveInterval = dsomessage.KeepAliveIntervalRecommended * time.Millisecond DefaultRestartReconnectInterval = 5 * time.Second DefaultShutdownReconnectInterval = 15 * time.Second DefaultPushRefreshInterval = 1 * time.Minute DefaultPushBurstDebounceInterval = 1 * time.Second DefaultPushTypes = [...]uint16{ dns.TypeA, dns.TypePTR, dns.TypeTXT, dns.TypeAAAA, dns.TypeSRV, } DefaultPushClasses = [...]uint16{ dns.ClassINET, } )
View Source
var ErrServerClosed = errors.New("server closed")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// TCPPort is port for DSO services that don't require TLS. Set to 0 to disable.
TCPPort int
// TLSPort is port for DSO services that require TLS. Set to 0 to disable.
TLSPort int
// InactivityTimeout is maximum amount of time session can be inactive. Clients can further reduce it.
InactivityTimeout time.Duration
// KeepAliveInterval is maximum amount of time session can be without any traffic. Clients can further reduce it.
KeepAliveInterval time.Duration
// RestartReconnectInterval is RetryDelay interval for gracefully closed sessions due to Restart. Set to <0 to disable.
RestartReconnectInterval time.Duration
// ShutdownReconnectInterval is RetryDelay interval for gracefully closed sessions due to Shutdown. Set to <0 to disable.
ShutdownReconnectInterval time.Duration
// TLSConfig is TLS configuration inherited from [dnsserver.Config] plugin is part of.
TLSConfig *tls.Config
// Log is logging configuration. Set to nil to disable.
Log *LogConfig
// Push is DSO Push.
Push *PushConfig
}
type PushConfig ¶
type PushConfig struct {
// Zones handler is authoritative for.
//
// See [Push] for comparison and normalization.
Zones []string
// Classes is sorted list of subscribable classes.
Classes []uint16
// Types is sorted list of subscribable types.
Types []uint16
// RefreshInterval is periodic refresh interval of subscriptions.
// Set to 0 to disable and use [Server.RefreshPushSubscriptions] instead.
RefreshInterval time.Duration
// DebounceDelay is delay to tame burst subscriptions. Set to 0 to disable.
DebounceDelay time.Duration
}
type Server ¶
type Server struct {
Config *Config
Upstream *dnsserver.Server
// contains filtered or unexported fields
}
func Servers ¶
Servers returns DSO servers in caddy.Instance.
func (*Server) RefreshPushSubscriptions ¶
func (s *Server) RefreshPushSubscriptions()
RefreshPushSubscriptions initiates refresh of push subscriptions. Can be called concurrently.
func (*Server) Serve ¶
Serve serves DSO over connections accepted from listener until shutdown or error.
Timeout errors are absorbed. Only exceptoin is os.ErrDeadlineExceeded which can be used to "release" listener.
func (*Server) ServeTLS ¶
ServeTLS is same as Server.Serve but connections are tls-wrapped.
Click to show internal directories.
Click to hide internal directories.