backend

package
v0.0.0-...-09cdc91 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const TIMEOUT = 300 * time.Second

TIMEOUT ...

Variables

This section is empty.

Functions

func Setup

func Setup(ctx context.Context, prefix string) http.Handler

Setup ...

Types

type Member

type Member struct {
	UUID     uuid.UUID
	Nickname string
	// contains filtered or unexported fields
}

Member ...

func NewMember

func NewMember(ctx context.Context, parent *Room, member *models.Member, conn *websocket.Conn) *Member

NewMember ...

func (*Member) Close

func (m *Member) Close()

Close ...

func (*Member) Write

func (m *Member) Write(tp string, obj interface{}) error

Write ...

type Room

type Room struct {
	UUID uuid.UUID
	// contains filtered or unexported fields
}

Room ...

func GetRoom

func GetRoom(uid string) *Room

GetRoom ...

func NewRoom

func NewRoom(ctx context.Context, room *models.Room) *Room

NewRoom ...

func (*Room) Close

func (r *Room) Close()

Close ...

func (*Room) GetMembers

func (r *Room) GetMembers() []*models.Member

GetMembers ...

func (*Room) Join

func (r *Room) Join(member *Member)

Join ...

func (*Room) Leave

func (r *Room) Leave(u uuid.UUID)

Leave ...

func (*Room) Publish

func (r *Room) Publish(msg *models.Message)

Publish ...

Jump to

Keyboard shortcuts

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