Documentation
¶
Index ¶
- Constants
- Variables
- 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(ctx context.Context, spec dataspec.RootSpec) (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 GlobalConfigDefinition
- type Key
- type MetaBlock
- type ParsedContent
- type ParsedDocument
- type ParsedPlugin
- type ParsedSection
- type ParsedVars
- type Plugin
- type PluginRegistry
- type Section
- type Variable
Constants ¶
View Source
const ( BlockKindDocument = "document" BlockKindConfig = "config" BlockKindContent = "content" BlockKindPublish = "publish" BlockKindData = "data" BlockKindMeta = "meta" BlockKindVars = "vars" BlockKindSection = "section" BlockKindGlobalConfig = "fabric" PluginTypeRef = "ref" AttrRefBase = "base" AttrTitle = "title" AttrLocalVar = "local_var" )
View Source
const LocalVarName = "local"
Variables ¶
View Source
var DefaultEnvVarsPattern = glob.MustCompile("FABRIC_*")
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 ¶
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(ctx context.Context, spec dataspec.RootSpec) (val cty.Value, diags diagnostics.Diag)
ParseConfig implements Configuration.
type ConfigPtr ¶
Attribute referencing a configuration block (`config = path.to.config`).
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"`
EnvVarsPattern glob.Glob
}
func (*GlobalConfig) Merge ¶ added in v0.4.0
func (g *GlobalConfig) Merge(other *GlobalConfig)
type GlobalConfigDefinition ¶ added in v0.4.2
type GlobalConfigDefinition struct {
// contains filtered or unexported fields
}
func DefineGlobalConfig ¶
func DefineGlobalConfig(block *hclsyntax.Block) (config *GlobalConfigDefinition, diags diagnostics.Diag)
func (*GlobalConfigDefinition) GetHCLBlock ¶ added in v0.4.2
func (g *GlobalConfigDefinition) GetHCLBlock() *hcl.Block
func (*GlobalConfigDefinition) Parse ¶ added in v0.4.2
func (g *GlobalConfigDefinition) Parse(ctx context.Context) (cfg *GlobalConfig, diags diagnostics.Diag)
type MetaBlock ¶
type MetaBlock struct {
Name string `hcl:"name,optional"`
Description string `hcl:"description,optional"`
Url string `hcl:"url,optional"`
License string `hcl:"license,optional"`
Authors []string `hcl:"authors,optional"`
Tags []string `hcl:"tags,optional"`
UpdatedAt string `hcl:"updated_at,optional"`
Version string `hcl:"version,optional"`
}
type ParsedContent ¶
type ParsedContent struct {
Section *ParsedSection
Plugin *ParsedPlugin
}
func NewTitle ¶
func NewTitle(title *hclsyntax.Attribute, resolver ConfigResolver) *ParsedContent
type ParsedDocument ¶
type ParsedDocument struct {
Meta *MetaBlock
Vars *ParsedVars
Content []*ParsedContent
Data []*ParsedPlugin
Publish []*ParsedPlugin
}
type ParsedPlugin ¶
type ParsedPlugin struct {
PluginName string
BlockName string
Meta *MetaBlock
Config evaluation.Configuration
Invocation evaluation.Invocation
Vars *ParsedVars
}
func (*ParsedPlugin) GetBlockInvocation ¶
func (pe *ParsedPlugin) GetBlockInvocation() *evaluation.BlockInvocation
type ParsedSection ¶
type ParsedSection struct {
Meta *MetaBlock
Title *ParsedContent
Content []*ParsedContent
Vars *ParsedVars
}
func (ParsedSection) Name ¶ added in v0.4.1
func (s ParsedSection) Name() string
type ParsedVars ¶ added in v0.4.2
type ParsedVars struct {
// stored in the order of definition
Variables []*Variable
ByName map[string]int
}
func (*ParsedVars) AppendVar ¶ added in v0.4.2
func (pv *ParsedVars) AppendVar(variable *Variable)
AppendVar append a variable to the parsed vars struct (last in evaluation order).
func (*ParsedVars) Empty ¶ added in v0.4.2
func (pv *ParsedVars) Empty() bool
func (*ParsedVars) MergeWithBaseVars ¶ added in v0.4.2
func (pv *ParsedVars) MergeWithBaseVars(baseVars *ParsedVars) *ParsedVars
MergeWithBaseVars handles merging with vars from ref base. Shadowing has different rules, and will be handled at the evaluation stage.
type PluginRegistry ¶
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.