parse

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2025 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiagsToErrorsAndWarnings added in v0.2.0

func DiagsToErrorsAndWarnings(errPrefix string, diags hcl.Diagnostics) error_helpers.ErrorAndWarnings

func HclDiagsToError added in v0.2.0

func HclDiagsToError(prefix string, diags hcl.Diagnostics) error

func LoadTailpipeConfig

func LoadTailpipeConfig(v *versionfile.PluginVersionFile) (tailpipeConfig *config.TailpipeConfig, ew error_helpers.ErrorAndWarnings)

LoadTailpipeConfig loads the HCL connection config, resources and workspace profiles

func ParseResourceNameWithSubtype added in v0.2.0

func ParseResourceNameWithSubtype(propertyPath string) (modconfig.ResourceNameParser, error)

ParseResourceNameWithSubtype parses the name of a resource into type name and , where applicable, subtype.

Types

type ConfigParseContext

type ConfigParseContext struct {
	parse.ParseContext
	// contains filtered or unexported fields
}

ConfigParseContext is a parse context that is used to parse the TailpipeConfig

func NewConfigParseContext

func NewConfigParseContext(rootEvalPath string) (*ConfigParseContext, error)

func (*ConfigParseContext) AddDependencies

func (c *ConfigParseContext) AddDependencies(block *hcl.Block, name string, dependencies map[string]*modconfig.ResourceDependency) hcl.Diagnostics

AddDependencies is called when a block could not be resolved as it has dependencies 1) store block as unresolved 2) add dependencies to our tree of dependencies NOTE: this overrides ParseContext.AddDependencies to allwo us to override ParseResourcePropertyPath to handle resource type labels

func (*ConfigParseContext) AddResource

func (c *ConfigParseContext) AddResource(resource modconfig.HclResource) hcl.Diagnostics

AddResource stores this resource as a variable to be added to the eval context.

func (*ConfigParseContext) GetResource

func (c *ConfigParseContext) GetResource(parsedName *modconfig.ParsedResourceName) (resource modconfig.HclResource, found bool)

type ParsedPropertyPath

type ParsedPropertyPath struct {
	Type         string
	SubType      string
	Name         string
	PropertyPath []string
	Original     string
}

ParsedPropertyPath represents a parsed property path for a resource with a subtype

func ParseResourcePropertyPath

func ParseResourcePropertyPath(propertyPath string) (*ParsedPropertyPath, error)

func (*ParsedPropertyPath) PropertyPathString

func (p *ParsedPropertyPath) PropertyPathString() string

func (*ParsedPropertyPath) String

func (p *ParsedPropertyPath) String() string

func (*ParsedPropertyPath) ToResourceName

func (p *ParsedPropertyPath) ToResourceName() string

type ParsedResourceNameWithSubtype added in v0.2.0

type ParsedResourceNameWithSubtype struct {
	Type    string
	SubType string
	Name    string

	Original string
}

ParsedResourceNameWithSubtype represents a parsed property path for a resource with a subtype

func (*ParsedResourceNameWithSubtype) GetItemType added in v0.2.0

func (p *ParsedResourceNameWithSubtype) GetItemType() string

func (*ParsedResourceNameWithSubtype) GetMod added in v0.2.0

func (*ParsedResourceNameWithSubtype) GetName added in v0.2.0

func (*ParsedResourceNameWithSubtype) GetSubType added in v0.2.0

func (p *ParsedResourceNameWithSubtype) GetSubType() string

func (*ParsedResourceNameWithSubtype) String added in v0.2.0

func (*ParsedResourceNameWithSubtype) ToFullName added in v0.2.0

func (p *ParsedResourceNameWithSubtype) ToFullName() string

func (*ParsedResourceNameWithSubtype) ToFullNameWithMod added in v0.2.0

func (p *ParsedResourceNameWithSubtype) ToFullNameWithMod(string) string

func (*ParsedResourceNameWithSubtype) ToResourceName added in v0.2.0

func (p *ParsedResourceNameWithSubtype) ToResourceName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL