| 
									
										
										
										
											2016-06-06 16:31:21 +08:00
										 |  |  | package tsdb | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-31 17:45:25 +08:00
										 |  |  | import ( | 
					
						
							|  |  |  | 	"context" | 
					
						
							| 
									
										
										
										
											2017-09-22 00:04:06 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	"github.com/grafana/grafana/pkg/models" | 
					
						
							| 
									
										
										
										
											2017-03-31 17:45:25 +08:00
										 |  |  | ) | 
					
						
							| 
									
										
										
										
											2016-07-20 20:28:02 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-22 00:04:06 +08:00
										 |  |  | type HandleRequestFunc func(ctx context.Context, dsInfo *models.DataSource, req *TsdbQuery) (*Response, error) | 
					
						
							| 
									
										
										
										
											2016-10-03 15:38:03 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-22 00:04:06 +08:00
										 |  |  | func HandleRequest(ctx context.Context, dsInfo *models.DataSource, req *TsdbQuery) (*Response, error) { | 
					
						
							|  |  |  | 	endpoint, err := getTsdbQueryEndpointFor(dsInfo) | 
					
						
							| 
									
										
										
										
											2016-06-06 16:31:21 +08:00
										 |  |  | 	if err != nil { | 
					
						
							|  |  |  | 		return nil, err | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-22 00:04:06 +08:00
										 |  |  | 	return endpoint.Query(ctx, dsInfo, req) | 
					
						
							| 
									
										
										
										
											2016-06-06 16:31:21 +08:00
										 |  |  | } |