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

Function SingleNodeUpdate

tailnet/convert.go:126–141  ·  view source on GitHub ↗
(id uuid.UUID, node *Node, reason string)

Source from the content-addressed store, hash-verified

124}
125
126func SingleNodeUpdate(id uuid.UUID, node *Node, reason string) (*proto.CoordinateResponse, error) {
127 p, err := NodeToProto(node)
128 if err != nil {
129 return nil, xerrors.Errorf("node failed conversion to protobuf: %w", err)
130 }
131 return &proto.CoordinateResponse{
132 PeerUpdates: []*proto.CoordinateResponse_PeerUpdate{
133 {
134 Kind: proto.CoordinateResponse_PeerUpdate_NODE,
135 Id: UUIDToByteSlice(id),
136 Node: p,
137 Reason: reason,
138 },
139 },
140 }, nil
141}
142
143func DERPMapToProto(derpMap *tailcfg.DERPMap) *proto.DERPMap {
144 if derpMap == nil {

Callers 1

TestSingleNodeUpdateFunction · 0.92

Calls 3

NodeToProtoFunction · 0.85
UUIDToByteSliceFunction · 0.85
ErrorfMethod · 0.45

Tested by 1

TestSingleNodeUpdateFunction · 0.74