Documentation
¶
Index ¶
- Variables
- func GenerateDashboardID(project string, name string) string
- func GenerateDatasourceID(project string, name string) string
- func GenerateFolderID(project string, name string) string
- func GenerateGlobalDatasourceID(name string) string
- func GenerateProjectID(name string) string
- func GenerateUserID(name string) string
- func GetStruct(kind Kind) (modelAPI.Entity, error)
- type Dashboard
- type DashboardSpec
- type Datasource
- type DatasourceSpec
- type Folder
- type FolderSpec
- type GlobalDatasource
- type Health
- type Kind
- type Metadata
- type Project
- type ProjectMetadata
- type User
- type UserSpec
Constants ¶
This section is empty.
Variables ¶
View Source
var KindMap = map[Kind]bool{ KindDashboard: true, KindDatasource: true, KindFolder: true, KindGlobalDatasource: true, KindProject: true, KindUser: true, }
Functions ¶
func GenerateDashboardID ¶
func GenerateDatasourceID ¶
func GenerateFolderID ¶
func GenerateProjectID ¶
func GenerateUserID ¶
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) GenerateID ¶
func (*Dashboard) GetMetadata ¶
func (*Dashboard) UnmarshalJSON ¶
func (*Dashboard) UnmarshalYAML ¶
type DashboardSpec ¶
type DashboardSpec struct {
// Datasource is a set of values that will be used to find the datasource definition.
Datasource dashboard.Datasource `json:"datasource" yaml:"datasource"`
// 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 map[string]*dashboard.Variable `json:"variables,omitempty" yaml:"variables,omitempty"`
Panels map[string]json.RawMessage `json:"panels" yaml:"panels"` // kept as raw json as the validation is done with cuelang
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) GenerateID ¶
func (d *Datasource) GenerateID() string
func (*Datasource) GetKind ¶
func (d *Datasource) GetKind() string
func (*Datasource) GetMetadata ¶
func (d *Datasource) GetMetadata() modelAPI.Metadata
func (*Datasource) UnmarshalJSON ¶
func (d *Datasource) UnmarshalJSON(data []byte) error
func (*Datasource) UnmarshalYAML ¶
func (d *Datasource) UnmarshalYAML(unmarshal func(interface{}) error) error
type DatasourceSpec ¶
type DatasourceSpec interface {
GetKind() datasource.Kind
}
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) GenerateID ¶
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) GenerateID ¶
func (d *GlobalDatasource) GenerateID() string
func (*GlobalDatasource) GetKind ¶
func (d *GlobalDatasource) GetKind() string
func (*GlobalDatasource) GetMetadata ¶
func (d *GlobalDatasource) GetMetadata() modelAPI.Metadata
func (*GlobalDatasource) UnmarshalJSON ¶
func (d *GlobalDatasource) UnmarshalJSON(data []byte) error
func (*GlobalDatasource) UnmarshalYAML ¶
func (d *GlobalDatasource) UnmarshalYAML(unmarshal func(interface{}) error) error
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 Project ¶
type Project struct {
Kind Kind `json:"kind" yaml:"kind"`
Metadata Metadata `json:"metadata" yaml:"metadata"`
}
func (*Project) GenerateID ¶
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 (*ProjectMetadata) GetName ¶
func (m *ProjectMetadata) GetName() string
func (*ProjectMetadata) Update ¶ added in v0.5.0
func (m *ProjectMetadata) Update(previous ProjectMetadata)
type User ¶
type User struct {
Kind Kind `json:"kind" yaml:"kind"`
Metadata Metadata `json:"metadata" yaml:"metadata"`
Spec UserSpec `json:"spec" yaml:"spec"`
}
func (*User) GenerateID ¶
func (*User) GetMetadata ¶
func (*User) UnmarshalJSON ¶
func (*User) UnmarshalYAML ¶
type UserSpec ¶
type UserSpec struct {
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
Password []byte `json:"password,omitempty"`
}
func (*UserSpec) UnmarshalJSON ¶
func (*UserSpec) UnmarshalYAML ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.