Documentation ¶
Index ¶
- Variables
- func CombineInterceptors(a, b grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor
- func StreamMessageLoggingInterceptor(log *zap.Logger) grpc.StreamServerInterceptor
- func UnaryMessageLoggingInterceptor(log *zap.Logger) grpc.UnaryServerInterceptor
- type Config
- type Server
- func (p *Server) Addr() net.Addr
- func (p *Server) Close() error
- func (p *Server) DRPC() *drpcserver.Server
- func (p *Server) GRPC() *grpc.Server
- func (p *Server) Identity() *identity.FullIdentity
- func (p *Server) PrivateAddr() net.Addr
- func (p *Server) PrivateDRPC() *drpcserver.Server
- func (p *Server) PrivateGRPC() *grpc.Server
- func (p *Server) Run(ctx context.Context) (err error)
- type Service
Constants ¶
This section is empty.
Variables ¶
var ( // Error is a pkg/server error Error = errs.Class("server error") )
Functions ¶
func CombineInterceptors ¶ added in v0.13.0
func CombineInterceptors(a, b grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor
CombineInterceptors combines two UnaryServerInterceptors so they act as one (because grpc only allows you to pass one in).
func StreamMessageLoggingInterceptor ¶ added in v0.13.0
func StreamMessageLoggingInterceptor(log *zap.Logger) grpc.StreamServerInterceptor
StreamMessageLoggingInterceptor creates a StreamServerInterceptor which logs the full contents of incoming streaming requests.
func UnaryMessageLoggingInterceptor ¶ added in v0.13.0
func UnaryMessageLoggingInterceptor(log *zap.Logger) grpc.UnaryServerInterceptor
UnaryMessageLoggingInterceptor creates a UnaryServerInterceptor which logs the full contents of incoming unary requests.
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"` DebugLogTraffic bool `user:"true" help:"log all GRPC traffic to zap logger" default:"false"` }
Config holds server specific configuration parameters
func (Config) Run ¶
func (sc Config) Run(ctx context.Context, log *zap.Logger, identity *identity.FullIdentity, revDB extensions.RevocationDB, interceptor grpc.UnaryServerInterceptor, services ...Service) (err error)
Run will run the given responsibilities with the configured identity.
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, publicAddr, privateAddr string, interceptor grpc.UnaryServerInterceptor, services ...Service) (*Server, error)
New creates a Server out of an Identity, a net.Listener, a UnaryServerInterceptor, and a set of services.
func (*Server) DRPC ¶ added in v0.21.0
func (p *Server) DRPC() *drpcserver.Server
DRPC returns the server's dRPC handle for registration purposes
func (*Server) Identity ¶
func (p *Server) Identity() *identity.FullIdentity
Identity returns the server's identity
func (*Server) PrivateAddr ¶
PrivateAddr returns the server's private listener address
func (*Server) PrivateDRPC ¶ added in v0.21.0
func (p *Server) PrivateDRPC() *drpcserver.Server
PrivateDRPC returns the server's dRPC handle for registration purposes
func (*Server) PrivateGRPC ¶
PrivateGRPC returns the server's gRPC handle for registration purposes