Documentation
¶
Overview ¶
Package client provides an HTTP client for the pulse server API.
Index ¶
- type Client
- func (c *Client) EnsureToken() error
- func (c *Client) LoadToken() error
- func (c *Client) RefreshToken() error
- func (c *Client) SaveToken(token string, expiresAt time.Time) error
- func (c *Client) SendPulse(count int64, hostname string) error
- func (c *Client) ShouldRefresh() bool
- func (c *Client) Token() string
- type TokenData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
ServerURL string
// contains filtered or unexported fields
}
Client is an HTTP client for the pulse server.
func (*Client) EnsureToken ¶
EnsureToken loads and refreshes the token if needed.
func (*Client) RefreshToken ¶
RefreshToken exchanges the current token for a new one.
func (*Client) ShouldRefresh ¶
ShouldRefresh reports whether the token needs refreshing.
Click to show internal directories.
Click to hide internal directories.