Documentation ¶
Overview ¶
Package murcott is a decentralized instant messaging framework.
Index ¶
- type Client
- func (c *Client) Close()
- func (c *Client) HandleMessages(handler func(src utils.NodeID, msg client.ChatMessage))
- func (c *Client) HandleStatuses(handler func(src utils.NodeID, status client.UserStatus))
- func (c *Client) ID() utils.NodeID
- func (c *Client) MarshalCache() (data []byte, err error)
- func (c *Client) Nodes() int
- func (c *Client) Profile() client.UserProfile
- func (c *Client) RequestProfile(dst utils.NodeID, f func(profile *client.UserProfile))
- func (c *Client) Run()
- func (c *Client) SendMessage(dst utils.NodeID, msg client.ChatMessage)
- func (c *Client) SetProfile(profile client.UserProfile)
- func (c *Client) SetStatus(status client.UserStatus)
- func (c *Client) Status() client.UserStatus
- func (c *Client) UnmarshalCache(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Roster *client.Roster Logger *log.Logger // contains filtered or unexported fields }
func (*Client) HandleMessages ¶
func (c *Client) HandleMessages(handler func(src utils.NodeID, msg client.ChatMessage))
HandleMessages registers the given function as a massage handler.
func (*Client) HandleStatuses ¶
func (c *Client) HandleStatuses(handler func(src utils.NodeID, status client.UserStatus))
HandleStatuses registers the given function as a status handler.
func (*Client) MarshalCache ¶
func (*Client) Profile ¶
func (c *Client) Profile() client.UserProfile
func (*Client) RequestProfile ¶
func (c *Client) RequestProfile(dst utils.NodeID, f func(profile *client.UserProfile))
Requests a user profile to the destination node. If no response is received from the node, RequestProfile tries to load a profile from the cache.
func (*Client) SendMessage ¶
func (c *Client) SendMessage(dst utils.NodeID, msg client.ChatMessage)
Sends the given message to the destination node.
func (*Client) SetProfile ¶
func (c *Client) SetProfile(profile client.UserProfile)
func (*Client) SetStatus ¶
func (c *Client) SetStatus(status client.UserStatus)
func (*Client) Status ¶
func (c *Client) Status() client.UserStatus
func (*Client) UnmarshalCache ¶
Click to show internal directories.
Click to hide internal directories.