Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CoremodelSet = wire.NewSet( NewBase, )
CoremodelSet contains all of the wire-style providers related to coremodels.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base is a registry of coremodel.Interface. It provides two modes for accessing coremodels: individually via literal named methods, or as a slice returned from All().
Prefer the individual named methods for use cases where the particular coremodel(s) that are needed are known to the caller. For example, a dashboard linter can know that it specifically wants the dashboard coremodel.
Prefer All() when performing operations generically across all coremodels. For example, a validation HTTP middleware for any coremodel-schematized object type.
func NewBase ¶
func NewBase() *Base
NewBase provides a registry of all coremodels, without any composition of plugin-defined schemas.
The returned registry will use the default Grafana thema.Library, defined in pkg/cuectx. If you need control over the thema.Library used by the coremodel lineages, use NewBaseWithLib instead.
func NewBaseWithLib ¶
NewBaseWithLib is the same as NewBase, but allows control over the thema.Library used to initialize the underlying coremodels.
Prefer NewBase unless you absolutely need this control.
func (*Base) All ¶
All returns a slice of all registered coremodels.
Prefer this method when operating generically across all coremodels.
The returned slice is sorted lexicographically by coremodel name. It should not be modified.
func (*Base) Dashboard ¶
Dashboard returns the dashboard coremodel. The return value is guaranteed to implement coremodel.Interface.
func (*Base) Playlist ¶
Playlist returns the playlist coremodel. The return value is guaranteed to implement coremodel.Interface.
func (*Base) Pluginmeta ¶
func (b *Base) Pluginmeta() *pluginmeta.Coremodel
Pluginmeta returns the pluginmeta coremodel. The return value is guaranteed to implement coremodel.Interface.