Documentation
¶
Overview ¶
Package server implements the Penne server
Index ¶
- type Config
- type ListenConfig
- type Server
- func (srv *Server) ExchangeCHAOS(_ context.Context, req *dns.Msg) (*dns.Msg, error)
- func (srv *Server) Listen() error
- func (srv *Server) ListenAndServe() error
- func (srv *Server) Serve() error
- func (srv *Server) ServeDNS(rw dns.ResponseWriter, req *dns.Msg)
- func (srv *Server) ServeHTTP(rw http.ResponseWriter, req *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Context context.Context `yaml:"-" toml:"-" json:"-"`
Logger slog.Logger `yaml:"-" toml:"-" json:"-"`
Name string `default:"localhost"`
Version string `default:"unspecified"`
Authors string `default:"JPI Technologies <oss@jpi.io>"`
// DisableCHAOS makes the DNS server respond with an empty success instead of giving
// away software information.
DisableCHAOS bool `yaml:"disable_chaos,omitempty" toml:",omitempty" json:",omitempty"`
// ExchangeTimeout indicates the deadline to be used on DNS requests
ExchangeTimeout time.Duration `yaml:"exchange_timeout" default:"5s"`
// Supervision provides details for graceful upgrades and restarts
Supervision sidecar.SupervisionConfig `yaml:"supervision,omitempty" toml:",omitempty" json:",omitempty"`
// Listen provides details on the addresses and ports to handle
Listen ListenConfig `yaml:",omitempty" toml:",omitempty" json:",omitempty"`
// TLS contains instructions to assemble the TLS store.
// TODO: allow ACME
TLS store.Config `yaml:",omitempty" toml:",omitempty" json:",omitempty"`
Horizons []horizon.Config `yaml:",omitempty" toml:",omitempty" json:",omitempty"`
Resolvers []resolver.Config `yaml:",omitempty" toml:",omitempty" json:",omitempty"`
}
Config describes how the Application will be assembled
func (*Config) SetDefaults ¶
SetDefaults fills gaps in the Config
type ListenConfig ¶ added in v0.0.3
type ListenConfig struct {
Interfaces []string `yaml:",omitempty" toml:",omitempty" json:",omitempty"`
Addresses []netip.Addr `yaml:",omitempty" toml:",omitempty" json:",omitempty"`
DNS uint16 `yaml:"dns_port" default:"53"`
DoT uint16 `yaml:"dot_port" default:"853"`
HTTP uint16 `yaml:"http_port" default:"80"`
HTTPS uint16 `yaml:"https_port" default:"443"`
// DisableHTTP disables support for plain/unencrypted HTTP of the monitoring interface
DisableHTTP bool `yaml:"disable_http,omitempty" toml:",omitempty" json:",omitempty"`
}
ListenConfig describes the addresses and ports this Server will listen
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a Penne server
func (*Server) ExchangeCHAOS ¶
ExchangeCHAOS handles only CHAOS requests
func (*Server) ListenAndServe ¶
ListenAndServe listens all ports and runs the service.
Click to show internal directories.
Click to hide internal directories.