Documentation ¶
Index ¶
- Constants
- func NewNestingDiag(what string, block *hclsyntax.Block, body *hclsyntax.Body, ...) *hcl.Diagnostic
- func ToCtyValue(b FabricBlock) cty.Value
- type Config
- func (c *Config) ApplicableTo(plugin *Plugin) bool
- func (c *Config) CtyType() cty.Type
- func (c *Config) Exists() bool
- func (c *Config) GetHCLBlock() *hcl.Block
- func (c *Config) GetKey() *Key
- func (c *Config) ParseConfig(spec hcldec.Spec) (val cty.Value, diags diagnostics.Diag)
- func (c *Config) Range() hcl.Range
- type ConfigEmpty
- type ConfigPtr
- type ConfigResolver
- type Document
- type FabricBlock
- type GlobalConfig
- type Key
- type MetaBlock
- type ParsedContent
- type ParsedData
- type ParsedDocument
- type ParsedPlugin
- type ParsedSection
- type Plugin
- type PluginRegistry
- type Renderable
- type Section
Constants ¶
View Source
const ( BlockKindDocument = "document" BlockKindConfig = "config" BlockKindContent = "content" BlockKindData = "data" BlockKindMeta = "meta" BlockKindSection = "section" BlockKindGlobalConfig = "fabric" PluginTypeRef = "ref" AttrRefBase = "base" AttrTitle = "title" )
Variables ¶
This section is empty.
Functions ¶
func NewNestingDiag ¶
func ToCtyValue ¶
func ToCtyValue(b FabricBlock) cty.Value
Types ¶
type Config ¶
type Config struct { *hcl.Block // contains filtered or unexported fields }
Configuration block.
func DefineConfig ¶
func DefineConfig(block *hclsyntax.Block) (config *Config, diags diagnostics.Diag)
func (*Config) ApplicableTo ¶
func (*Config) GetHCLBlock ¶
func (c *Config) GetHCLBlock() *hcl.Block
func (*Config) ParseConfig ¶
ParseConfig implements Configuration.
type ConfigEmpty ¶
type ConfigEmpty struct {
MissingItemRange hcl.Range
}
Empty config, storing the range of the original block
func (*ConfigEmpty) Exists ¶
func (c *ConfigEmpty) Exists() bool
Exists implements evaluation.Configuration.
func (*ConfigEmpty) ParseConfig ¶
func (c *ConfigEmpty) ParseConfig(spec hcldec.Spec) (val cty.Value, diags diagnostics.Diag)
ParseConfig implements Configuration.
type ConfigPtr ¶
type ConfigPtr struct { Cfg *Config Ptr *hcl.Attribute }
Attribute referencing a configuration block (`config = path.to.config`).
func (*ConfigPtr) ParseConfig ¶
ParseConfig implements Configuration.
type ConfigResolver ¶
type Document ¶
Document and section are very similar conceptually.
func DefineDocument ¶
func DefineDocument(block *hclsyntax.Block) (doc *Document, diags diagnostics.Diag)
func (*Document) GetHCLBlock ¶
func (d *Document) GetHCLBlock() *hcl.Block
type FabricBlock ¶
type GlobalConfig ¶
type GlobalConfig struct { CacheDir string PluginRegistry *PluginRegistry PluginVersions map[string]string // contains filtered or unexported fields }
func DefineGlobalConfig ¶
func DefineGlobalConfig(block *hclsyntax.Block) (cfg *GlobalConfig, diags diagnostics.Diag)
type MetaBlock ¶
type ParsedContent ¶
type ParsedContent ParsedPlugin
func NewTitle ¶
func NewTitle(title *hclsyntax.Attribute, resolver ConfigResolver) *ParsedContent
func (*ParsedContent) EvalQuery ¶
func (c *ParsedContent) EvalQuery(dataCtx *evaluation.DataContext) (diags diagnostics.Diag)
func (*ParsedContent) Render ¶
func (c *ParsedContent) Render(ctx context.Context, caller evaluation.ContentCaller, dataCtx evaluation.DataContext, result *evaluation.Result) (diags diagnostics.Diag)
Render implements Renderable.
type ParsedData ¶
type ParsedData ParsedPlugin
type ParsedDocument ¶
type ParsedDocument struct { Meta *MetaBlock Content []Renderable Data []*ParsedData }
func (*ParsedDocument) Render ¶
func (d *ParsedDocument) Render(ctx context.Context, caller evaluation.PluginCaller) (result []string, diags diagnostics.Diag)
type ParsedPlugin ¶
type ParsedPlugin struct { PluginName string BlockName string Meta *MetaBlock Config evaluation.Configuration Invocation evaluation.Invocation }
func (*ParsedPlugin) GetBlockInvocation ¶
func (pe *ParsedPlugin) GetBlockInvocation() *evaluation.BlockInvocation
type ParsedSection ¶
type ParsedSection struct { Meta *MetaBlock Title *ParsedContent Content []Renderable }
func (ParsedSection) Render ¶
func (s ParsedSection) Render(ctx context.Context, caller evaluation.ContentCaller, dataCtx evaluation.DataContext, result *evaluation.Result) (diags diagnostics.Diag)
type Plugin ¶
func DefinePlugin ¶
func (*Plugin) GetHCLBlock ¶
func (p *Plugin) GetHCLBlock() *hcl.Block
type PluginRegistry ¶
type PluginRegistry struct {
MirrorDir string
}
type Renderable ¶
type Renderable interface {
Render(ctx context.Context, caller evaluation.ContentCaller, dataCtx evaluation.DataContext, result *evaluation.Result) diagnostics.Diag
}
type Section ¶
type Section struct { Block *hclsyntax.Block Once sync.Once Parsed bool ParseResult *ParsedSection }
func DefineSection ¶
func (*Section) GetHCLBlock ¶
func (s *Section) GetHCLBlock() *hcl.Block
Click to show internal directories.
Click to hide internal directories.