Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateRequest ¶
type CreateRequest struct { Dashboard interface{} `json:"dashboard"` Overwrite bool `json:"overwrite"` FolderID int `json:"folderId,omitempty"` }
CreateRequest models parameters required for creating/updating dashboard
func NewCreateRequest ¶
func NewCreateRequest(folderID int) *CreateRequest
NewCreateRequest returns a new create request model
type CreateResponse ¶
type CreateResponse struct { ID int `json:"id"` UID string `json:"uid"` URL string `json:"url"` Status string `json:"status"` Version int `json:"version"` }
CreateResponse models response from grafana for creating/updating dashboard
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
PriorityQueue defines a thread safe priority queue
func NewPriorityQueue ¶
func NewPriorityQueue() *PriorityQueue
NewPriorityQueue creates a new priority queue
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() *Item
Pop returns the lowest priority item from the queue
func (*PriorityQueue) PopConditionally ¶
func (pq *PriorityQueue) PopConditionally(f func(*Item) bool) *Item
PopConditionally pods an item if the given condition is met
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(item *Item)
Push pushes a new item to priority queue with a given value and priority
func (*PriorityQueue) Size ¶
func (pq *PriorityQueue) Size() int
Size returns the current size of the priority queue
type Service ¶
type Service interface { SetupCleanerJob(ctx context.Context) error CreateDashboard(*CreateRequest) (*CreateResponse, error) DeleteDashboard(string) error }
Service exposes methods to handle grafana dashboards
func NewService ¶
NewService returns a new service with default implementations for grafana service It also starts the cleaner job if cleaup is enabled in the configuration