zrpc

package module
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

README

zrpc

倍通内部rpc框架,基于gRPC

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Block

func Block() grpc.DialOption

func Insecure

func Insecure() grpc.DialOption

func MustNewClientConn added in v0.1.3

func MustNewClientConn(rpcClient rpc.Client, serverName string, opts ...COption) *grpc.ClientConn

MustNewClientConn 新建一个 Client 实例

Types

type COption

type COption func(*clientOption)

func WithClientInterceptor added in v0.1.3

func WithClientInterceptor(clientInterceptor ...grpc.UnaryClientInterceptor) COption

func WithDialOption

func WithDialOption(opts ...grpc.DialOption) COption

type Client

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

type RegisterServer

type RegisterServer func(server *grpc.Server)

type SOption

type SOption func(*serverOption)

func WithServerInterceptor added in v0.1.3

func WithServerInterceptor(serverInterceptor ...grpc.UnaryServerInterceptor) SOption

WithServerInterceptor 生成服务端拦截器

func WithServerOption

func WithServerOption(opts ...grpc.ServerOption) SOption

WithServerOption 通过 grpc.ServerOption 生成 SOption

type Server

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

func MustNewServer

func MustNewServer(ctx context.Context, server rpc.Server, registerServer RegisterServer, serverOptions ...SOption) *Server

func (*Server) Serve

func (s *Server) Serve() error

Serve 启动服务

func (*Server) StopServe

func (s *Server) StopServe()

StopServe 停止服务

Jump to

Keyboard shortcuts

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