server

package
v0.0.0-...-29ec7e5 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2017 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*options)

Option fills the option struct to configure TLS keys etc.

func Port

func Port(p uint16) Option

Port assigns the server port listening for connections.

func StealthMode

func StealthMode() Option

StealthMode sets the gRPC in a mode to authenticate only known devices. This means that modules like pairing will fail as a new client cannot succeed in the TLS handshake. No interceptor will be triggered if TLS fails.

func TLSKeyFile

func TLSKeyFile(certFile, keyFile string) Option

TLSKeyFile defines the server's TLS certificate used to authenticate against a client. It also sets the pub key's common name as default one for the server's name.

type Server

type Server struct {
	authentication.Auth
	Interceptor *srpc.RoutedInterceptor
	// contains filtered or unexported fields
}

func NewServer

func NewServer(opts ...Option) Server

func (*Server) Build

func (s *Server) Build() (*grpc.Server, error)

func (*Server) CommonName

func (s *Server) CommonName() string

func (*Server) RegisterModules

func (s *Server) RegisterModules(mods ...srpc.ServerModule) error

func (*Server) Serve

func (s *Server) Serve() error

Serve starts listening for incoming connections and serves the requests through the RPC backend (gRPC).

func (*Server) ShuttingDown

func (s *Server) ShuttingDown() <-chan struct{}

ShuttingDown exposes the shutdown context to higher-level services if a termination signal was received. XXX: make thread-safe.

func (*Server) TearDown

func (s *Server) TearDown()

Jump to

Keyboard shortcuts

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