Documentation ¶
Index ¶
Constants ¶
View Source
const ( // CachedResults controls the amount of results cached per room that is sent upon reconnect CachedResults = 10 // RoomIdleTime determines when a room is being closed once all members left RoomIdleTime = 60 * time.Second )
View Source
const ( // AddRollerErrorRoomNonExistent will be thrown if the room where we tried to add ourselves is non existent AddRollerErrorRoomNonExistent = iota )
Variables ¶
View Source
var ( // RoomsGauge keeps track of all the active rooms RoomsGauge = prometheus.NewGauge(prometheus.GaugeOpts{ Name: "wuerfler_rooms", Help: "Active rooms", }) )
Functions ¶
This section is empty.
Types ¶
type AddRollerError ¶
type AddRollerError struct { Type int // contains filtered or unexported fields }
AddRollerError is an error thrown when trying to add rollers to a room
func NewAddRollerError ¶
func NewAddRollerError(t int) *AddRollerError
NewAddRollerError creates a new AddRollerError
func (*AddRollerError) Error ¶
func (e *AddRollerError) Error() string
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages rooms
func (*Manager) CreateRoom ¶
CreateRoom creates a new room and returns the new name
type ProfileUpdateRequest ¶
ProfileUpdateRequest is the input data when somebody tries to change their name
type RollRequest ¶
RollRequest is the request to roll some dices
type RollResult ¶
RollResult is the result of one dice
type RollResults ¶
type RollResults struct { Name string `json:"name"` Date time.Time `json:"date"` Results []RollResult `json:"results"` }
RollResults is the result of several dices of a roller
type Roller ¶
type Roller struct { Name string RollRequestChan chan []uint8 ProfileUpdate chan string RollResultsChan chan RollResults UsersUpdate chan UsersUpdateInfo RemoveSelf chan struct{} }
Roller is our User object
type Room ¶
type Room struct {
// contains filtered or unexported fields
}
Room holds everything room related
type UsersUpdateInfo ¶
UsersUpdateInfo will be sent whenevert something changed regarding to usernames or so on the backend (join, leave, name change)
Click to show internal directories.
Click to hide internal directories.