diff options
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/tfdiags/diagnostic_base.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/tfdiags/diagnostic_base.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform/tfdiags/diagnostic_base.go b/vendor/github.com/hashicorp/terraform/tfdiags/diagnostic_base.go new file mode 100644 index 0000000..50bf9d8 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/tfdiags/diagnostic_base.go | |||
@@ -0,0 +1,31 @@ | |||
1 | package tfdiags | ||
2 | |||
3 | // diagnosticBase can be embedded in other diagnostic structs to get | ||
4 | // default implementations of Severity and Description. This type also | ||
5 | // has default implementations of Source and FromExpr that return no source | ||
6 | // location or expression-related information, so embedders should generally | ||
7 | // override those method to return more useful results where possible. | ||
8 | type diagnosticBase struct { | ||
9 | severity Severity | ||
10 | summary string | ||
11 | detail string | ||
12 | } | ||
13 | |||
14 | func (d diagnosticBase) Severity() Severity { | ||
15 | return d.severity | ||
16 | } | ||
17 | |||
18 | func (d diagnosticBase) Description() Description { | ||
19 | return Description{ | ||
20 | Summary: d.summary, | ||
21 | Detail: d.detail, | ||
22 | } | ||
23 | } | ||
24 | |||
25 | func (d diagnosticBase) Source() Source { | ||
26 | return Source{} | ||
27 | } | ||
28 | |||
29 | func (d diagnosticBase) FromExpr() *FromExpr { | ||
30 | return nil | ||
31 | } | ||