(cfg string, fluxQuery flux.IFluxQuery)
| 28 | var _ driver.IRestOverview = (*executor)(nil) |
| 29 | |
| 30 | func newExecutor(cfg string, fluxQuery flux.IFluxQuery) (driver.IExecutor, error) { |
| 31 | var data InfluxdbV2Config |
| 32 | err := json.Unmarshal([]byte(cfg), &data) |
| 33 | if err != nil { |
| 34 | return nil, err |
| 35 | } |
| 36 | client := influxdb2.NewClient(data.Addr, data.Token) |
| 37 | |
| 38 | return &executor{cfg: data, openApi: client.QueryAPI(data.Org), client: client, fluxQuery: fluxQuery}, nil |
| 39 | } |
| 40 | |
| 41 | type executor struct { |
| 42 | fluxQuery flux.IFluxQuery |