Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HCLDiagsFromJSON ¶ added in v0.13.0
func HCLDiagsFromJSON(jsonDiags []tfjson.Diagnostic) map[string]hcl.Diagnostics
tfjson.Diagnostic is a conversion of an internal diag to terraform core, tfdiags, which is effectively based on hcl.Diagnostic. This process is really just converting it back to hcl.Diagnotic since it is the defacto diagnostic type for our codebase currently https://github.com/hashicorp/terraform/blob/ae025248cc0712bf53c675dc2fe77af4276dd5cc/command/validate.go#L138
Types ¶
type ClientNotifier ¶ added in v0.25.0
type Diagnostics ¶ added in v0.20.1
type Diagnostics map[string]map[ast.DiagnosticSource]hcl.Diagnostics
func NewDiagnostics ¶ added in v0.20.1
func NewDiagnostics() Diagnostics
func (Diagnostics) Append ¶ added in v0.20.1
func (d Diagnostics) Append(src ast.DiagnosticSource, diagsMap map[string]hcl.Diagnostics) Diagnostics
func (Diagnostics) EmptyRootDiagnostic ¶ added in v0.20.1
func (d Diagnostics) EmptyRootDiagnostic() Diagnostics
EmptyRootDiagnostic allows emptying any diagnostics for the whole directory which were published previously.
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier is a type responsible for queueing HCL diagnostics to be converted and sent to the client
func NewNotifier ¶
func NewNotifier(clientNotifier ClientNotifier, logger *log.Logger) *Notifier
func (*Notifier) PublishHCLDiags ¶
func (n *Notifier) PublishHCLDiags(ctx context.Context, dirPath string, diags Diagnostics)
PublishHCLDiags accepts a map of HCL diagnostics per file and queues them for publishing. A dir path is passed which is joined with the filename keys of the map, to form a file URI.