rpc

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientDetectionRequestHandler

type ClientDetectionRequestHandler struct {
}

func (*ClientDetectionRequestHandler) Name

func (*ClientDetectionRequestHandler) RequestReply

type ConnectResetRequestHandler

type ConnectResetRequestHandler struct {
}

func (*ConnectResetRequestHandler) Name

func (*ConnectResetRequestHandler) RequestReply

type Connection

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

type ConnectionEvent

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

type ConnectionStatus

type ConnectionStatus uint32
const (
	DISCONNECTED ConnectionStatus = iota
	CONNECTED
)

type ConnectionType

type ConnectionType uint32
const (
	GRPC ConnectionType = iota
)

type GrpcClient

type GrpcClient struct {
	*RpcClient
}

func NewGrpcClient

func NewGrpcClient(clientName string, nacosServer *nacos_server2.NacosServer) *GrpcClient

type GrpcConnection

type GrpcConnection struct {
	*Connection
	// contains filtered or unexported fields
}

func NewGrpcConnection

func NewGrpcConnection(serverInfo ServerInfo, connectionId string, conn *grpc.ClientConn,
	client grpc2.RequestClient, biStreamClient grpc2.BiRequestStream_RequestBiStreamClient) *GrpcConnection

type IConnection

type IConnection interface {
	// contains filtered or unexported methods
}

type IConnectionEventListener

type IConnectionEventListener interface {

	//notify when  connected to server.
	OnConnected()

	//notify when  disconnected to server.
	OnDisConnect()
}

type IRpcClient

type IRpcClient interface {
	GetRpcClient() *RpcClient
	// contains filtered or unexported methods
}

func CreateClient

func CreateClient(clientName string, connectionType ConnectionType, labels map[string]string, nacosServer *nacos_server2.NacosServer) (IRpcClient, error)

type IServerRequestHandler

type IServerRequestHandler interface {
	Name() string
	//RequestReply Handle request from server.
	RequestReply(request rpc_request2.IRequest, rpcClient *RpcClient) rpc_response2.IResponse
}

IServerRequestHandler to process the request from server side.

type NamingPushRequestHandler

type NamingPushRequestHandler struct {
	ServiceInfoHolder *naming_cache2.ServiceInfoHolder
}

func (*NamingPushRequestHandler) Name

func (*NamingPushRequestHandler) RequestReply

func (c *NamingPushRequestHandler) RequestReply(request rpc_request2.IRequest, rpcClient *RpcClient) rpc_response2.IResponse

type ReconnectContext

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

type RpcClient

type RpcClient struct {
	Name string

	Tenant string
	// contains filtered or unexported fields
}

func (*RpcClient) GetRpcClient

func (r *RpcClient) GetRpcClient() *RpcClient

func (*RpcClient) IsInitialized

func (r *RpcClient) IsInitialized() bool

func (*RpcClient) IsRunning

func (r *RpcClient) IsRunning() bool

IsRunning check is this client is running.

func (*RpcClient) RegisterConnectionListener

func (r *RpcClient) RegisterConnectionListener(listener IConnectionEventListener)

func (*RpcClient) RegisterServerRequestHandler

func (r *RpcClient) RegisterServerRequestHandler(request func() rpc_request2.IRequest, handler IServerRequestHandler)

func (*RpcClient) Request

func (r *RpcClient) Request(request rpc_request2.IRequest, timeoutMills int64) (rpc_response2.IResponse, error)

func (*RpcClient) Shutdown

func (r *RpcClient) Shutdown()

func (*RpcClient) Start

func (r *RpcClient) Start()

type RpcClientStatus

type RpcClientStatus int32
const (
	INITIALIZED RpcClientStatus = iota
	STARTING
	UNHEALTHY
	RUNNING
	SHUTDOWN
)

type ServerInfo

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

type ServerRequestHandlerMapping

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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