dashboard

package
v11.1.4-modfix Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEntitySummaryBuilder

func GetEntitySummaryBuilder() entity.EntitySummaryBuilder

This summary does not resolve old name as UID

func NewStaticDashboardSummaryBuilder

func NewStaticDashboardSummaryBuilder(lookup DatasourceLookup, sanitize bool) entity.EntitySummaryBuilder

This implementation moves datasources referenced by internal ID or name to UID

Types

type DataSourceRef

type DataSourceRef struct {
	UID  string `json:"uid,omitempty"`
	Type string `json:"type,omitempty"`
}

type DatasourceLookup

type DatasourceLookup interface {
	// ByRef will return the default DS given empty reference (nil ref, or empty ref.uid and ref.type)
	ByRef(ref *DataSourceRef) *DataSourceRef
	ByType(dsType string) []DataSourceRef
}

func CreateDatasourceLookup

func CreateDatasourceLookup(rows []*DatasourceQueryResult) DatasourceLookup

func LoadDatasourceLookup

func LoadDatasourceLookup(ctx context.Context, orgID int64, sql db.DB) (DatasourceLookup, error)

type DatasourceQueryResult

type DatasourceQueryResult struct {
	UID       string `xorm:"uid"`
	Type      string `xorm:"type"`
	Name      string `xorm:"name"`
	IsDefault bool   `xorm:"is_default"`
}

type DsLookup

type DsLookup struct {
	// contains filtered or unexported fields
}

func (*DsLookup) ByRef

func (d *DsLookup) ByRef(ref *DataSourceRef) *DataSourceRef

func (*DsLookup) ByType

func (d *DsLookup) ByType(dsType string) []DataSourceRef

type ReferenceAccumulator

type ReferenceAccumulator interface {
	// Add references as we find them
	Add(family string, ttype string, id string)

	// Returns the set of distinct references in a sorted order
	Get() []*entity.EntityExternalReference
}

A reference accumulator can combine

func NewReferenceAccumulator

func NewReferenceAccumulator() ReferenceAccumulator

Jump to

Keyboard shortcuts

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