diagnostics

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: MPL-2.0 Imports: 10 Imported by: 0

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 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(sessCtx context.Context, logger *log.Logger) *Notifier

func (*Notifier) PublishHCLDiags

func (n *Notifier) PublishHCLDiags(ctx context.Context, dirPath string, diags map[string]hcl.Diagnostics, source string)

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. A source string is passed and set for each diagnostic, this is typically displayed in the client UI.

Jump to

Keyboard shortcuts

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