live

package
v0.164.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 3 Imported by: 13

Documentation

Overview

Package live provides types for the Grafana Live server.

Index

Constants

View Source
const (
	// ScopeGrafana contains builtin real-time features of Grafana Core.
	ScopeGrafana = "grafana"
	// ScopePlugin passes control to a plugin.
	ScopePlugin = "plugin"
	// ScopeDatasource passes control to a datasource plugin.
	ScopeDatasource = "ds"
	// ScopeStream is a managed data frame stream.
	ScopeStream = "stream"
)

Variables

View Source
var ErrInvalidChannelID = errors.New("invalid channel ID")

ErrInvalidChannelID returned when channel ID does not have valid format.

Functions

This section is empty.

Types

type Channel added in v0.92.0

type Channel struct {
	// Scope is one of available channel scopes:
	// like ScopeGrafana, ScopePlugin, ScopeDatasource, ScopeStream.
	Scope string `json:"scope,omitempty"`

	// Namespace meaning depends on the scope.
	// * when ScopeGrafana, namespace is a "feature"
	// * when ScopePlugin, namespace is the plugin name
	// * when ScopeDatasource, namespace is the datasource uid
	// * when ScopeStream, namespace is the stream ID.
	Namespace string `json:"namespace,omitempty"`

	// Within each scope and namespace, the handler can process the path as needed.
	Path string `json:"path,omitempty"`
}

Channel is the channel ID split by parts.

func ParseChannel added in v0.92.0

func ParseChannel(chID string) (Channel, error)

ParseChannel parses the parts from a channel ID. Valid channel IDs have length <= 160 characters and consist of 3 parts (scope, namespace, path) delimited by "/": like "${scope}/${namespace}/${path}". Scope and namespace parts can only have alphanumeric ascii symbols, underscore and dash. Path can additionally have "/", "=" and ".". For invalid channel IDs function returns ErrInvalidChannelID.

func (*Channel) IsValid added in v0.92.0

func (c *Channel) IsValid() bool

IsValid checks if all parts of the Channel are valid.

func (Channel) String added in v0.92.0

func (c Channel) String() string

String converts Channel to a string representation (channel ID).

Jump to

Keyboard shortcuts

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