grafana

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package grafana provides an input to the badgedata library to retreive dashboard download count from the public Grafana API.

Index

Constants

View Source
const DashboardAPI = "https://grafana.com/api/dashboards/"

DashboardAPI is the URL to the JSON API at Grafana.com

Variables

This section is empty.

Functions

func ServeHTTP

func ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is our main traffic handler.

func WriteDashboardDownloadCount

func WriteDashboardDownloadCount(w http.ResponseWriter, r *http.Request)

WriteDashboardDownloadCount makes sure data is fresh and returns the count for dashboard downloads.

Types

type Dashboard

type Dashboard struct {
	Name      string    `json:"name"`
	ID        int64     `json:"id"`
	Downloads int64     `json:"downloads"`
	Ts        time.Time `json:"-"`
}

Dashboard holds a dashboard's name and download count. This is a small snippet of the data available from the Grafana API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL