Add comments to influx query proxy

pull/101/head
Chris Goller 2017-02-19 12:15:53 -06:00
parent 3eb7da2f1a
commit 17f6f55269
1 changed files with 5 additions and 0 deletions

View File

@ -37,11 +37,14 @@ func NewClient(host string, lg chronograf.Logger) (*Client, error) {
}, nil
}
// Response is a partial JSON decoded InfluxQL response used
// to check for some errors
type Response struct {
Results json.RawMessage
Err string `json:"error,omitempty"`
}
// MarshalJSON returns the raw results bytes from the response
func (r Response) MarshalJSON() ([]byte, error) {
return r.Results, nil
}
@ -150,6 +153,7 @@ func (c *Client) Query(ctx context.Context, q chronograf.Query) (chronograf.Resp
}
}
// Connect caches the URL for the data source
func (c *Client) Connect(ctx context.Context, src *chronograf.Source) error {
u, err := url.Parse(src.URL)
if err != nil {
@ -164,6 +168,7 @@ func (c *Client) Connect(ctx context.Context, src *chronograf.Source) error {
return nil
}
// Users transforms InfluxDB into a user store
func (c *Client) Users(ctx context.Context) chronograf.UsersStore {
return c
}