Documentation
¶
Index ¶
- Variables
- func FilterDatasource[T DatasourceInterface](kind string, defaultDTS *bool, list []T) []T
- func GetStruct(kind Kind) (modelAPI.Entity, error)
- type Dashboard
- type DashboardSpec
- type Datasource
- func (d *Datasource) GetDTSSpec() DatasourceSpec
- func (d *Datasource) GetKind() string
- func (d *Datasource) GetMetadata() modelAPI.Metadata
- func (d *Datasource) GetSpec() interface{}
- func (d *Datasource) UnmarshalJSON(data []byte) error
- func (d *Datasource) UnmarshalYAML(unmarshal func(interface{}) error) error
- type DatasourceInterface
- type DatasourceSpec
- type Folder
- type FolderSpec
- type GlobalDatasource
- func (d *GlobalDatasource) GetDTSSpec() DatasourceSpec
- func (d *GlobalDatasource) GetKind() string
- func (d *GlobalDatasource) GetMetadata() modelAPI.Metadata
- func (d *GlobalDatasource) GetSpec() interface{}
- func (d *GlobalDatasource) UnmarshalJSON(data []byte) error
- func (d *GlobalDatasource) UnmarshalYAML(unmarshal func(interface{}) error) error
- type GlobalVariable
- type Health
- type Kind
- type Metadata
- type Panel
- type PanelSpec
- type Project
- type ProjectMetadata
- type ProjectSpec
- type Query
- type QuerySpec
- type Variable
- type VariableSpec
Constants ¶
This section is empty.
Variables ¶
var KindMap = map[Kind]bool{ KindDashboard: true, KindDatasource: true, KindFolder: true, KindGlobalDatasource: true, KindGlobalVariable: true, KindProject: true, KindVariable: true, }
var PluralKindMap = map[Kind]string{ KindDashboard: "dashboards", KindDatasource: "datasources", KindFolder: "folders", KindGlobalDatasource: "globaldatasources", KindGlobalVariable: "globalvariables", KindProject: "projects", KindVariable: "variables", }
Functions ¶
func FilterDatasource ¶ added in v0.11.0
func FilterDatasource[T DatasourceInterface](kind string, defaultDTS *bool, list []T) []T
Types ¶
type Dashboard ¶
type Dashboard struct {
Kind Kind `json:"kind" yaml:"kind"`
Metadata ProjectMetadata `json:"metadata" yaml:"metadata"`
Spec DashboardSpec `json:"spec" yaml:"spec"`
}
func (*Dashboard) GetMetadata ¶
func (*Dashboard) UnmarshalJSON ¶
func (*Dashboard) UnmarshalYAML ¶
type DashboardSpec ¶
type DashboardSpec struct {
Display *common.Display `json:"display,omitempty" yaml:"display,omitempty"`
// Datasources is an optional list of datasource definition.
Datasources map[string]*DatasourceSpec `json:"datasources,omitempty" yaml:"datasources,omitempty"`
// Duration is the default time you would like to use to looking in the past when getting data to fill the
// dashboard
Duration model.Duration `json:"duration" yaml:"duration"`
Variables []dashboard.Variable `json:"variables,omitempty" yaml:"variables,omitempty"`
Panels map[string]*Panel `json:"panels" yaml:"panels"`
Layouts []dashboard.Layout `json:"layouts" yaml:"layouts"`
}
func (*DashboardSpec) UnmarshalJSON ¶
func (d *DashboardSpec) UnmarshalJSON(data []byte) error
func (*DashboardSpec) UnmarshalYAML ¶
func (d *DashboardSpec) UnmarshalYAML(unmarshal func(interface{}) error) error
type Datasource ¶
type Datasource struct {
Kind Kind `json:"kind" yaml:"kind"`
Metadata ProjectMetadata `json:"metadata" yaml:"metadata"`
Spec DatasourceSpec `json:"spec" yaml:"spec"`
}
Datasource will be the datasource you can define in your project/namespace This is a resource that won't be shared across projects. A Dashboard can use it only if it is in the same project.
func (*Datasource) GetDTSSpec ¶ added in v0.12.0
func (d *Datasource) GetDTSSpec() DatasourceSpec
func (*Datasource) GetKind ¶
func (d *Datasource) GetKind() string
func (*Datasource) GetMetadata ¶
func (d *Datasource) GetMetadata() modelAPI.Metadata
func (*Datasource) GetSpec ¶ added in v0.11.0
func (d *Datasource) GetSpec() interface{}
func (*Datasource) UnmarshalJSON ¶
func (d *Datasource) UnmarshalJSON(data []byte) error
func (*Datasource) UnmarshalYAML ¶
func (d *Datasource) UnmarshalYAML(unmarshal func(interface{}) error) error
type DatasourceInterface ¶ added in v0.11.0
type DatasourceInterface interface {
GetMetadata() modelAPI.Metadata
GetDTSSpec() DatasourceSpec
}
type DatasourceSpec ¶
type Folder ¶
type Folder struct {
Kind Kind `json:"kind" yaml:"kind"`
Metadata ProjectMetadata `json:"metadata" yaml:"metadata"`
Spec []FolderSpec `json:"spec" yaml:"spec"`
}
func (*Folder) GetMetadata ¶
func (*Folder) UnmarshalJSON ¶
func (*Folder) UnmarshalYAML ¶
type FolderSpec ¶
type FolderSpec struct {
// Kind can only have two values: `Dashboard` or `Folder`
Kind Kind `json:"kind" yaml:"kind"`
// Name is the reference to the dashboard when `Kind` is equal to `Dashboard`.
// When `Kind` is equal to `Folder`, then it's just the name of the folder
Name string `json:"name" yaml:"name"`
// Spec must only be set when 'Kind' is equal to 'Folder'.
Spec []FolderSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
}
func (*FolderSpec) UnmarshalJSON ¶
func (f *FolderSpec) UnmarshalJSON(data []byte) error
func (*FolderSpec) UnmarshalYAML ¶
func (f *FolderSpec) UnmarshalYAML(unmarshal func(interface{}) error) error
type GlobalDatasource ¶
type GlobalDatasource struct {
Kind Kind `json:"kind" yaml:"kind"`
Metadata Metadata `json:"metadata" yaml:"metadata"`
Spec DatasourceSpec `json:"spec" yaml:"spec"`
}
GlobalDatasource is the struct representing the datasource shared to everybody. Any Dashboard can reference it.
func (*GlobalDatasource) GetDTSSpec ¶ added in v0.12.0
func (d *GlobalDatasource) GetDTSSpec() DatasourceSpec
func (*GlobalDatasource) GetKind ¶
func (d *GlobalDatasource) GetKind() string
func (*GlobalDatasource) GetMetadata ¶
func (d *GlobalDatasource) GetMetadata() modelAPI.Metadata
func (*GlobalDatasource) GetSpec ¶ added in v0.11.0
func (d *GlobalDatasource) GetSpec() interface{}
func (*GlobalDatasource) UnmarshalJSON ¶
func (d *GlobalDatasource) UnmarshalJSON(data []byte) error
func (*GlobalDatasource) UnmarshalYAML ¶
func (d *GlobalDatasource) UnmarshalYAML(unmarshal func(interface{}) error) error
type GlobalVariable ¶ added in v0.31.0
type GlobalVariable struct {
Kind Kind `json:"kind" yaml:"kind"`
Metadata Metadata `json:"metadata" yaml:"metadata"`
Spec VariableSpec `json:"spec" yaml:"spec"`
}
GlobalVariable is a global variable that be used everywhere regardless the project.
func (*GlobalVariable) GetKind ¶ added in v0.31.0
func (v *GlobalVariable) GetKind() string
func (*GlobalVariable) GetMetadata ¶ added in v0.31.0
func (v *GlobalVariable) GetMetadata() modelAPI.Metadata
func (*GlobalVariable) GetSpec ¶ added in v0.31.0
func (v *GlobalVariable) GetSpec() interface{}
type Health ¶
type Health struct {
BuildTime string `json:"buildTime"`
Version string `json:"version"`
Commit string `json:"commit"`
Database bool `json:"database"`
}
Health is the struct that provides the health information of the API
type Metadata ¶
type Metadata struct {
Name string `json:"name" yaml:"name"`
CreatedAt time.Time `json:"created_at" yaml:"created_at"`
UpdatedAt time.Time `json:"updated_at" yaml:"updated_at"`
Version uint64 `json:"version" yaml:"version"`
}
func NewMetadata ¶ added in v0.23.0
type Project ¶
type Project struct {
Kind Kind `json:"kind" yaml:"kind"`
Metadata Metadata `json:"metadata" yaml:"metadata"`
Spec ProjectSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
}
func (*Project) GetMetadata ¶
func (*Project) UnmarshalJSON ¶
func (*Project) UnmarshalYAML ¶
type ProjectMetadata ¶
type ProjectMetadata struct {
Metadata `json:",inline" yaml:",inline"`
Project string `json:"project" yaml:"project"`
}
ProjectMetadata is the metadata struct for resources that belongs to a project.
func NewProjectMetadata ¶ added in v0.23.0
func NewProjectMetadata(project string, name string) *ProjectMetadata
func (*ProjectMetadata) GetName ¶
func (m *ProjectMetadata) GetName() string
func (*ProjectMetadata) Update ¶ added in v0.5.0
func (m *ProjectMetadata) Update(previous ProjectMetadata)
type ProjectSpec ¶ added in v0.12.0
type ProjectSpec struct {
}
type Variable ¶ added in v0.31.0
type Variable struct {
Kind Kind `json:"kind" yaml:"kind"`
Metadata ProjectMetadata `json:"metadata" yaml:"metadata"`
Spec VariableSpec `json:"spec" yaml:"spec"`
}
Variable relates to variables defined at project level. If you are looking for variable defined at dashboard level, see dashboard.Variable
func (*Variable) GetMetadata ¶ added in v0.31.0
type VariableSpec ¶ added in v0.31.0
type VariableSpec struct {
// Kind is the type of the variable. Depending on the value of Kind, it will change the content of Spec.
Kind variable.Kind `json:"kind" yaml:"kind"`
Spec interface{} `json:"spec" yaml:"spec"`
}
func (*VariableSpec) UnmarshalJSON ¶ added in v0.31.0
func (v *VariableSpec) UnmarshalJSON(data []byte) error
func (*VariableSpec) UnmarshalYAML ¶ added in v0.31.0
func (v *VariableSpec) UnmarshalYAML(unmarshal func(interface{}) error) error