Documentation
¶
Index ¶
- type Client
- func (c *Client) CPUUtilization(doneCh chan struct{})
- func (c *Client) Connect() bool
- func (c *Client) DialServer() error
- func (c *Client) IsConnected() bool
- func (c *Client) Listen(doneCh chan struct{})
- func (c *Client) LoadAvg() error
- func (c *Client) MemInfo(doneCh chan struct{})
- func (c *Client) MessageWriter(doneCh chan struct{})
- func (c *Client) NetUsage(doneCh chan struct{})
- func (c *Client) NewMessage(k message.Kind, p []byte) []byte
- func (c *Client) Reconnect() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // The Autofact Path AutoPath string // Conn holds the configuration for connecting to the server. conf.Conn // Conf holds the client configuration (how the client behaves). Conf *conf.Client // The websocket connection that this client uses. WS *websocket.Conn ServerURL url.URL // contains filtered or unexported fields }
Client is anything that talks to the server.
func (*Client) CPUUtilization ¶
func (c *Client) CPUUtilization(doneCh chan struct{})
func (*Client) Connect ¶
Connect handles connecting to the server and returns the connection status. The client will attempt to connect until it has either succeeded or the connection retry period has been exceeded. A retry is done every 5 seconds.
If the client is already connected, nothing will be done.
func (*Client) DialServer ¶
func (*Client) IsConnected ¶
IsConnected returns if the client is connected.
func (*Client) LoadAvg ¶
LoadAvg gets the current loadavg and pushes the bytes into the message queue
func (*Client) MessageWriter ¶
func (c *Client) MessageWriter(doneCh chan struct{})
func (*Client) NewMessage ¶
NewMessage creates a new message of type Kind using the received bytes. The MessageID is a snowflake using the client's ID and the current time.
Click to show internal directories.
Click to hide internal directories.