Documentation ¶
Index ¶
- func Barchart(w io.Writer, samples []*Sample, title string, tz *time.Location)
- func Linechart(w io.Writer, samples []*Sample, title string, tz *time.Location)
- func LinechartDaily(w io.Writer, samples []*Daily, title string, tz *time.Location)
- type Client
- func (c *Client) Close()
- func (c *Client) Configured() bool
- func (c *Client) GetAllDaily() ([]*Daily, error)
- func (c *Client) GetAllSamples() ([]*Sample, error)
- func (c *Client) GetDay(t time.Time) ([]*Sample, error)
- func (c *Client) GetDayRange(start time.Time, end time.Time) ([]*Sample, error)
- func (c *Client) GetPastDay() ([]*Sample, error)
- func (c *Client) GetSamples(start, end time.Time) ([]*Sample, error)
- func (c *Client) PutDaily(d *Daily) error
- func (c *Client) PutSample(s *Sample) error
- func (c *Client) Reset() error
- func (c *Client) Sample() error
- type Daily
- type Sample
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Barchart ¶
Barchart takes a set of samples, and a title and writes the barchart to the specified writer
Types ¶
type Client ¶
type Client struct { DB *sql.DB Envoy *envoy.Envoy TZ *time.Location // contains filtered or unexported fields }
Client is the primary handle for the EnvoyChart API
func (*Client) Configured ¶
func (*Client) GetAllDaily ¶
GetAllDaily gets every entry from the daily table
func (*Client) GetAllSamples ¶
GetAll returns all values from the database, probably not useful for anything other than testing
func (*Client) GetDay ¶
GetDay returns all the samples for the day which contains the parameter -- 24 hour window rounded to midnight
func (*Client) GetDayRange ¶
GetDayRange gets all values between the start and end days -- rounds to start/end of days
func (*Client) GetPastDay ¶
GetPastDay gets the samples for the previous 24 hours -- 24 hour window ending at Now()
Click to show internal directories.
Click to hide internal directories.