Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) Close() error
- func (c *Client) Increment(k uint64, v float64, t time.Duration) error
- func (c *Client) IncrementString(k string, v float64, t time.Duration) error
- func (c *Client) Monitor(ch chan KV)
- func (c *Client) Read(k uint64) (float64, error)
- func (c *Client) ReadOrQuery(k uint64, t time.Duration) (float64, error)
- func (c *Client) ReadOrQueryString(k string, t time.Duration) (float64, error)
- func (c *Client) ReadString(k string) (float64, error)
- func (c *Client) Subscribe(k uint64) error
- func (c *Client) SubscribeString(k string) error
- func (c *Client) Unsubscribe(k uint64) error
- func (c *Client) UnsubscribeString(k string) error
- type KV
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client holds all the state necessary for interacting with a counterd server.
func Dial ¶
Dial connects to a counterd service at a specified address.
func (*Client) Increment ¶
Increment adds a (potentially negative) value to a counter on the server, scheduled to be reverted after a certain duration.
func (*Client) IncrementString ¶
IncrementString is like Increment, but uses the FNV hash of a string as the key.
func (*Client) Monitor ¶
Monitor registers a channel to receive updates when a notification comes in from the counterd server.
func (*Client) Read ¶
Read returns what the client has cached locally for a particular key, or ErrMissing if there's no cached value.
func (*Client) ReadOrQuery ¶
ReadOrQuery does what it sounds like it does. It either returns the locally cached value of a particular key, or it makes a request to the server.
func (*Client) ReadOrQueryString ¶
ReadOrQueryString is like ReadOrQuery, but uses the FNV hash of a string as the key.
func (*Client) ReadString ¶
ReadString is like Read, but uses the FNV hash of a string as the key.
func (*Client) Subscribe ¶
Subscribe makes a request to the server to begin sending update notifications for a particular key.
func (*Client) SubscribeString ¶
SubscribeString is like Subscribe, but uses the FNV hash of a string as the key.
func (*Client) Unsubscribe ¶
Unsubscribe makes a request to the server to stop sending update notifications for a particular key.