Exemple #1
0
func NewTokenClient(datasource *models.DataSource) *TokenClient {
	httpClient, _ := datasource.GetHttpClient()

	return &TokenClient{
		log:        log.New("tsdb.mqe.tokenclient"),
		Datasource: datasource,
		HttpClient: httpClient,
	}
}
Exemple #2
0
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
}
Exemple #3
0
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
}
Exemple #4
0
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
}