Documentation
¶
Index ¶
- type Initialization
- type PanelCompositionConfig
- type RewriteRule
- func AddOption(selector Selector, newOption veneers.Option) RewriteRule
- func ComposeDashboardPanel(selector Selector, config PanelCompositionConfig) RewriteRule
- func DefaultToConstant(selector Selector, options []string) RewriteRule
- func Duplicate(selector Selector, duplicateName string, excludeOptions []string) RewriteRule
- func Initialize(selector Selector, statements []Initialization) RewriteRule
- func MergeInto(selector Selector, sourceBuilderName string, underPath string, ...) RewriteRule
- func Omit(selector Selector) RewriteRule
- func PromoteOptionsToConstructor(selector Selector, optionNames []string) RewriteRule
- func Properties(selector Selector, properties []ast.StructField) RewriteRule
- func Rename(selector Selector, newName string) RewriteRule
- func VeneerTrailAsComments(selector Selector) RewriteRule
- type Selector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Initialization ¶
type PanelCompositionConfig ¶ added in v0.0.6
type PanelCompositionConfig struct { // PanelBuilderName refers to the builder to use as a source for the // composition. Builders for "composable" objects will be composed into // this source builder following the mapping defined in the CompositionMap // field. // Note: The builder name must follow the [package].[builder_name] pattern. // Example: "dashboard.Panel" PanelBuilderName string // PluginDiscriminatorField contains the name of the field used to identify // the plugin implementing this object. // Example: "type" PluginDiscriminatorField string // Composition map describes how to perform the composition. // Each entry in this map associates a builder (referenced by its name) // to a path under witch the assignments should be performed. // // Example: // “`go // compositionMap := map[string]string{ // "Options": "options", // "FieldConfig": "fieldConfig.defaults.custom", // } // “` CompositionMap map[string]string // ExcludePanelOptions lists option names to exclude in the resulting // composed builders. ExcludePanelOptions []string // ComposedBuilderName configures the name of the newly composed builders. // If left empty, the name is taken from PanelBuilderName. ComposedBuilderName string }
type RewriteRule ¶
func AddOption ¶
func AddOption(selector Selector, newOption veneers.Option) RewriteRule
AddOption adds a completely new option to the selected builders.
func ComposeDashboardPanel ¶
func ComposeDashboardPanel(selector Selector, config PanelCompositionConfig) RewriteRule
func DefaultToConstant ¶
func DefaultToConstant(selector Selector, options []string) RewriteRule
DefaultToConstant sets a default value into a constant. When we unfold a value, omit an option, or any other action; we can lose the default value in the Builder struct. If we parse the defaults using the Builder and not the Schema, we might not have all the defaults and with this rule, we set these defaults as constants inside the constructor.
func Duplicate ¶
func Duplicate(selector Selector, duplicateName string, excludeOptions []string) RewriteRule
func Initialize ¶
func Initialize(selector Selector, statements []Initialization) RewriteRule
func Omit ¶
func Omit(selector Selector) RewriteRule
func PromoteOptionsToConstructor ¶
func PromoteOptionsToConstructor(selector Selector, optionNames []string) RewriteRule
PromoteOptionsToConstructor promotes the given options as constructor parameters. Both arguments and assignments described by the options will be exposed in the builder's constructor.
func Properties ¶
func Properties(selector Selector, properties []ast.StructField) RewriteRule
func Rename ¶
func Rename(selector Selector, newName string) RewriteRule
func VeneerTrailAsComments ¶
func VeneerTrailAsComments(selector Selector) RewriteRule
type Selector ¶
func ByName ¶
ByName matches builders for the given name. Note: the comparison on builder name is case-insensitive.
func ByObjectName ¶
ByObjectName matches builders for the given the object (referred to by its package and name). Note: the comparison on object name is case-insensitive.
func ComposableDashboardPanel ¶
func ComposableDashboardPanel() Selector
ComposableDashboardPanel matches builders for Panel variants.
func StructGeneratedFromDisjunction ¶
func StructGeneratedFromDisjunction() Selector
StructGeneratedFromDisjunction matches builders for structs that were generated from a disjunction (see the Disjunction compiler pass).