Documentation
¶
Overview ¶
Package clients provides client management functionality for the GoBroke system.
Package clients provides client management functionality for the GoBroke system. It handles client creation, metadata management, and tracking of client activity.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a connected client in the GoBroke system. Each client has a unique identifier, optional metadata, and activity tracking.
func New ¶
func New(opts ...clientOptsFunc) *Client
New creates a new Client instance with the provided options. Options can include custom UUID and metadata configurations.
func (*Client) AddMetadata ¶
AddMetadata associates a key-value pair with the client. This can be used to store custom data related to the client.
func (*Client) GetLastMessage ¶
GetLastMessage returns the timestamp of the client's most recent message.
func (*Client) GetMetadata ¶
GetMetadata retrieves the value associated with the given metadata key. Returns nil if the key doesn't exist.
func (*Client) SetLastMessageNow ¶
func (c *Client) SetLastMessageNow()
SetLastMessageNow updates the client's last message timestamp to the current time. This is typically called when the client sends a new message.