Categorygithub.com/clambin/grafana-json-server
modulepackage
0.8.0
Repository: https://github.com/clambin/grafana-json-server.git
Documentation: pkg.go.dev

# README

grafana-json-server

GitHub tag (latest by date) Codecov Test Go Report Card GitHub GoDoc

Go implementation of simPod's Grafana JSON datasource.

Works with:

# Packages

No description provided by the author

# Functions

NewDefaultPrometheusQueryMetrics returns the default PrometheusQueryMetrics implementation.
NewServer returns a new JSON API server, configured as per the provided Option items.
WithHandler is a convenience function to create a simple metric (i.e.
WithHTTPHandler adds a http.Handler to its http router.
WithLogger sets the slog Logger.
WithMetric adds a new metric to the server.
WithPrometheusQueryMetrics adds Prometheus metrics to the server's Queries.
WithVariable adds a new dashboard variable to the server.

# Structs

Column is a column returned by a table query.
DataPoint contains one entry of a TimeSeriesResponse.
A Metric represents one data source offered by a JSON API server.
A MetricPayload configures a payload options for a metric.
MetricPayloadOption contains one option of a MetricPayload.
MetricPayloadOptionsRequest is the request provided to MetricPayloadOptionFunc.
The QueryRequest structure is the query request from Grafana to the data source.
QueryRequestTarget is one target in the QueryRequest structure.
Range is the time range of the QueryRequest.
RawRange is the raw time range of the QueryRequest.
A ScopedVar holds the value of a dashboard variable and is sent to the server as part of the QueryRequest.
The Server structure implements a JSON API server compatible with the JSON API Grafana datasource.
TableResponse is returned by a table query, i.e.
TimeSeriesResponse is the response to a query as a time series.
Variable is one possible value for a dashboard value.
VariableRequest is the request sent to VariableFunc.

# Interfaces

A Handler responds to a query request from the JSON API datasource.
No description provided by the author
QueryResponse is the output of the query function.

# Type aliases

The HandlerFunc type is an adapter to allow the use of an ordinary function as Handler handlers.
MetricPayloadOptionFunc is the function signature of the metric payload option function, provided to WithMetric.
NumberColumn holds a slice of float64 values (one per row).
Option configures a Server.
StringColumn holds a slice of string values (one per row).
TimeColumn holds a slice of time.Time values (one per row).
VariableFunc is the function signature of function provided to WithVariable.