rpcx

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallByName

func CallByName(serviceName string, rpcFn RpcFn) errcode.IErr

func InitClient

func InitClient(ctx contextx.Context, d registry.Discovery, opfs ...func(cfctx Config))

Types

type Config

type Config interface {
	SetCallTimeout(callTimeout time.Duration)
}

type Option

type Option struct {
	ID           string
	Name         string
	Ip           string
	Port         int // 端口最大值:65535
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
	CloseTimeout time.Duration
	Registrar    registry.Registrar // 服务注册接口
	Endpoint     string
}

type RpcFn

type RpcFn func(cc *grpc.ClientConn)

type Server

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

func NewServer

func NewServer(ctx contextx.Context, opfs ...func(opt *Option)) *Server

func (*Server) RegistryService

func (s *Server) RegistryService(registryFunc func(svr *grpc.Server))

Jump to

Keyboard shortcuts

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