(channel NetworkChannelDetailRecord)
| 1273 | } |
| 1274 | |
| 1275 | func networkChannelBundle(channel NetworkChannelDetailRecord) outputBundle { |
| 1276 | fields := []string{ |
| 1277 | networkChannelKey, |
| 1278 | automationWorkspaceIDKey, |
| 1279 | "purpose", |
| 1280 | createdByKey, |
| 1281 | "peer_count", |
| 1282 | "session_count", |
| 1283 | networkMessageCountKey, |
| 1284 | } |
| 1285 | values := []string{ |
| 1286 | channel.Channel, |
| 1287 | channel.WorkspaceID, |
| 1288 | channel.Purpose, |
| 1289 | channel.CreatedBy, |
| 1290 | strconv.Itoa(channel.PeerCount), |
| 1291 | strconv.Itoa(channel.SessionCount), |
| 1292 | strconv.Itoa(channel.MessageCount), |
| 1293 | } |
| 1294 | return outputBundle{ |
| 1295 | jsonValue: channel, |
| 1296 | human: func() (string, error) { |
| 1297 | return renderHumanBlocks( |
| 1298 | renderHumanSection("Network Channel", []keyValue{ |
| 1299 | {Label: networkChannelValue, Value: stringOrDash(channel.Channel)}, |
| 1300 | {Label: networkWorkspaceValue, Value: stringOrDash(channel.WorkspaceID)}, |
| 1301 | {Label: "Purpose", Value: stringOrDash(channel.Purpose)}, |
| 1302 | {Label: networkCreatedByValue, Value: stringOrDash(channel.CreatedBy)}, |
| 1303 | {Label: "Peers", Value: strconv.Itoa(channel.PeerCount)}, |
| 1304 | {Label: "Sessions", Value: strconv.Itoa(channel.SessionCount)}, |
| 1305 | {Label: networkMessagesValue, Value: strconv.Itoa(channel.MessageCount)}, |
| 1306 | }), |
| 1307 | ), nil |
| 1308 | }, |
| 1309 | toon: func() (string, error) { |
| 1310 | return renderToonObject("network_channel", fields, values), nil |
| 1311 | }, |
| 1312 | } |
| 1313 | } |
| 1314 | |
| 1315 | func networkSubscriptionsBundle(subscriptions []NetworkSubscriptionRecord) outputBundle { |
| 1316 | return listBundle( |
no test coverage detected