services

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector struct {
	component.Base
}

Connector struct

type ConnectorRemote

type ConnectorRemote struct {
	component.Base
}

ConnectorRemote is a remote that will receive rpc's

func (*ConnectorRemote) Descriptor added in v1.1.9

func (*ConnectorRemote) Docs added in v0.7.6

Docs returns documentation

func (*ConnectorRemote) RemoteFunc

func (c *ConnectorRemote) RemoteFunc(ctx context.Context, msg *protos.RPCMsg) (*protos.RPCRes, error)

RemoteFunc is a function that will be called remotely

type Room

type Room struct {
	component.Base

	Stats *protos.Stats
	// contains filtered or unexported fields
}

Room represents a component that contains a bundle of room related handler like Join/Message

func NewRoom

func NewRoom() *Room

NewRoom returns a new room

func (*Room) AfterInit

func (r *Room) AfterInit()

AfterInit component lifetime callback

func (*Room) Entry

func (r *Room) Entry(ctx context.Context, msg []byte) (*protos.JoinResponse, error)

Entry is the entrypoint

func (*Room) Init

func (r *Room) Init()

Init runs on service initialization

func (*Room) Join

func (r *Room) Join(ctx context.Context) (*protos.JoinResponse, error)

Join room

func (*Room) Message

func (r *Room) Message(ctx context.Context, msg *protos.UserMessage)

Message sync last message to all members

func (*Room) MessageRemote

func (r *Room) MessageRemote(ctx context.Context, msg *protos.UserMessage, b bool, s string) (*protos.UserMessage, error)

MessageRemote just echoes the given message

func (*Room) SendRPC

func (r *Room) SendRPC(ctx context.Context, msg *protos.SendRPCMsg) (*protos.RPCRes, error)

SendRPC sends rpc

Jump to

Keyboard shortcuts

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