server

package
v1.41.0-rc Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Error is a pkg/server error.
	Error = errs.Class("server")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	tlsopts.Config
	Address        string `user:"true" help:"public address to listen on" default:":7777"`
	PrivateAddress string `user:"true" help:"private address to listen on" default:"127.0.0.1:7778"`
	DisableQUIC    bool   `help:"disable QUIC listener on a server" hidden:"true" default:"false"`

	DisableTCPTLS   bool `help:"disable TCP/TLS listener on a server" internal:"true"`
	DebugLogTraffic bool `hidden:"true" default:"false"` // Deprecated
}

Config holds server specific configuration parameters.

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) Addr

func (p *Server) Addr() net.Addr

Addr returns the server's public listener address.

func (*Server) Close

func (p *Server) Close() error

Close shuts down the server.

func (*Server) DRPC

func (p *Server) DRPC() *drpcmux.Mux

DRPC returns the server's dRPC mux for registration purposes.

func (*Server) Identity

func (p *Server) Identity() *identity.FullIdentity

Identity returns the server's identity.

func (*Server) PrivateAddr

func (p *Server) PrivateAddr() net.Addr

PrivateAddr returns the server's private listener address.

func (*Server) PrivateDRPC

func (p *Server) PrivateDRPC() *drpcmux.Mux

PrivateDRPC returns the server's dRPC mux for registration purposes.

func (*Server) Run

func (p *Server) Run(ctx context.Context) (err error)

Run will run the server and all of its services.

Jump to

Keyboard shortcuts

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