grpc_run

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Conn *grpc.ClientConn
)
View Source
var OutTime time.Duration
View Source
var ServiceHostList map[string]string

Functions

func ClientRegister

func ClientRegister(serviceName string, fn ClientFn) error

func ServiceLocalList

func ServiceLocalList() error

*@Author Administrator *@Date 23/4/2021 13:31 *@desc 获取当前本地注册服务列表

func ServiceRedisList

func ServiceRedisList() error

*@Author Administrator *@Date 23/4/2021 13:40 *@desc

func ServiceRegister

func ServiceRegister(serviceName string, fn ServiceFn) (err error)

Types

type ClientFn

type ClientFn func(conn *grpc.ClientConn, ctx context.Context) (err error)

type GrpcHelper

type GrpcHelper struct {
	Conn *grpc.ClientConn
	// contains filtered or unexported fields
}

func (*GrpcHelper) ClientRegister

func (h *GrpcHelper) ClientRegister(host, port string, fn ClientFn) error

func (GrpcHelper) NewGrpcHelper

func (GrpcHelper) NewGrpcHelper() GrpcHelperInterface

func (*GrpcHelper) ServiceRegister

func (h *GrpcHelper) ServiceRegister(host, port string, fn ServiceFn) (err error)

type GrpcHelperInterface

type GrpcHelperInterface interface {
	ServiceRegister(host, port string, fn ServiceFn) (err error)
	ClientRegister(host, port string, fn ClientFn) error
}

type GrpcOprion

type GrpcOprion struct {
}

type ServiceFn

type ServiceFn func(server *grpc.Server)

Jump to

Keyboard shortcuts

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