Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetQuerySchema ¶
func GetQuerySchema(opts QuerySchemaOptions) (*spec.Schema, error)
Given definitions for a plugin, return a valid spec
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
SchemaBuilder is a helper function that can be used by backend build processes to produce static schema definitions This is not intended as runtime code, and is not the only way to produce a schema (we may also want/need to use typescript as the source)
func NewSchemaBuilder ¶
func NewSchemaBuilder(opts BuilderOptions) (*Builder, error)
func (*Builder) AddQueries ¶
func (b *Builder) AddQueries(inputs ...QueryTypeInfo) error
func (*Builder) UpdateQueryDefinition ¶
Update the schema definition file When placed in `static/schema/query.types.json` folder of a plugin distribution, it can be used to advertise various query types If the spec contents have changed, the test will fail (but still update the output)
type BuilderOptions ¶
type QuerySchemaOptions ¶
type QuerySchemaOptions struct { PluginID []string QueryTypes []sdkapi.QueryTypeDefinition Mode SchemaType }
type QueryTypeInfo ¶
type QueryTypeInfo struct { // The management name Name string // Optional description Description string // Optional discriminators Discriminators []sdkapi.DiscriminatorFieldValue // Raw GO type used for reflection GoType reflect.Type // Add sample queries Examples []sdkapi.QueryExample }
type SchemaType ¶
type SchemaType string
Supported expression types +enum
const ( // Single query target saved in a dashboard/panel/alert JSON SchemaTypeSaveModel SchemaType = "save" // Single query payload included in a query request SchemaTypeQueryPayload SchemaType = "payload" // Pseudo panel model including multiple targets (not mixed) SchemaTypePanelModel SchemaType = "panel" // Query request against a single data source (not mixed) SchemaTypeQueryRequest SchemaType = "request" )
type SettingTypeInfo ¶
Click to show internal directories.
Click to hide internal directories.