| 124 | } |
| 125 | |
| 126 | func 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 | |
| 143 | func DERPMapToProto(derpMap *tailcfg.DERPMap) *proto.DERPMap { |
| 144 | if derpMap == nil { |