lobby

package
v0.0.0-...-52b7346 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

type ID uuid.UUID

func IDFromString

func IDFromString(s string) (ID, error)

type Lobby

type Lobby struct {
	ID      ID
	Members map[int64]struct{}
	// contains filtered or unexported fields
}

func (*Lobby) Join

func (l *Lobby) Join(userId int64) error

func (*Lobby) Leave

func (l *Lobby) Leave(userId int64) error

type Manager

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

func NewManager

func NewManager(store *Store) *Manager

func (*Manager) CreateLobby

func (m *Manager) CreateLobby() (*Lobby, error)

func (*Manager) DeleteLobby

func (m *Manager) DeleteLobby(id ID) error

func (*Manager) GetLobby

func (m *Manager) GetLobby(id ID) (*Lobby, error)

type Store

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

func NewStore

func NewStore(client *mongo.Client) *Store

func (*Store) Delete

func (s *Store) Delete(id ID) error

func (*Store) Find

func (s *Store) Find(id ID) (*Lobby, error)

func (*Store) Insert

func (s *Store) Insert(lobby *Lobby) error

func (*Store) Update

func (s *Store) Update(lobby *Lobby) error

Jump to

Keyboard shortcuts

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