Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
v1.Datasource `json:",inline" yaml:",inline"`
}
type Option ¶
func ProjectName ¶
type Selector ¶
type Selector struct {
Static *StaticSelector
Variable *VariableSelector
}
Selector identifies a datasource either by a concrete static reference or by a Perses variable reference. Exactly one of Static or Variable must be set.
A variable selector serializes as a plain JSON/YAML string (e.g. "$myDatasource"), which Perses resolves at runtime. A static selector serializes as a structured object {"kind":"...","name":"..."}.
func NewSelector ¶ added in v0.55.0
NewSelector returns a Selector for name, automatically detecting whether name is a variable reference (starts with "$" or "${...}"). kind is only used for static selectors. Returns an error if name is a variable reference with an invalid name.
func NewStaticSelector ¶ added in v0.55.0
NewStaticSelector returns a Selector for a concrete, named datasource.
func NewVariableSelector ¶ added in v0.55.0
NewVariableSelector returns a Selector for a Perses variable reference. name may be "foo", "$foo", or "${foo}"; Variable.Name stores the bare name without "$". Returns an error if the name is not a valid Perses variable name.
func (Selector) MarshalJSON ¶ added in v0.55.0
func (Selector) MarshalYAML ¶ added in v0.55.0
func (*Selector) UnmarshalJSON ¶ added in v0.55.0
type StaticSelector ¶ added in v0.55.0
type StaticSelector struct {
Kind string `json:"kind" yaml:"kind"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
}
StaticSelector identifies a concrete datasource by kind and name.
type VariableSelector ¶ added in v0.55.0
type VariableSelector struct {
Name string
}
VariableSelector identifies a datasource via a Perses variable reference. Name holds the bare variable name without the leading "$".