| 
									
										
										
										
											2023-09-26 06:31:58 +08:00
										 |  |  | package apiregistry | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import ( | 
					
						
							|  |  |  | 	"context" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	"github.com/grafana/grafana/pkg/registry" | 
					
						
							| 
									
										
										
										
											2023-11-03 23:07:55 +08:00
										 |  |  | 	"github.com/grafana/grafana/pkg/registry/apis/example" | 
					
						
							|  |  |  | 	"github.com/grafana/grafana/pkg/registry/apis/playlist" | 
					
						
							| 
									
										
										
										
											2023-09-26 06:31:58 +08:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | var ( | 
					
						
							|  |  |  | 	_ registry.BackgroundService = (*Service)(nil) | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | type Service struct{} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-03 23:07:55 +08:00
										 |  |  | // ProvideRegistryServiceSink is an entry point for each service that will force initialization
 | 
					
						
							| 
									
										
										
										
											2023-10-07 02:55:22 +08:00
										 |  |  | // and give each builder the chance to register itself with the main server
 | 
					
						
							| 
									
										
										
										
											2023-11-03 23:07:55 +08:00
										 |  |  | func ProvideRegistryServiceSink( | 
					
						
							| 
									
										
										
										
											2023-11-01 21:44:04 +08:00
										 |  |  | 	_ *playlist.PlaylistAPIBuilder, | 
					
						
							| 
									
										
										
										
											2023-11-03 23:07:55 +08:00
										 |  |  | 	_ *example.TestingAPIBuilder, | 
					
						
							| 
									
										
										
										
											2023-09-26 06:31:58 +08:00
										 |  |  | ) *Service { | 
					
						
							|  |  |  | 	return &Service{} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func (s *Service) Run(ctx context.Context) error { | 
					
						
							|  |  |  | 	<-ctx.Done() | 
					
						
							|  |  |  | 	return nil | 
					
						
							|  |  |  | } |