(work NetworkWorkRecord)
| 1618 | } |
| 1619 | |
| 1620 | func networkWorkBundle(work NetworkWorkRecord) outputBundle { |
| 1621 | return outputBundle{ |
| 1622 | jsonValue: contract.NetworkWorkResponse{Work: work}, |
| 1623 | human: func() (string, error) { |
| 1624 | return renderHumanSection("Network Work", []keyValue{ |
| 1625 | {Label: "Work ID", Value: stringOrDash(work.WorkID)}, |
| 1626 | {Label: networkChannelValue, Value: stringOrDash(work.Channel)}, |
| 1627 | {Label: networkSurfaceValue, Value: stringOrDash(work.Surface)}, |
| 1628 | {Label: networkThreadIDValue, Value: stringOrDash(work.ThreadID)}, |
| 1629 | {Label: networkDirectIDValue, Value: stringOrDash(work.DirectID)}, |
| 1630 | {Label: networkOpenedByValue, Value: stringOrDash(work.OpenedByPeerID)}, |
| 1631 | {Label: "Opened Session", Value: stringOrDash(work.OpenedSessionID)}, |
| 1632 | {Label: "Target Peer", Value: stringOrDash(work.TargetPeerID)}, |
| 1633 | {Label: networkStateValue, Value: stringOrDash(work.State)}, |
| 1634 | {Label: networkOpenedAtValue, Value: stringOrDash(formatTimePtr(work.OpenedAt))}, |
| 1635 | {Label: networkLastActivityValue, Value: stringOrDash(formatTimePtr(work.LastActivityAt))}, |
| 1636 | {Label: "Terminal At", Value: stringOrDash(formatTimePtr(work.TerminalAt))}, |
| 1637 | }), nil |
| 1638 | }, |
| 1639 | toon: func() (string, error) { |
| 1640 | return renderToonObject( |
| 1641 | "network_work", |
| 1642 | []string{ |
| 1643 | networkWorkIDKey, |
| 1644 | networkChannelKey, |
| 1645 | networkSurfaceKey, |
| 1646 | networkThreadIDKey, |
| 1647 | networkDirectIDKey, |
| 1648 | networkOpenedByPeerIDKey, |
| 1649 | "opened_session_id", |
| 1650 | "target_peer_id", |
| 1651 | networkStateKey, |
| 1652 | networkOpenedAtKey, |
| 1653 | networkLastActivityAtKey, |
| 1654 | "terminal_at", |
| 1655 | }, |
| 1656 | []string{ |
| 1657 | work.WorkID, |
| 1658 | work.Channel, |
| 1659 | work.Surface, |
| 1660 | work.ThreadID, |
| 1661 | work.DirectID, |
| 1662 | work.OpenedByPeerID, |
| 1663 | work.OpenedSessionID, |
| 1664 | work.TargetPeerID, |
| 1665 | work.State, |
| 1666 | formatTimePtr(work.OpenedAt), |
| 1667 | formatTimePtr(work.LastActivityAt), |
| 1668 | formatTimePtr(work.TerminalAt), |
| 1669 | }, |
| 1670 | ), nil |
| 1671 | }, |
| 1672 | } |
| 1673 | } |
| 1674 | |
| 1675 | func networkSendBundle(message NetworkSendRecord) outputBundle { |
| 1676 | return outputBundle{ |
no test coverage detected