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

	return &TokenClient{
		log:        log.New("tsdb.mqe.tokenclient"),
		Datasource: datasource,
		HttpClient: httpClient,
	}
}
Esempio n. 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
}
Esempio n. 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
}
Esempio n. 4
0
File: mqe.go Progetto: mapr/grafana
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
}