sbgrpc

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UseHostLogger *zap.SugaredLogger
)

Functions

This section is empty.

Types

type SrvBus

type SrvBus struct {
	sync.Mutex

	pb.UnimplementedSrvBusServer
	// contains filtered or unexported fields
}

EvtServer is a gRPC cover for the es.EventServer.

func New

func New(sb *srvbus.ServiceBus, log *zap.SugaredLogger) (*SrvBus, error)

creates new service bus

func (*SrvBus) GetEventServer

func (sb *SrvBus) GetEventServer(
	ctx context.Context,
	in *pb.ServerRequest) (*pb.ServerResponse, error)

func (*SrvBus) GetMessageServer

func (sb *SrvBus) GetMessageServer(
	ctx context.Context,
	in *pb.ServerRequest) (*pb.ServerResponse, error)

GetMessageServer returns an runned gRPC handler for internal MessageServer.

func (*SrvBus) GetServiceServer

func (sb *SrvBus) GetServiceServer(
	ctx context.Context,
	in *pb.ServerRequest) (*pb.ServerResponse, error)

func (*SrvBus) IsRunned

func (sb *SrvBus) IsRunned() bool

checks if the grpc server is runned

func (*SrvBus) Run

func (sb *SrvBus) Run(
	ctx context.Context,
	host string,
	port int,
	srvPorts [3]int,
	opts ...grpc.ServerOption) error

runs a gRPC server for ServiceBus.

srvPort - is a port numbers for serviceBus gRPC servers

0 -- event server
1 -- message server
2 -- service server

if any port is 0, then default ports will be used [50071, 50072, 50073] accordingly.

Jump to

Keyboard shortcuts

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