func NewTokenClient(datasource *models.DataSource) *TokenClient { httpClient, _ := datasource.GetHttpClient() return &TokenClient{ log: log.New("tsdb.mqe.tokenclient"), Datasource: datasource, HttpClient: httpClient, } }
func NewOpenTsdbExecutor(datasource *models.DataSource) (tsdb.Executor, error) { httpClient, err := datasource.GetHttpClient() if err != nil { return nil, err } return &OpenTsdbExecutor{ DataSource: datasource, httpClient: httpClient, }, nil }
func NewInfluxDBExecutor(datasource *models.DataSource) (tsdb.Executor, error) { httpClient, err := datasource.GetHttpClient() if err != nil { return nil, err } return &InfluxDBExecutor{ DataSource: datasource, QueryParser: &InfluxdbQueryParser{}, ResponseParser: &ResponseParser{}, HttpClient: httpClient, }, nil }
func NewMQEExecutor(dsInfo *models.DataSource) (tsdb.Executor, error) { httpclient, err := dsInfo.GetHttpClient() if err != nil { return nil, err } return &MQEExecutor{ DataSource: dsInfo, httpClient: httpclient, log: log.New("tsdb.mqe"), queryParser: NewQueryParser(), apiClient: NewApiClient(httpclient, dsInfo), tokenClient: NewTokenClient(dsInfo), }, nil }