Documentation
¶
Index ¶
- func BuildEvalContext(vars map[string]string, params map[string]string) *hcl.EvalContext
- func CtyValueString(val cty.Value) (string, error)
- func Functions() map[string]function.Function
- func WriteArchive(bs []byte, mimetype string, path string) error
- type Option
- type Parser
- func (p *Parser) CoderParameterDefaults(ctx context.Context, varsDefaults map[string]string, names map[string]struct{}) (map[string]string, error)
- func (p *Parser) TemplateVariables() ([]*proto.TemplateVariable, error)
- func (p *Parser) VariableDefaults(ctx context.Context) (map[string]string, error)
- func (p *Parser) WorkspaceTagDefaults(ctx context.Context) (map[string]string, error)
- func (p *Parser) WorkspaceTags(ctx context.Context) (map[string]string, map[string]struct{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildEvalContext ¶ added in v2.18.2
BuildEvalContext builds an evaluation context for the given variable and parameter defaults.
func CtyValueString ¶ added in v2.18.2
CtyValueString converts a cty.Value to a string. It supports only primitive types - bool, number, and string. As a special case, it also supports map[string]interface{} with key "value".
Types ¶
type Option ¶ added in v2.18.0
type Option func(*Parser)
Option is an option for a new instance of Parser.
func WithLogger ¶ added in v2.18.0
WithLogger sets the logger to be used by Parser
type Parser ¶ added in v2.18.0
type Parser struct {
// contains filtered or unexported fields
}
Parser parses a Terraform module on disk.
func New ¶ added in v2.18.0
func New(workdir string, opts ...Option) (*Parser, tfconfig.Diagnostics)
New returns a new instance of Parser, as well as any diagnostics encountered while parsing the module.
func (*Parser) CoderParameterDefaults ¶ added in v2.18.0
func (p *Parser) CoderParameterDefaults(ctx context.Context, varsDefaults map[string]string, names map[string]struct{}) (map[string]string, error)
CoderParameterDefaults returns the default values of all coder_parameter data sources in the parsed module.
func (*Parser) TemplateVariables ¶ added in v2.18.0
func (p *Parser) TemplateVariables() ([]*proto.TemplateVariable, error)
TemplateVariables returns all of the Terraform variables in the module as TemplateVariables.
func (*Parser) VariableDefaults ¶ added in v2.18.0
VariableDefaults returns the default values for all variables in the module.
func (*Parser) WorkspaceTagDefaults ¶ added in v2.18.0
func (*Parser) WorkspaceTags ¶ added in v2.18.0
WorkspaceTags looks for all coder_workspace_tags datasource in the module and returns the raw values for the tags. It also returns the set of variables referenced by any expressions in the raw values of tags.