From acdd1992e6904cbf300f1e365af8e8d9f8448317 Mon Sep 17 00:00:00 2001 From: Chris Goller Date: Wed, 21 Sep 2016 15:11:29 -0700 Subject: [PATCH] Update Database to be DB --- handlers/proxy.go | 6 +++--- influx/influx.go | 2 +- mock/handlers.go | 6 +++--- models/proxy.go | 4 ++-- swagger.yaml | 2 +- timeseries.go | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/handlers/proxy.go b/handlers/proxy.go index c7e4777c96..5b6243b8d5 100644 --- a/handlers/proxy.go +++ b/handlers/proxy.go @@ -16,9 +16,9 @@ type InfluxProxy struct { func (h *InfluxProxy) Proxy(ctx context.Context, params op.PostSourcesIDProxyParams) middleware.Responder { // TODO: Add support for multiple TimeSeries with lookup based on params.ID query := mrfusion.Query{ - Command: *params.Query.Query, - Database: params.Query.Database, - RP: params.Query.Rp, + Command: *params.Query.Query, + DB: params.Query.DB, + RP: params.Query.Rp, } response, err := h.TimeSeries.Query(ctx, query) diff --git a/influx/influx.go b/influx/influx.go index b1bba59287..5e3fe0107e 100644 --- a/influx/influx.go +++ b/influx/influx.go @@ -34,7 +34,7 @@ func NewClient(host string) (*Client, error) { // include both the database and retention policy. In-flight requests can be // cancelled using the provided context. func (c *Client) Query(ctx context.Context, query mrfusion.Query) (mrfusion.Response, error) { - q := ixClient.NewQuery(query.Command, query.Database, query.RP) + q := ixClient.NewQuery(query.Command, query.DB, query.RP) resps := make(chan (response)) go func() { resp, err := c.ix.Query(q) diff --git a/mock/handlers.go b/mock/handlers.go index 589fd1bacd..c307ec42de 100644 --- a/mock/handlers.go +++ b/mock/handlers.go @@ -58,9 +58,9 @@ func (m *Handler) SourcesID(ctx context.Context, params op.GetSourcesIDParams) m func (m *Handler) Proxy(ctx context.Context, params op.PostSourcesIDProxyParams) middleware.Responder { query := mrfusion.Query{ - Command: *params.Query.Query, - Database: params.Query.Database, - RP: params.Query.Rp, + Command: *params.Query.Query, + DB: params.Query.DB, + RP: params.Query.Rp, } response, err := m.TimeSeries.Query(ctx, mrfusion.Query(query)) if err != nil { diff --git a/models/proxy.go b/models/proxy.go index 0eb22d7643..7dd645f467 100644 --- a/models/proxy.go +++ b/models/proxy.go @@ -19,9 +19,9 @@ swagger:model Proxy */ type Proxy struct { - /* database + /* db */ - Database string `json:"database,omitempty"` + Db string `json:"db,omitempty"` /* format */ diff --git a/swagger.yaml b/swagger.yaml index 2066ab873b..acfb0c0f32 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -788,7 +788,7 @@ definitions: properties: query: type: string - database: + db: type: string rp: type: string diff --git a/timeseries.go b/timeseries.go index 066fec8123..e691a5a9a0 100644 --- a/timeseries.go +++ b/timeseries.go @@ -4,9 +4,9 @@ import "golang.org/x/net/context" // Query retrieves a Response from a TimeSeries. type Query struct { - Command string // Command is the query itself - Database string // Database is optional and if empty will not be used. - RP string // RP is a retention policy and optional; if empty will not be used. + Command string // Command is the query itself + DB string // DB is optional and if empty will not be used. + RP string // RP is a retention policy and optional; if empty will not be used. } // Response is the result of a query against a TimeSeries