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

Function OnlyNodeUpdates

tailnet/convert.go:111–124  ·  view source on GitHub ↗
(resp *proto.CoordinateResponse)

Source from the content-addressed store, hash-verified

109}
110
111func OnlyNodeUpdates(resp *proto.CoordinateResponse) ([]*Node, error) {
112 nodes := make([]*Node, 0, len(resp.GetPeerUpdates()))
113 for _, pu := range resp.GetPeerUpdates() {
114 if pu.Kind != proto.CoordinateResponse_PeerUpdate_NODE {
115 continue
116 }
117 n, err := ProtoToNode(pu.Node)
118 if err != nil {
119 return nil, xerrors.Errorf("failed conversion from protobuf: %w", err)
120 }
121 nodes = append(nodes, n)
122 }
123 return nodes, nil
124}
125
126func SingleNodeUpdate(id uuid.UUID, node *Node, reason string) (*proto.CoordinateResponse, error) {
127 p, err := NodeToProto(node)

Callers 1

TestOnlyNodeUpdatesFunction · 0.92

Calls 3

ProtoToNodeFunction · 0.85
GetPeerUpdatesMethod · 0.80
ErrorfMethod · 0.45

Tested by 1

TestOnlyNodeUpdatesFunction · 0.74