File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,25 @@ type ListResultsStream struct {
134134// NoListResults is an iterator that pushes zero results.
135135var NoListResults = func (func (ListResult ) bool ) {}
136136
137+ // ListResultsStreamError returns a function that yields a single
138+ // [[ListResult]] with an error diagnostic
139+ func ListResultsStreamError (summary string , detail string ) iter.Seq [ListResult ] {
140+ return func (push func (ListResult ) bool ) {
141+ if ! push (ListResultError (summary , detail )) {
142+ return
143+ }
144+ }
145+ }
146+
147+ // ListResultError constructs a [[ListResult]] with an error diagnostic
148+ func ListResultError (summary string , detail string ) ListResult {
149+ return ListResult {
150+ Diagnostics : diag.Diagnostics {
151+ diag .NewErrorDiagnostic (summary , detail ),
152+ },
153+ }
154+ }
155+
137156// ListResult represents a listed managed resource instance.
138157type ListResult struct {
139158 // Identity is the identity of the managed resource instance.
You can’t perform that action at this time.
0 commit comments