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() *hclsyntax.Block
- func (c *Config) GetKey() *Key
- func (c *Config) ParseConfig(ctx context.Context, spec *dataspec.RootSpec) (val *dataspec.Block, diags diagnostics.Diag)
- type ConfigEmpty
- type ConfigPtr
- type ConfigResolver
- type Document
- type Dynamic
- type FabricBlock
- type GlobalConfig
- type GlobalConfigDefinition
- type Key
- type MetaBlock
- type ParsedContent
- type ParsedDocument
- type ParsedDynamic
- type ParsedPlugin
- type ParsedSection
- type ParsedVars
- type Plugin
- type PluginRegistry
- type Section
Constants ¶
View Source
const ( BlockKindDocument = "document" BlockKindConfig = "config" BlockKindContent = "content" BlockKindPublish = "publish" BlockKindData = "data" BlockKindMeta = "meta" BlockKindVars = "vars" BlockKindSection = "section" BlockKindGlobalConfig = "fabric" BlockKindDynamic = "dynamic" PluginTypeRef = "ref" AttrRefBase = "base" AttrTitle = "title" AttrDependsOn = "depends_on" AttrLocalVar = "local_var" AttrRequiredVars = "required_vars" AttrIsIncluded = "is_included" AttrDynamicItems = "items" )
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 ¶
type ConfigEmpty struct {
Plugin *Plugin
}
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 *dataspec.Block, diags diagnostics.Diag)
ParseConfig implements Configuration.
type ConfigPtr ¶
Attribute referencing a configuration block (`config = path.to.config`).
type ConfigResolver ¶
type Document ¶
func DefineDocument ¶
func DefineDocument(block *hclsyntax.Block) (doc *Document, diags diagnostics.Diag)
func (*Document) GetHCLBlock ¶
type Dynamic ¶
type Dynamic struct {
ParseResult *ParsedDynamic
}
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() *hclsyntax.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"`
}
func (*MetaBlock) AsPluginData ¶
func (m *MetaBlock) AsPluginData() plugindata.Data
func (*MetaBlock) MatchesTags ¶
type ParsedContent ¶
type ParsedContent struct {
Section *ParsedSection
Plugin *ParsedPlugin
Dynamic *ParsedDynamic
}
type ParsedDocument ¶
type ParsedDocument struct {
Source *Document
Meta *MetaBlock
Vars *ParsedVars
RequiredVars []string
Content []*ParsedContent
Data []*ParsedPlugin
Publish []*ParsedPlugin
}
type ParsedDynamic ¶
type ParsedDynamic struct {
Block *hclsyntax.Block
// Items is a list of items to be iterated over dynamically.
// Always present.
Items *hclsyntax.Attribute
Content []*ParsedContent
}
type ParsedPlugin ¶
type ParsedPlugin struct {
Source *Plugin
PluginName string
BlockName string
Meta *MetaBlock
Config evaluation.Configuration
Invocation *evaluation.BlockInvocation
Vars *ParsedVars
RequiredVars []string
DependsOn []string
IsIncluded *hclsyntax.Attribute
}
type ParsedSection ¶
type ParsedSection struct {
Source *Section
Meta *MetaBlock
Title *ParsedContent
Content []*ParsedContent
Vars *ParsedVars
RequiredVars []string
IsIncluded *hclsyntax.Attribute
}
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 []*dataspec.Attr
ByName map[string]int
}
func (*ParsedVars) AppendVar ¶ added in v0.4.2
func (pv *ParsedVars) AppendVar(variable *dataspec.Attr)
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.