grpc

package
v0.0.0-...-a6d44c8 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientStreamInterceptor

func ClientStreamInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)

func ClientUnaryInterceptor

func ClientUnaryInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error

Types

type Server

type Server struct {
	*grpc.Server

	Logger *logrus.Entry
	// contains filtered or unexported fields
}

func NewServer

func NewServer(app string, opts ...ServerOption) *Server

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

Stop stop the gRPC server.

type ServerOption

type ServerOption func(o *Server)

func Address

func Address(addr string) ServerOption

Address with server address.

func GrpcDefaultUnaryServerInterceptor

func GrpcDefaultUnaryServerInterceptor() ServerOption

func GrpcOpts

func GrpcOpts(opts ...grpc.ServerOption) ServerOption

func GrpcStreamServerInterceptor

func GrpcStreamServerInterceptor(interceptors ...grpc.StreamServerInterceptor) ServerOption

func GrpcUnaryServerInterceptor

func GrpcUnaryServerInterceptor(interceptors ...grpc.UnaryServerInterceptor) ServerOption

func HealthCheck

func HealthCheck() ServerOption

func Logger

func Logger(logger *logrus.Entry) ServerOption

func Network

func Network(network string) ServerOption

Network with server network.

func Prometheus

func Prometheus(enableHandlingTimeHistogram bool, prometheusAddr string) ServerOption

func Reflection

func Reflection() ServerOption

func Timeout

func Timeout(timeout time.Duration) ServerOption

Timeout with server timeout.

Jump to

Keyboard shortcuts

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