rpc

package
v0.0.50 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: GPL-3.0 Imports: 15 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)
	ClientAddr(cliID string) string
	ConnectTime(cliID string) (time.Time, bool)
}

func GetClientsManager

func GetClientsManager() ClientsManager

type ClientsManagerImpl

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

func NewClientsManager

func NewClientsManager() *ClientsManagerImpl

func (*ClientsManagerImpl) ClientAddr added in v0.0.32

func (c *ClientsManagerImpl) ClientAddr(cliID string) string

func (*ClientsManagerImpl) ConnectTime added in v0.0.32

func (c *ClientsManagerImpl) ConnectTime(cliID string) (time.Time, bool)

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