MCPcopy Index your code
hub / github.com/coder/coder / peerToHTML

Function peerToHTML

enterprise/tailnet/htmldebug.go:101–114  ·  view source on GitHub ↗
(d database.TailnetPeer, now time.Time)

Source from the content-addressed store, hash-verified

99}
100
101func peerToHTML(d database.TailnetPeer, now time.Time) (*HTMLPeer, error) {
102 node := &proto.Node{}
103 err := gProto.Unmarshal(d.Node, node)
104 if err != nil {
105 return nil, xerrors.Errorf("unmarshal node: %w", err)
106 }
107 return &HTMLPeer{
108 ID: d.ID,
109 CoordinatorID: d.CoordinatorID,
110 LastWriteAge: now.Sub(d.UpdatedAt),
111 Status: d.Status,
112 Node: node.String(),
113 }, nil
114}
115
116func tunnelToHTML(d database.TailnetTunnel, now time.Time) *HTMLTunnel {
117 return &HTMLTunnel{

Callers 1

getDebugFunction · 0.85

Calls 3

StringMethod · 0.95
UnmarshalMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected