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 ¶
Configuration block.
func DefineConfig ¶
func DefineConfig(block *hclsyntax.Block) (config *Config, diags diagnostics.Diag)
func (*Config) ApplicableTo ¶
func (*Config) GetHCLBlock ¶
func (*Config) ParseConfig ¶
ParseConfig implements Configuration.
type ConfigEmpty ¶
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 ¶
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 ¶
type GlobalConfig ¶
type GlobalConfig struct {
CacheDir string `hcl:"cache_dir,optional"`
PluginRegistry *PluginRegistry `hcl:"plugin_registry,block"`
PluginVersions map[string]string `hcl:"plugin_versions,optional"`
}
func (*GlobalConfig) Merge ¶ added in v0.4.0
func (g *GlobalConfig) Merge(other *GlobalConfig)
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) Name ¶ added in v0.4.1
func (c *ParsedContent) Name() string
func (*ParsedContent) Render ¶
func (c *ParsedContent) Render(ctx context.Context, caller evaluation.ContentCaller, dataCtx evaluation.DataContext, result *evaluation.Result, contentID uint32) (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) Name ¶ added in v0.4.1
func (s ParsedSection) Name() string
func (ParsedSection) Render ¶
func (s ParsedSection) Render(ctx context.Context, caller evaluation.ContentCaller, dataCtx evaluation.DataContext, result *evaluation.Result, contentID uint32) (diags diagnostics.Diag)
type PluginRegistry ¶
type Renderable ¶
type Renderable interface {
Name() string
Render(ctx context.Context, caller evaluation.ContentCaller, dataCtx evaluation.DataContext, result *evaluation.Result, contentID uint32) diagnostics.Diag
}
type Section ¶
type Section struct {
Block *hclsyntax.Block
Once sync.Once
Parsed bool
ParseResult *ParsedSection
}
func DefineSection ¶
func (*Section) GetHCLBlock ¶
Click to show internal directories.
Click to hide internal directories.