rpcclient

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: GPL-3.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustInitClientRPCSerivce

func MustInitClientRPCSerivce(
	clientID,
	clientSecret string,
	event pb.Event,
	handerFunc func(req *pb.ServerMessage) *pb.ClientMessage,
)

func NewMasterCli

func NewMasterCli() (pb.MasterClient, error)

func RegistClientToMaster

func RegistClientToMaster(recvStream pb.Master_ServerSendClient, event pb.Event, clientID, clientSecret string)

func RunRPCClient

func RunRPCClient(recvStream pb.Master_ServerSendClient, done chan bool, clientID string,
	clientHandleServerSend func(req *pb.ServerMessage) *pb.ClientMessage)

func StartRPCClient

func StartRPCClient(client pb.MasterClient, done chan bool, clientID, clientSecret string, event pb.Event,
	clientHandleServerSend func(req *pb.ServerMessage) *pb.ClientMessage)

Types

type ClientRPC

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

func NewClientRPCHandler

func NewClientRPCHandler(
	clientID,
	clientSecret string,
	event pb.Event,
	handerFunc func(req *pb.ServerMessage) *pb.ClientMessage,
) *ClientRPC

func (*ClientRPC) GetCli

func (s *ClientRPC) GetCli() pb.MasterClient

func (*ClientRPC) Run

func (s *ClientRPC) Run()

func (*ClientRPC) Stop

func (s *ClientRPC) Stop()

type ClientRPCHandler

type ClientRPCHandler interface {
	Run()
	Stop()
	GetCli() pb.MasterClient
}

func GetClientRPCSerivce

func GetClientRPCSerivce() ClientRPCHandler

Jump to

Keyboard shortcuts

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