Documentation ¶
Index ¶
- Variables
- func GenerateRandomBytes(n int) []byte
- type Config
- type Server
- func (s *Server) AcceptConnection(acceptStream grpcapi.RemoteHost_AcceptConnectionServer) error
- func (s *Server) Connect(grpcConnnection grpcapi.RemoteHost_ConnectServer) error
- func (s *Server) Listen(address *grpcapi.ServiceAddress, listenServer grpcapi.RemoteHost_ListenServer) error
- func (s *Server) SetServices(services map[string]ServiceConfig)
- func (s *Server) Start(l net.Listener)
- func (s *Server) Stop()
- type ServiceConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var BadProtocolExpectingAddress = errors.New("bad protocol: expecting address")
View Source
var InvalidToken = errors.New("invalid token")
View Source
var NotAcceptingConnections = errors.New("not accepting connections")
View Source
var ServerShuttingDown = errors.New("server is shutting down")
Functions ¶
func GenerateRandomBytes ¶
Types ¶
type Config ¶
type Config struct { Services map[string]ServiceConfig grpcapi.TLSConfig Log *log.Logger AcceptTimeout time.Duration EnableOpenTracing bool EnablePrometheus bool OnAuthFunc grpc_auth.AuthFunc OnListenFunc func(ctx context.Context, service string) (string, func(), error) OnConnectFunc func(ctx context.Context, service string) (string, func(), error) }
type Server ¶
type Server struct { *grpc.Server OnListenFunc func(ctx context.Context, service string) (string, func(), error) OnConnectFunc func(ctx context.Context, service string) (string, func(), error) // contains filtered or unexported fields }
func (*Server) AcceptConnection ¶
func (s *Server) AcceptConnection(acceptStream grpcapi.RemoteHost_AcceptConnectionServer) error
func (*Server) Connect ¶
func (s *Server) Connect(grpcConnnection grpcapi.RemoteHost_ConnectServer) error
func (*Server) Listen ¶
func (s *Server) Listen(address *grpcapi.ServiceAddress, listenServer grpcapi.RemoteHost_ListenServer) error
func (*Server) SetServices ¶
func (s *Server) SetServices(services map[string]ServiceConfig)
type ServiceConfig ¶
Click to show internal directories.
Click to hide internal directories.