services

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: MIT Imports: 10 Imported by: 0

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) RemoteFunc

func (c *ConnectorRemote) RemoteFunc(ctx context.Context, message []byte) (*protos.Response, error)

RemoteFunc is a function that will be called remotelly

type Room

type Room struct {
	component.Base

	Stats *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) (*protos.Response, 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.Response, 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) SendRPC

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

SendRPC sends rpc

type SessionData

type SessionData struct {
	Data map[string]interface{} `json:"data"`
}

SessionData is the session data struct

type Stats

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

Stats exports the room status

func (*Stats) Inbound

func (Stats *Stats) Inbound(ctx context.Context, in []byte) ([]byte, error)

Inbound gets the inbound status

func (*Stats) Outbound

func (Stats *Stats) Outbound(ctx context.Context, in []byte) ([]byte, error)

Outbound gets the outbound status

Jump to

Keyboard shortcuts

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