]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blob - vendor/github.com/hashicorp/terraform/tfdiags/diagnostic.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / terraform / tfdiags / diagnostic.go
1 package tfdiags
2
3 import (
4 "github.com/hashicorp/hcl2/hcl"
5 )
6
7 type Diagnostic interface {
8 Severity() Severity
9 Description() Description
10 Source() Source
11
12 // FromExpr returns the expression-related context for the diagnostic, if
13 // available. Returns nil if the diagnostic is not related to an
14 // expression evaluation.
15 FromExpr() *FromExpr
16 }
17
18 type Severity rune
19
20 //go:generate stringer -type=Severity
21
22 const (
23 Error Severity = 'E'
24 Warning Severity = 'W'
25 )
26
27 type Description struct {
28 Summary string
29 Detail string
30 }
31
32 type Source struct {
33 Subject *SourceRange
34 Context *SourceRange
35 }
36
37 type FromExpr struct {
38 Expression hcl.Expression
39 EvalContext *hcl.EvalContext
40 }