Documentation ¶
Index ¶
- Variables
- func NewClientList() *clientList
- type Client
- type Room
- func (rm *Room) Add(cl Client)
- func (rm *Room) Equals(other Client) bool
- func (rm *Room) GetClient(name string) Client
- func (rm Room) GetMessages() []string
- func (rm *Room) IsEmpty() bool
- func (rm *Room) Name() string
- func (rm Room) NumberOfClients() int
- func (rm *Room) Present(name string) bool
- func (rm *Room) Recieve(m message.Message)
- func (rm *Room) Remove(cl Client) bool
- func (rm *Room) Send(m message.Message)
- func (rm Room) Tell(s string)
- func (rm *Room) Who() []string
- type RoomList
- func (rml *RoomList) Add(cl Client) error
- func (rml *RoomList) Close()
- func (rml *RoomList) CloseEmpty()
- func (rml *RoomList) FindClientRoom(name string) string
- func (rml *RoomList) FindRoom(name string) *Room
- func (rml *RoomList) GetClient(name string) Client
- func (c RoomList) Present(name string) bool
- func (c RoomList) Rem(cl Client) bool
- func (c RoomList) Who() []string
Constants ¶
This section is empty.
Variables ¶
View Source
var ERR_MAX_ROOMS = errors.New("Can't create room. There are already the maximum number of rooms.")
View Source
var ERR_ROOM_EXISTS = errors.New("A room with that name already exits.")
Functions ¶
func NewClientList ¶
func NewClientList() *clientList
NewClientList returns a pointer to an empty clientList.
Types ¶
type Room ¶
type Room struct {
// contains filtered or unexported fields
}
Room is a room name and a linked list of clients in the room.
func (Room) GetMessages ¶
GetMessages gets the messages from the room message list and returns them as a []string.
func (Room) NumberOfClients ¶
func (*Room) Recieve ¶
Recieve passes messages the room recieves to all clients in the room's client list.
type RoomList ¶
type RoomList struct {
// contains filtered or unexported fields
}
RoomList is a linked list of rooms with a mutex.
func (*RoomList) FindClientRoom ¶
FindClientRoom returns the name of a room that a client with name is in.
Click to show internal directories.
Click to hide internal directories.