# README
data
Testing
This package uses golden files to verify Arrow serialization.
Add the update
flag to go test
to update the golden files:
go test -update
Make sure you check in any updated golden files.
# Packages
Package converters provides data.FieldConverters commonly used by plugins.
Package framestruct provides functions to convert from any type to *data.Frame or data.Frames.
Package sqlutil provides multiple utilities for working with SQL data sources.
No description provided by the author
# Functions
ArrowBufferToJSON writes a frame to JSON NOTE: the format should be considered experimental until grafana 8 is released.
ArrowToJSON writes a frame to JSON NOTE: the format should be considered experimental until grafana 8 is released.
FieldTypeFor will return the FieldType that holds items of item's type.
FieldTypeFromItemTypeString returns a field type from the current string
nolint:goconst,gocyclo.
FrameMetaFromJSON creates a QueryResultMeta from a json string.
FrameTestCompareOptions returns go-cmp testing options to allow testing of Frame equivalence.
FrameToArrowTable creates a new arrow.Table from a data frame To release the allocated memory be sure to call:
defer table.Release().
FrameToJSON creates an object that holds schema and data independently.
FrameToJSON creates an object that holds schema and data independently.
FrameTypes returns a slice of all known frame types.
FromArrowRecord converts a an Arrow record batch into a Frame.
GetMissing returns the value to be filled for a missing row field.
LabelsFromString() parses string into a Label object.
LongToWide converts a Long formatted time series Frame to a Wide format (see TimeSeriesType for descriptions).
NewField returns a instance of *Field.
NewFieldFromFieldType creates a new Field of the given FieldType of length n.
NewFrame returns a new Frame.
NewFrameInputConverter returns a FrameInputConverter which is used to create a Frame from data that needs value conversions.
NewFrameOfFieldTypes returns a Frame where the Fields are initialized to the corresponding field type in fTypes.
NewThreshold Creates a new Threshold object.
NumericFieldTypes returns a slice of FieldTypes that are numeric.
ParseFrameTypeVersion parses a canonical representation of a [FrameTypeVersion] (e.g.
SortWideFrameFields sorts the order of a wide time series Frame's Fields.
UnmarshalArrowFrame converts a byte representation of an arrow table to a Frame.
UnmarshalArrowFrames decodes a slice of Arrow encoded frames to Frames ([]*Frame) by calling the UnmarshalArrow function on each encoded frame.
ValidFieldType returns if a primitive slice is a valid supported Field type.
WideToLong converts a Wide formatted time series Frame to a Long formatted time series Frame (see TimeSeriesType for descriptions).
# Constants
DataTopicAnnotations is used to specify that the frame should be used as annotation of the actual data frame response.
ExplicitNullValue is the string representation for null.
FieldTypeBool indicates the underlying primitive is a []bool.
FieldTypeEnum indicates the underlying primitive is a []data.EnumItemIndex, with field mapping metadata.
FieldTypeFloat32 indicates the underlying primitive is a []float32.
FieldTypeFloat64 indicates the underlying primitive is a []float64.
FieldTypeInt16 indicates the underlying primitive is a []int16.
FieldTypeInt32 indicates the underlying primitive is a []int32.
FieldTypeInt64 indicates the underlying primitive is a []int64.
FieldTypeInt8 indicates the underlying primitive is a []int8.
FieldTypeJSON indicates the underlying primitive is a []json.RawMessage.
FieldTypeNullableBool indicates the underlying primitive is a []*bool.
FieldTypeNullableEnum indicates the underlying primitive is a []*data.EnumItemIndex, with field mapping metadata.
FieldTypeNullableFloat32 indicates the underlying primitive is a []*float32.
FieldTypeNullableFloat64 indicates the underlying primitive is a []*float64.
FieldTypeNullableInt16 indicates the underlying primitive is a []*int16.
FieldTypeNullableInt32 indicates the underlying primitive is a []*int32.
FieldTypeNullableInt64 indicates the underlying primitive is a []*int64.
FieldTypeNullableInt8 indicates the underlying primitive is a []*int8.
FieldTypeNullableJSON indicates the underlying primitive is a []*json.RawMessage.
FieldTypeNullableString indicates the underlying primitive is a []*string.
FieldTypeNullableTime indicates the underlying primitive is a []*time.Time.
FieldTypeNullableUint16 indicates the underlying primitive is a []*uint16.
FieldTypeNullableUint32 indicates the underlying primitive is a []*uint32.
FieldTypeNullableUint64 indicates the underlying primitive is a []*uint64.
FieldTypeNullableUint8 indicates the underlying primitive is a []*uint8.
FieldTypeString indicates the underlying primitive is a []string.
FieldTypeTime indicates the underlying primitive is a []time.Time.
FieldTypeUint16 indicates the underlying primitive is a []uint16.
FieldTypeUint32 indicates the underlying primitive is a []uint32.
FieldTypeUint64 indicates the underlying primitive is a []uint64.
FieldTypeUint8 indicates the underlying primitive is a []uint8.
FieldTypeUnknown indicates that we do not know the field type.
FillModeNull fills with null.
FillModePrevious fills with the last seen value unless that does not exist, in which case it fills with null.
FillModeValue fills with a specific value.
FrameTypeDirectoryListing represents the items in a directory field[0]: - name - new paths can be constructed from the parent path + separator + name
field[1]: - media-type - when "directory" it can be nested.
FrameTypeLogLines is documented in the Logs Format in the Data Plane Contract.
FrameTypeNumericLong is documented in the [Numeric Long Format in the Data Plane Contract].
FrameTypeNumericMulti is documented in the [Numeric Multi Format in the Data Plane Contract].
FrameTypeNumericWide is documented in the [Numeric Wide Format in the Data Plane Contract].
FrameTypeTable represents an arbitrary table structure with no constraints.
FrameTypeTimeSeriesLong uses string fields to define dimensions and is documented in [Time Series Long Format in the Data Plane Contract].
FrameTypeTimeSeriesMany is the same as "Wide" with exactly one numeric value field.
FrameTypeTimeSeriesMulti is documented in the [Time Series Multi Format in the Data Plane Contract].
FrameTypeTimeSeriesWide uses labels on fields to define dimensions and is documented in [Time Series Wide Format in the Data Plane Contract].
FrameTypeUnknown indicates that we do not know the frame type.
IncludeAll serializes the entire Frame with both Schema and Data.
IncludeDataOnly only serializes data part of a frame.
IncludeSchemaOnly only serializes schema part of a frame.
InspectTypeData suggests the "data" tab of the panel editor in Grafana's user interface.
InspectTypeError suggests the "error" tab of the panel editor in Grafana's user interface.
InspectTypeMeta suggests the "meta" tab of the panel editor in Grafana's user interface.
InspectTypeNone is no suggestion for a tab of the panel editor in Grafana's user interface.
InspectTypeStats suggests the "stats" tab of the panel editor in Grafana's user interface.
KindLogs means the FrameType's Kind is logs.
KindNumeric means the FrameType's Kind is numeric.
KindTimeSeries means the FrameType's Kind is time series.
No description provided by the author
No description provided by the author
NoticeSeverityError is error severity.
NoticeSeverityInfo is informational severity.
NoticeSeverityWarning is warning severity.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ThresholdsModeAbsolute pick thresholds based on absolute value.
ThresholdsModePercentage the threshold is relative to min/max.
TimeSeriesTimeFieldName is the standard name for time series time fields.
TimeSeriesTypeLong means this Frame can be treated as a "Long" time series.
TimeSeriesTypeNot means this Frame is not a valid time series.
TimeSeriesTypeWide means this Frame can be treated as a "Wide" time series.
TimeSeriesValueFieldName is the standard name for time series value fields.
VisTypeFlameGraph indicates the response should be visualized using a flame graph visualization.
VisTypeGraph indicates the response should be visualized using a graph.
VisTypeLogs indicates the response should be visualized using a logs visualization.
VisTypeNodeGraph indicates the response should be visualized using a node graph visualization.
VisTypeTable indicates the response should be visualized using a table.
VisTypeTrace indicates the response should be visualized using a trace view visualization.
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
DataLink define what.
Enum field config Vector values are used as lookup keys into the enum fields.
Field represents a typed column of data within a Frame.
FieldConfig represents the display properties for a Field.
A FieldConverter is a type to support building Frame fields of a different type than one's input data.
FieldTypeConfig has type specific configs, only one should be active at a time.
FillMissing is a struct containing the fill mode and the fill value if fill mode is FillModeValue.
Frame is a columnar data structure where each column is a Field.
FrameInputConverter is a type to support building a Frame while also doing conversion as data is added to the Frame.
FrameJSONCache holds a byte representation of the schema separate from the data.
FrameMeta matches: https://github.com/grafana/grafana/blob/master/packages/grafana-data/src/types/data.ts#L11 NOTE -- in javascript this can accept any `[key: string]: any;` however this interface only exposes the values we want to be exposed
swagger:model.
InternalDataLink definition to allow Explore links to be constructed in the backend.
No description provided by the author
Notice provides a structure for presenting notifications in Grafana's user interface.
QueryStat is used for storing arbitrary statistics metadata related to a query and its result, e.g.
No description provided by the author
No description provided by the author
Threshold a single step on the threshold list.
ThresholdsConfig setup thresholds.
Redefining this to avoid an import cycle.
TimeSeriesSchema is information about a Frame's schema.
ValueMappingResult is the results from mapping a value.
# Interfaces
Framer is simply an object that can be converted to Grafana data frames.
ValueMapping allows mapping input values to text and color.
# Type aliases
ConfFloat64 is a float64.
Converter is a function type for converting values in a Frame.
DataTopic is used to identify which topic the frame should be assigned to.
No description provided by the author
This is an object constructed with the keys as the values of the enum VisType and the value being a bag of properties.
Fields is a slice of Field pointers.
FieldType indicates the Go type underlying the Field.
FillMode is an integer type denoting how missing values should be filled.
No description provided by the author
FrameInclude - custom type to hold Frame serialization options.
Frames is a slice of Frame pointers.
A FrameType string, when present in a frame's metadata, asserts that the frame's structure conforms to the FrameType's specification.
FrameTypeKind represents the Kind a particular FrameType falls into.
FrameType is a 2 number version (Major / Minor).
InspectType is a type for the Inspect property of a Notice.
Labels are used to add metadata to an object.
NoticeSeverity is a type for the Severity property of a Notice.
No description provided by the author
No description provided by the author
ThresholdsMode absolute or percentage.
TimeSeriesType represents the type of time series the schema can be treated as (if any).
ValueMapper converts one set of strings to another.
No description provided by the author
VisType is used to indicate how the data should be visualized in explore.