grpcserver

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address                  string
	PingIntervalInSec        int
	PingResponseTimeoutInSec int
}

Config holds grpc server config

type GrpcServer

type GrpcServer struct {
	Server *grpc.Server
	// contains filtered or unexported fields
}

GrpcServer holds grpc server

func NewGrpc

func NewGrpc(config Config) *GrpcServer

NewGrpc returns a GrpcServer

func (*GrpcServer) InitGRPCServer

func (s *GrpcServer) InitGRPCServer(
	ctx context.Context,
	registerGrpcHandlers registerGrpcHandlers) error

InitGRPCServer with handlers and interceptors

func (*GrpcServer) Run

func (s *GrpcServer) Run(ctx context.Context) error

Run the grpc server

func (*GrpcServer) WithStreamInterceptors

func (s *GrpcServer) WithStreamInterceptors(streamInterceptors ...grpc.StreamServerInterceptor) *GrpcServer

WithStreamInterceptors sets stream interceptors

func (*GrpcServer) WithUnaryInterceptors

func (s *GrpcServer) WithUnaryInterceptors(unaryInterceptors ...grpc.UnaryServerInterceptor) *GrpcServer

WithUnaryInterceptors sets unary interceptors

Jump to

Keyboard shortcuts

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