Documentation
¶
Index ¶
- type Client
- func (c *Client) Join(roomId, resource string)
- func (c *Client) KeepAlive()
- func (c *Client) Messages() <-chan *Message
- func (c *Client) Part(roomId, name string)
- func (c *Client) PrivSay(user, name, body string)
- func (c *Client) RequestRooms()
- func (c *Client) RequestUsers()
- func (c *Client) Rooms() <-chan []*Room
- func (c *Client) Say(roomId, name, body string)
- func (c *Client) Status(s string)
- func (c *Client) Users() <-chan []*User
- type Message
- type Room
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { AuthType string Username string Password string Resource string Id string // contains filtered or unexported fields }
A Client represents the connection between the application to the HipChat service.
func NewClient ¶
NewClient creates a new Client connection from the user name, password and resource passed to it. It uses default host URL and conf URL.
func NewClientWithServerInfo ¶
func NewClientWithServerInfo(user, pass, resource, authType, host, domain, conf string) (*Client, error)
NewClientWithServerInfo creates a new Client connection from the user name, password, resource, host URL and conf URL passed to it.
func (*Client) KeepAlive ¶
func (c *Client) KeepAlive()
KeepAlive is meant to run as a goroutine. It sends a single whitespace character to HipChat every 60 seconds. This keeps the connection from idling after 150 seconds.
func (*Client) Messages ¶
Messages returns a read-only channel of Message structs. After joining a room, messages will be sent on the channel.
func (*Client) PrivSay ¶
PrivSay accepts a client id, the name of the client, and the message body and sends the private message to the HipChat user.
func (*Client) RequestRooms ¶
func (c *Client) RequestRooms()
RequestRooms will send an outgoing request to get the room information for all rooms
func (*Client) RequestUsers ¶
func (c *Client) RequestUsers()
RequestUsers will send an outgoing request to get the user information for all users
func (*Client) Say ¶
Say accepts a room id, the name of the client in the room, and the message body and sends the message to the HipChat room.