grpcx

package
v0.0.0-...-76e4cca Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTransportFromGrpcClient

func GetTransportFromGrpcClient(ctx context.Context, method string, cc *grpc.ClientConn, header header.IHeader) transport.ITransport

func NewWrappedStream

func NewWrappedStream(ctx context.Context, stream grpc.ServerStream) grpc.ServerStream

func NewXDSConn

func NewXDSConn(dsn string) (*grpc.ClientConn, error)

NewXDSConn new a connection of xDs Note: call `conn.Close()` when the server exits

Types

type Server

type Server struct {
	*xds.GRPCServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(registerFunc func(s grpc.ServiceRegistrar), opts ...ServerOption) *Server

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

type ServerOption

type ServerOption func(o *Server)

ServerOption is gRPC server option.

func Address

func Address(addr string) ServerOption

Address with server address.

func Credentials

Credentials with server credentials.

func Debug

func Debug() ServerOption

func EnableHealth

func EnableHealth() ServerOption

EnableHealth Checks server.

func Name

func Name(name string) ServerOption

Name with server name.

func Network

func Network(network string) ServerOption

Network with server network.

func Options

func Options(opts ...grpc.ServerOption) ServerOption

Options with grpc options.

func StreamInterceptor

func StreamInterceptor(in ...grpc.StreamServerInterceptor) ServerOption

StreamInterceptor returns a ServerOption that sets the StreamServerInterceptor for the server.

func TLSConfig

func TLSConfig(c *tls.Config) ServerOption

TLSConfig with TLS config.

func UnaryInterceptor

func UnaryInterceptor(in ...grpc.UnaryServerInterceptor) ServerOption

UnaryInterceptor returns a ServerOption that sets the UnaryServerInterceptor for the server.

type Transport

type Transport struct {
	transport.BaseTransport
}

func (*Transport) GetKind

func (tr *Transport) GetKind() transport.Kind

Jump to

Keyboard shortcuts

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