mirror of
				https://github.com/prometheus-operator/kube-prometheus.git
				synced 2025-11-04 10:01:03 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			31 lines
		
	
	
		
			556 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			556 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package grafana
 | 
						|
 | 
						|
import (
 | 
						|
	"net/http"
 | 
						|
)
 | 
						|
 | 
						|
type Interface interface {
 | 
						|
	Dashboards() DashboardsInterface
 | 
						|
	Datasources() DatasourcesInterface
 | 
						|
}
 | 
						|
 | 
						|
type Clientset struct {
 | 
						|
	BaseUrl    string
 | 
						|
	HTTPClient *http.Client
 | 
						|
}
 | 
						|
 | 
						|
func New(baseUrl string) Interface {
 | 
						|
	return &Clientset{
 | 
						|
		BaseUrl:    baseUrl,
 | 
						|
		HTTPClient: http.DefaultClient,
 | 
						|
	}
 | 
						|
}
 | 
						|
 | 
						|
func (c *Clientset) Dashboards() DashboardsInterface {
 | 
						|
	return NewDashboardsClient(c.BaseUrl, c.HTTPClient)
 | 
						|
}
 | 
						|
 | 
						|
func (c *Clientset) Datasources() DatasourcesInterface {
 | 
						|
	return NewDatasourcesClient(c.BaseUrl, c.HTTPClient)
 | 
						|
}
 |