rpc

package
v0.1.37 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallClient

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

func CallClientWrapper

func CallClientWrapper[R common.RespType](c *app.Context, clientID string, event pb.Event, req proto.Message, resp *R) error

func GetClient

func GetClient(cfg conf.Config, clientID, joinToken string) (*pb.GetClientResponse, error)

func GetClientCert

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

func InitClient

func InitClient(cfg conf.Config, clientID, joinToken string, ephemeral *bool) (*pb.InitClientResponse, error)

func NewClientsManager

func NewClientsManager() app.ClientsManager

func NewMasterCli

func NewMasterCli(appInstance app.Application) *masterClient

func Recv

func Recv(appInstance app.Application, clientID string) chan bool

Types

type ClientsManager

type ClientsManager interface {
	Get(cliID string) *defs.Connector
	Set(cliID, clientType string, sender pb.Master_ServerSendServer)
	Remove(cliID string)
	ClientAddr(cliID string) string
	ConnectTime(cliID string) (time.Time, bool)
}

type ClientsManagerImpl

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

func (*ClientsManagerImpl) ClientAddr

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

func (*ClientsManagerImpl) ConnectTime

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

func (*ClientsManagerImpl) Get

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

Get implements ClientsManager.

func (*ClientsManagerImpl) GetLastSeenAt added in v0.1.25

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

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.

func (*ClientsManagerImpl) UpdateLastSeenAt added in v0.1.25

func (c *ClientsManagerImpl) UpdateLastSeenAt(cliID string)

Jump to

Keyboard shortcuts

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