Resources provides an iterator for all resources available on the server, automatically fetching pages and managing cursors. The params argument can set the initial cursor. Iteration stops at the first encountered error, which will be yielded.
(ctx context.Context, params *ListResourcesParams)
| 1125 | // The params argument can set the initial cursor. |
| 1126 | // Iteration stops at the first encountered error, which will be yielded. |
| 1127 | func (cs *ClientSession) Resources(ctx context.Context, params *ListResourcesParams) iter.Seq2[*Resource, error] { |
| 1128 | if params == nil { |
| 1129 | params = &ListResourcesParams{} |
| 1130 | } |
| 1131 | return paginate(ctx, params, cs.ListResources, func(res *ListResourcesResult) []*Resource { |
| 1132 | return res.Resources |
| 1133 | }) |
| 1134 | } |
| 1135 | |
| 1136 | // ResourceTemplates provides an iterator for all resource templates available on the server, |
| 1137 | // automatically fetching pages and managing cursors. |