@@ -36,7 +36,7 @@ type ListResource interface {
3636
3737 // ListResource is called when the provider must list instances of a
3838 // managed resource type that satisfy a user-provided request.
39- ListResource (context.Context , ListResourceRequest , * ListResourceResponse )
39+ ListResource (context.Context , ListResourceRequest , * ListResourceStream )
4040}
4141
4242// ListResourceWithConfigure is an interface type that extends ListResource to include a method
@@ -105,11 +105,16 @@ type ListResourceRequest struct {
105105 // ClientCapabilities ReadClientCapabilities
106106}
107107
108- // ListResourceResponse represents a response to a ListResourceRequest. An
109- // instance of this response struct is supplied as an argument to the
110- // provider's ListResource function implementation function. The provider
111- // should set an iterator function on the response struct.
112- type ListResourceResponse struct {
108+ // ListResourceStream represents a streaming response to a ListResourceRequest.
109+ // An instance of this struct is supplied as an argument to the provider's
110+ // ListResource function implementation function. The provider should set an
111+ // iterator function on the response struct.
112+ //
113+ // For convenience, a provider implementation may choose to convert a slice of
114+ // results into an iterator using [slices.All].
115+ //
116+ // [slices.All]: https://pkg.go.dev/iter/slices#All
117+ type ListResourceStream struct {
113118 // Results is a function that emits ListResourceEvent values via its yield
114119 // function argument.
115120 Results iter.Seq [ListResourceEvent ]
0 commit comments