memory

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2021 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Room

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

func NewRoom

func NewRoom(ID int32) *Room

func (*Room) GetGameName

func (r *Room) GetGameName() string

func (*Room) GetGameSetting added in v1.2.0

func (r *Room) GetGameSetting() *anypb.Any

func (*Room) GetProvider

func (r *Room) GetProvider() d.Provider

func (*Room) GetRoomID

func (r *Room) GetRoomID() int32

func (*Room) GetState

func (r *Room) GetState() d.RoomState

func (*Room) GetUserState added in v1.1.0

func (r *Room) GetUserState(user d.User) (d.UserState, error)

func (*Room) GetUsers

func (r *Room) GetUsers() []d.User

func (*Room) Lock added in v1.1.0

func (r *Room) Lock()

func (*Room) Restart

func (r *Room) Restart() error

func (*Room) SetGameSetting added in v1.2.0

func (r *Room) SetGameSetting(setting *anypb.Any)

func (*Room) SetProvider

func (r *Room) SetProvider(provider d.Provider)

func (*Room) Unlock added in v1.1.0

func (r *Room) Unlock()

func (*Room) UserExit

func (r *Room) UserExit(user d.User) error

func (*Room) UserJoin

func (r *Room) UserJoin(user d.User) error

func (*Room) UserReady

func (r *Room) UserReady(user d.User, isReady bool) error

type Storage

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

func NewStorage

func NewStorage() *Storage

func (*Storage) CreateRoom

func (s *Storage) CreateRoom() (d.Room, error)

func (*Storage) CreateToken

func (s *Storage) CreateToken(user d.User) (d.Token, error)

func (*Storage) CreateUser

func (s *Storage) CreateUser(userName string, passwd string) error

func (*Storage) DelRoom

func (s *Storage) DelRoom(roomID int32) error

func (*Storage) DelToken

func (s *Storage) DelToken(key string) error

func (*Storage) DelUser

func (s *Storage) DelUser(userName string) error

func (*Storage) FindProvider

func (s *Storage) FindProvider(providerID string) (d.Provider, error)

func (*Storage) FindProviderByGame

func (s *Storage) FindProviderByGame(gameName string) []d.Provider

func (*Storage) FindRoom

func (s *Storage) FindRoom(roomID int32) (d.Room, error)

func (*Storage) FindToken

func (s *Storage) FindToken(key string) (d.Token, error)

func (*Storage) FindUser

func (s *Storage) FindUser(userName string, passwd string) (d.User, error)

func (*Storage) GetProviders

func (s *Storage) GetProviders() []d.Provider

func (*Storage) GetRooms

func (s *Storage) GetRooms() []d.Room

func (*Storage) GetRoomsWithFilter

func (s *Storage) GetRoomsWithFilter(is func(d.Room) bool) []d.Room

func (*Storage) GetUsers

func (s *Storage) GetUsers() []d.User

func (*Storage) IsUserExist added in v1.1.1

func (s *Storage) IsUserExist(userName string) bool

func (*Storage) RegisterProvider

func (s *Storage) RegisterProvider(provider d.Provider) error

func (*Storage) UnRegisterProvider

func (s *Storage) UnRegisterProvider(p d.Provider) error

type Token

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

func (*Token) GetKey

func (t *Token) GetKey() string

func (*Token) GetUser

func (t *Token) GetUser() d.User

func (*Token) GetUserName

func (t *Token) GetUserName() string

type User

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

func NewUser

func NewUser(userName string, passwd string) *User

func (*User) GetConn

func (u *User) GetConn() (interface{}, error)

func (*User) GetDisplayName

func (u *User) GetDisplayName() string

func (*User) GetRoom

func (u *User) GetRoom() (d.Room, error)

func (*User) GetTemporaryID

func (u *User) GetTemporaryID() uint32

func (*User) GetUserName

func (u *User) GetUserName() string

func (*User) Lock added in v1.1.0

func (u *User) Lock()

func (*User) SetConn

func (u *User) SetConn(conn interface{})

func (*User) SetDisplayName

func (u *User) SetDisplayName(displayName string) error

func (*User) SetPasswd

func (u *User) SetPasswd(oldPasswd string, newPasswd string) error

func (*User) SetRoom

func (u *User) SetRoom(room d.Room) error

func (*User) SetTemporaryID

func (u *User) SetTemporaryID(tid uint32)

func (*User) Unlock added in v1.1.0

func (u *User) Unlock()

Jump to

Keyboard shortcuts

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