Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	//InternetProxy is a url to use as a proxy when communicating with external services.
	//currently only google's shortener.
	InternetProxy   *url.URL
	AnnotateBackend backend.Backend
)

Functions

func APIRedirect

func APIRedirect(w http.ResponseWriter, req *http.Request)

func Action

func Action(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

func Alerts

func Alerts(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

func AnnotateEnabled

func AnnotateEnabled(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

func BulkEdit

func BulkEdit(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

func Config

func Config(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

func ConfigRunningHash

func ConfigRunningHash(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

func ConfigTest

func ConfigTest(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

func DeleteMetadata

func DeleteMetadata(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

func DiffConfig

func DiffConfig(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

func Dir

func Dir(useLocal bool, name string) http.FileSystem

    Dir returns a http.Filesystem for the embedded assets on a given prefix dir. If useLocal is true, the filesystem's contents are instead used.

    func ErrorHistory

    func ErrorHistory(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

    func Expr

    func Expr(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (v interface{}, err error)

    func ExprGraph

    func ExprGraph(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

      ExprGraph returns an svg graph. The basename of the requested svg file should be a base64 encoded expression.

      func FS

      func FS(useLocal bool) http.FileSystem

        FS returns a http.Filesystem for the embedded assets. If useLocal is true, the filesystem's contents are instead used.

        func FSByte

        func FSByte(useLocal bool, name string) ([]byte, error)

          FSByte returns the named file from the embedded assets. If useLocal is true, the filesystem's contents are instead used.

          func FSMustByte

          func FSMustByte(useLocal bool, name string) []byte

            FSMustByte is the same as FSByte, but panics if name is not present.

            func FSMustString

            func FSMustString(useLocal bool, name string) string

              FSMustString is the string version of FSMustByte.

              func FSString

              func FSString(useLocal bool, name string) (string, error)

                FSString is the string version of FSByte.

                func FilteredTagsetsByMetric

                func FilteredTagsetsByMetric(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                func GetMetadata

                func GetMetadata(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)
                func GetShortLink(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                func Graph

                func Graph(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                  Graph takes an OpenTSDB request data structure and queries OpenTSDB. Use the json parameter to pass JSON. Use the b64 parameter to pass base64-encoded JSON.

                  func HealthCheck

                  func HealthCheck(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                  func Host

                  func Host(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                  func IncidentEvents

                  func IncidentEvents(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                  func Index

                  func Index(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                  func IndexTSDB

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

                  func JSON

                  func JSON(h func(miniprofiler.Timer, http.ResponseWriter, *http.Request) (interface{}, error)) http.Handler

                  func Last

                  func Last(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                    Last returns the most recent datapoint for a metric+tagset. The metric+tagset string should be formated like os.cpu{host=foo}. The tag porition expects the that the keys will be in alphabetical order.

                    func ListOpenIncidents

                    func ListOpenIncidents(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                    func Listen

                    func Listen(httpAddr, httpsAddr, certFile, keyFile string, devMode bool, tsdbHost string, reloadFunc func() error, authConfig *conf.AuthConf, st time.Time) error

                    func MetadataMetrics

                    func MetadataMetrics(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                    func MetricsByTagKey

                    func MetricsByTagKey(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                    func MetricsByTagPair

                    func MetricsByTagPair(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                    func OpenTSDBVersion

                    func OpenTSDBVersion(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                    func PutMetadata

                    func PutMetadata(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                    func Quiet

                    func Quiet(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                    func Relay

                    func Relay(dest string) http.Handler

                    func Reload

                    func Reload(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                    func ResetSchedule

                    func ResetSchedule()

                    func Rule

                    func Rule(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                    func RunEsc

                    func RunEsc()

                      Run esc to embed entire static directory into static.go

                      func RunTsc

                      func RunTsc()

                        Run tsc to compile all ts files into bosun.js

                        func SaveConfig

                        func SaveConfig(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                        func SaveEnabled

                        func SaveEnabled(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                        func Shorten

                        func Shorten(_ miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                        func SilenceClear

                        func SilenceClear(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                        func SilenceGet

                        func SilenceGet(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                        func SilenceSet

                        func SilenceSet(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                        func Status

                        func Status(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                        func TagKeysByMetric

                        func TagKeysByMetric(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                        func TagValuesByMetricTagKey

                        func TagValuesByMetricTagKey(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                        func TagValuesByTagKey

                        func TagValuesByTagKey(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                        func TestHTTPNotification

                        func TestHTTPNotification(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                        func UniqueMetrics

                        func UniqueMetrics(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error)

                          UniqueMetrics returns a sorted list of available metrics.

                          func Version

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

                          Types

                          type ExtIncidentStatus

                          type ExtIncidentStatus struct {
                          	ExtStatus
                          	IsActive  bool
                          	Silence   *models.Silence
                          	SilenceId string
                          }

                          type ExtStatus

                          type ExtStatus struct {
                          	AlertName string
                          	Subject   string
                          	*models.IncidentState
                          	*models.RenderedTemplates
                          }

                          type Health

                          type Health struct {
                          	// RuleCheck is true if last check happened within the check frequency window.
                          	RuleCheck     bool
                          	Quiet         bool
                          	UptimeSeconds int64
                          	StartEpoch    int64
                          	Notifications NotificationStats
                          }

                          type MetricMetaTagKeys

                          type MetricMetaTagKeys struct {
                          	*database.MetricMetadata
                          	TagKeys []string
                          }

                          type MultiError

                          type MultiError map[string]error

                          func (MultiError) Error

                          func (m MultiError) Error() string

                          type NotificationStats

                          type NotificationStats struct {
                          	// Post and email notifiaction stats
                          	PostNotificationsSuccess  int64
                          	PostNotificationsFailed   int64
                          	EmailNotificationsSuccess int64
                          	EmailNotificationsFailed  int64
                          }

                          type Res

                          type Res struct {
                          	*models.Event
                          	Key models.AlertKey
                          }