grpc

package
v0.0.0-...-9eed78a Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is a gRPC server wrapper.

func NewServer

func NewServer(opts ...ServerOption) *Server

NewServer creates a gRPC server with options

func (*Server) Endpoint

func (s *Server) Endpoint() (*url.URL, error)

Endpoint returns a real address to registry endpoint. examples: grpc://127.0.0.1:9000?isSecure=false

func (*Server) OpentracingInterceptor

func (s *Server) OpentracingInterceptor() grpc.UnaryServerInterceptor

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start the gRPC server

func (*Server) Stop

func (s *Server) Stop(context.Context) error

Stop the gRPC server

type ServerOption

type ServerOption func(*Server)

func Address

func Address(address string) ServerOption

func CustomHealth

func CustomHealth() ServerOption

func Debug

func Debug() ServerOption

func Endpoint

func Endpoint(endpoint *url.URL) ServerOption

func Env

func Env(env string) ServerOption

func Listener

func Listener(lis net.Listener) ServerOption

func Network

func Network(network string) ServerOption

func Options

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

func PrintAccessLog

func PrintAccessLog() ServerOption

func ServiceName

func ServiceName(name string) ServerOption

func TLSConfig

func TLSConfig(c *tls.Config) ServerOption

func Timeout

func Timeout(t time.Duration) ServerOption

func TraceFilterNames

func TraceFilterNames(names ...string) ServerOption

func UnaryInterceptors

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

type Transport

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

Transport is a gRPC transport

func (*Transport) Endpoint

func (tr *Transport) Endpoint() string

func (*Transport) Kind

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

func (*Transport) Operation

func (tr *Transport) Operation() string

func (*Transport) ReplyHeader

func (tr *Transport) ReplyHeader() transport.Header

func (*Transport) RequestHeader

func (tr *Transport) RequestHeader() transport.Header

Jump to

Keyboard shortcuts

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