grpc

package
v0.0.0-...-19e0fc1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(ctx context.Context, target string, option ...dialOption) (*grpc.ClientConn, error)

Dial 封装了 grpc.DialContext

func WithDialOptions

func WithDialOptions(opts ...grpc.DialOption) dialOption

grpc dial options

func WithDialTracing

func WithDialTracing(tracing bool) dialOption

tracing

func WithDialWithInsecure

func WithDialWithInsecure(withInsecure bool) dialOption

withInsecure

Types

type Server

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

func NewServer

func NewServer(opts ...ServerOptions) *Server

NewServer

func (*Server) CallBackRegiser

func (s *Server) CallBackRegiser()

func (*Server) Start

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

start

func (*Server) Stop

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

Stop

type ServerOptions

type ServerOptions func(*Server)

定义 ServerOptions func

func WithRegisterFunc

func WithRegisterFunc(serviceRegistrar func(grpc.ServiceRegistrar)) ServerOptions

func WithServerAddress

func WithServerAddress(address string) ServerOptions

func WithServerNetwork

func WithServerNetwork(network string) ServerOptions

func WithTracing

func WithTracing(tracing bool) ServerOptions

Jump to

Keyboard shortcuts

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