Documentation
¶
Index ¶
- type Client
- func (cl *Client) Block(name string) *Response
- func (cl *Client) BlockList() *Response
- func (cl *Client) Equals(other room.Client) bool
- func (cl *Client) Execute(command []string) connections.Response
- func (cl *Client) Friend(name string) *Response
- func (cl *Client) FriendList() *Response
- func (cl *Client) IsBlocked(other string) bool
- func (cl *Client) Join(rmName string) *Response
- func (cl *Client) Leave() *Response
- func (cl *Client) LeaveRoom()
- func (cl *Client) List() *Response
- func (cl *Client) Name() string
- func (cl *Client) Quit() *Response
- func (cl *Client) Recieve(m message.Message)
- func (cl *Client) Send(m string) *Response
- func (cl *Client) SetConnection(conn connections.Connection)
- func (cl *Client) Tell(name, m string) *Response
- func (cl *Client) Unblock(name string) *Response
- func (cl *Client) Unfriend(name string) *Response
- func (cl *Client) Who(rmName string) *Response
- type Factory
- type Friend
- type Response
- type WhoData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is used to represent the client in rooms and do server actions.
func New ¶
func New(name string, roomlist *room.RoomList, chatlog io.Writer, data clientdata.ClientData, connection connections.Connection) *Client
New returns a new client.
func (*Client) Execute ¶
func (cl *Client) Execute(command []string) connections.Response
Execute parses and then runs commands from the client connection.
func (*Client) FriendList ¶
FriendList gives a list of people on the clients friendlist and the room they are in or when they were last logged in.
func (*Client) Leave ¶
Leave is the client action to leave a room. Moves the client back to the Lobby room.
func (*Client) LeaveRoom ¶
func (cl *Client) LeaveRoom()
LeaveRoom removes the client from its room. It is used for logging out.
func (*Client) SetConnection ¶
func (cl *Client) SetConnection(conn connections.Connection)
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
func NewFactory ¶
func (*Factory) New ¶
func (f *Factory) New(name string, connection connections.Connection) connections.Client
type Friend ¶
Friend represents a person on your friends list. room will instead be the last online string if they are not online now.
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response is used to reply to commands from the clients connection.
func NewResponse ¶
NewResponse returns a new response.