Documentation ¶
Index ¶
- Constants
- type Diag
- func GetBadProviderError(urn resource.URN) *Diag
- func GetCannotDeleteParentResourceWithoutAlsoDeletingChildError(urn resource.URN) *Diag
- func GetDefaultProviderDenied(urn resource.URN) *Diag
- func GetDuplicateResourceAliasError(urn resource.URN) *Diag
- func GetDuplicateResourceAliasedError(urn resource.URN) *Diag
- func GetDuplicateResourceURNError(urn resource.URN) *Diag
- func GetPreviewFailedError(urn resource.URN) *Diag
- func GetResourceInvalidError(urn resource.URN) *Diag
- func GetResourceOperationFailedError(urn resource.URN) *Diag
- func GetResourcePropertyInvalidValueError(urn resource.URN) *Diag
- func GetResourceWillBeCreatedButWasNotSpecifiedInTargetList(urn resource.URN) *Diag
- func GetResourceWillBeDestroyedButWasNotSpecifiedInTargetList(urn resource.URN) *Diag
- func GetTargetCouldNotBeFoundDidYouForgetError() *Diag
- func GetTargetCouldNotBeFoundError() *Diag
- func GetUnknownProviderError(urn resource.URN) *Diag
- func Message(urn resource.URN, msg string) *Diag
- func RawMessage(urn resource.URN, msg string) *Diag
- func StreamMessage(urn resource.URN, msg string, streamID int32) *Diag
- type FormatOptions
- type ID
- type Severity
- type Sink
Constants ¶
const DefaultSinkIDPrefix = "PU"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diag ¶
type Diag struct { URN resource.URN // Resource this diagnostics is associated with. Empty if not associated with any resource. ID ID // a unique identifier for this diagnostic. Message string // a human-friendly message for this diagnostic. Raw bool // true if this diagnostic should not be formatted when displayed. // An ID used to collate a stream of conceptually sequential messages. 0 means that the message // is not part of any sequential message stream. StreamID int32 }
Diag is an instance of an error or warning generated by the compiler.
func GetBadProviderError ¶
func GetDefaultProviderDenied ¶ added in v3.23.0
func GetDuplicateResourceAliasedError ¶ added in v3.46.0
func GetPreviewFailedError ¶
func GetResourceInvalidError ¶
func GetTargetCouldNotBeFoundDidYouForgetError ¶
func GetTargetCouldNotBeFoundDidYouForgetError() *Diag
func GetTargetCouldNotBeFoundError ¶
func GetTargetCouldNotBeFoundError() *Diag
func GetUnknownProviderError ¶
func Message ¶
Message returns an anonymous diagnostic message without any source or ID information.
func RawMessage ¶
RawMessage returns an anonymous diagnostic message without any source or ID information that will not be rendered with Sprintf.
func StreamMessage ¶
StreamMessage returns an anonymous diagnostic message without any source or ID information that is associated with the given stream ID. Displays can use this ID to combine all the messages from a single stream into an entire message, while still rendering the pieces as they come in.
type FormatOptions ¶
type FormatOptions struct { Pwd string // the working directory. Color colors.Colorization // how output should be colorized. Debug bool // if true, debugging will be output to stdout. }
FormatOptions controls the output style and content.
type Sink ¶
type Sink interface { // Logf issues a log message. Logf(sev Severity, diag *Diag, args ...interface{}) // Debugf issues a debugging message. Debugf(diag *Diag, args ...interface{}) // Infof issues an informational message (to stdout). Infof(diag *Diag, args ...interface{}) // Infoerrf issues an informational message (to stderr). Infoerrf(diag *Diag, args ...interface{}) // Errorf issues a new error diagnostic. Errorf(diag *Diag, args ...interface{}) // Warningf issues a new warning diagnostic. Warningf(diag *Diag, args ...interface{}) // Stringify stringifies a diagnostic into a prefix and message that is appropriate for printing. Stringify(sev Severity, diag *Diag, args ...interface{}) (string, string) }
Sink facilitates pluggable diagnostics messages.
func DefaultSink ¶
DefaultSink returns a default sink that simply logs output to stderr/stdout.