Documentation
¶
Index ¶
- Variables
- func NewPrefixedListener(prefix []byte, listener net.Listener) net.Listener
- type Config
- type PrefixedListener
- type Server
- func (p *Server) AddHTTPFallback(httpHandler http.HandlerFunc)
- func (p *Server) Addr() net.Addr
- func (p *Server) Close() error
- func (p *Server) DRPC() drpc.Mux
- func (p *Server) DebounceLimit() int
- func (p *Server) FastOpen() bool
- func (p *Server) Identity() *identity.FullIdentity
- func (p *Server) IsQUICEnabled() bool
- func (p *Server) NoiseKeyAttestation(ctx context.Context) (_ *pb.NoiseKeyAttestation, err error)
- func (p *Server) PrivateAddr() net.Addr
- func (p *Server) PrivateDRPC() drpc.Mux
- func (p *Server) ReplaySafeDRPC() drpc.Mux
- func (p *Server) Run(ctx context.Context) (err error)
- func (p *Server) Stats(cb func(key monkit.SeriesKey, field string, val float64))
Constants ¶
This section is empty.
Variables ¶
var (
// Error is a pkg/server error.
Error = errs.Class("server")
)
Functions ¶
func NewPrefixedListener ¶ added in v1.63.1
func NewPrefixedListener(prefix []byte, listener net.Listener) net.Listener
NewPrefixedListener creates a new PrefixedListener.
Types ¶
type Config ¶
type Config struct {
tlsopts.Config
Address string `user:"true" help:"public address to listen on" default:":7777" testDefault:"$HOST:0"`
PrivateAddress string `user:"true" help:"private address to listen on" default:"127.0.0.1:7778" testDefault:""`
DisableQUIC bool `help:"disable QUIC listener on a server" hidden:"true" default:"false"`
DisableTCP bool `help:"disable TCP listener on a server" internal:"true"`
DebugLogTraffic bool `hidden:"true" default:"false"` // Deprecated
TCPFastOpen bool `help:"enable support for tcp fast open" default:"true"`
TCPFastOpenQueue int `help:"the size of the tcp fast open queue" default:"256"`
DebouncingEnabled bool `help:"whether to debounce incoming messages" default:"true"`
}
Config holds server specific configuration parameters.
type PrefixedListener ¶ added in v1.63.1
type PrefixedListener struct {
net.Listener
// contains filtered or unexported fields
}
PrefixedListener injects prefix bytes to the beginning of every new connection.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents a bundle of services defined by a specific ID. Examples of servers are the satellite, the storagenode, and the uplink.
func New ¶
func New(log *zap.Logger, tlsOptions *tlsopts.Options, config Config) (_ *Server, err error)
New creates a Server out of an Identity, a net.Listener, and interceptors.
func (*Server) AddHTTPFallback ¶ added in v1.63.1
func (p *Server) AddHTTPFallback(httpHandler http.HandlerFunc)
AddHTTPFallback adds http fallback to the drpc endpoint.
func (*Server) Addr ¶
func (p *Server) Addr() net.Addr
Addr returns the server's public listener address.
func (*Server) DRPC ¶
func (p *Server) DRPC() drpc.Mux
DRPC returns the server's DRPC mux that supports all endpoints for registration purposes.
func (*Server) DebounceLimit ¶ added in v1.76.1
func (p *Server) DebounceLimit() int
DebounceLimit is the amount of times the server is able to debounce incoming noise or TLS messages, per message.
func (*Server) FastOpen ¶ added in v1.81.2
func (p *Server) FastOpen() bool
FastOpen returns true if FastOpen is possibly open. false means we know FastOpen is off.
func (*Server) Identity ¶
func (p *Server) Identity() *identity.FullIdentity
Identity returns the server's identity.
func (*Server) IsQUICEnabled ¶ added in v1.47.3
func (p *Server) IsQUICEnabled() bool
IsQUICEnabled checks if QUIC is enabled by config and udp port is open.
func (*Server) NoiseKeyAttestation ¶ added in v1.72.2
func (p *Server) NoiseKeyAttestation(ctx context.Context) (_ *pb.NoiseKeyAttestation, err error)
NoiseKeyAttestation returns the noise key attestation for this server.
func (*Server) PrivateAddr ¶
func (p *Server) PrivateAddr() net.Addr
PrivateAddr returns the server's private listener address.
func (*Server) PrivateDRPC ¶
func (p *Server) PrivateDRPC() drpc.Mux
PrivateDRPC returns the server's DRPC mux for registration purposes.
func (*Server) ReplaySafeDRPC ¶ added in v1.73.4
func (p *Server) ReplaySafeDRPC() drpc.Mux
ReplaySafeDRPC returns the server's DRPC mux that supports replay safe endpoints for registration purposes.