rpc

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: GPL-3.0 Imports: 11 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallClient

func CallClient(c context.Context, clientID string, event pb.Event, msg proto.Message) (*pb.ClientMessage, error)

func GetClientCert

func GetClientCert(clientID, clientSecret string, clientType pb.ClientType) []byte

func InitRPCClients

func InitRPCClients()

func MasterCli

func MasterCli(c context.Context) (pb.MasterClient, error)

func MustInitClientsManager

func MustInitClientsManager()

func Recv

func Recv(clientID string) chan bool

Types

type ClientsManager

type ClientsManager interface {
	Get(cliID string) *Connector
	Set(cliID, clientType string, sender pb.Master_ServerSendServer)
	Remove(cliID string)
}

func GetClientsManager

func GetClientsManager() ClientsManager

type ClientsManagerImpl

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

func NewClientsManager

func NewClientsManager() *ClientsManagerImpl

func (*ClientsManagerImpl) Get

func (c *ClientsManagerImpl) Get(cliID string) *Connector

Get implements ClientsManager.

func (*ClientsManagerImpl) Remove

func (c *ClientsManagerImpl) Remove(cliID string)

func (*ClientsManagerImpl) Set

func (c *ClientsManagerImpl) Set(cliID, clientType string, sender pb.Master_ServerSendServer)

Set implements ClientsManager.

type Connector

type Connector struct {
	CliID   string
	Conn    pb.Master_ServerSendServer
	CliType string
}

Jump to

Keyboard shortcuts

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