(deps commandDeps, workspaceRef *string)
| 193 | } |
| 194 | |
| 195 | func newNetworkChannelsCommand(deps commandDeps, workspaceRef *string) *cobra.Command { |
| 196 | cmd := &cobra.Command{ |
| 197 | Use: networkChannelsKey, |
| 198 | Short: "List active runtime channels", |
| 199 | RunE: func(cmd *cobra.Command, _ []string) error { |
| 200 | client, err := clientFromDeps(deps) |
| 201 | if err != nil { |
| 202 | return err |
| 203 | } |
| 204 | workspace, err := resolveNetworkWorkspaceRef(cmd, deps, client, workspaceRef) |
| 205 | if err != nil { |
| 206 | return err |
| 207 | } |
| 208 | |
| 209 | channels, err := client.NetworkChannels(cmd.Context(), workspace) |
| 210 | if err != nil { |
| 211 | return err |
| 212 | } |
| 213 | return writeCommandOutput(cmd, networkChannelsBundle(channels)) |
| 214 | }, |
| 215 | } |
| 216 | cmd.AddCommand(newNetworkChannelsCreateCommand(deps, workspaceRef)) |
| 217 | cmd.AddCommand(newNetworkChannelsUpdateCommand(deps, workspaceRef)) |
| 218 | return cmd |
| 219 | } |
| 220 | |
| 221 | type networkCreateChannelFlags struct { |
| 222 | channel string |
no test coverage detected