server

package
v0.0.0-...-e1c0fc4 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2018 License: MIT Imports: 16 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextTimeout

func ContextTimeout(ctx context.Context)

ContextTimeout ... TODO: refactor

func RecoveryInterceptor

func RecoveryInterceptor(p interface{}) error

RecoveryInterceptor intercepts panic signals and tries to recover.

func TimeoutInterceptor

func TimeoutInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

TimeoutInterceptor cancels a request if it does not complete within 'requestTimeout' seconds.

func UnaryInterceptor

func UnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

UnaryInterceptor ... TODO: example of UnaryInterceptor, use it for auth

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server ...

func NewServer

func NewServer(conf config.Service) *Server

NewServer creates a new gRPC server.

func (*Server) GetgRPCServer

func (srv *Server) GetgRPCServer() *grpc.Server

GetgRPCServer ...

func (*Server) HandleSig

func (srv *Server) HandleSig(sig string)

HandleSig ...

func (*Server) Listen

func (srv *Server) Listen()

Listen starts listening on a port.

func (*Server) StartPrometheus

func (srv *Server) StartPrometheus()

StartPrometheus ...

Jump to

Keyboard shortcuts

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