(clientVersion string)
| 25 | } |
| 26 | |
| 27 | func EncodeProbePayload(clientVersion string) []byte { |
| 28 | probe := VersionProbe{ |
| 29 | Type: "version_probe", |
| 30 | ClientVersion: clientVersion, |
| 31 | Protocol: ProtocolVersion, |
| 32 | } |
| 33 | b, _ := json.Marshal(probe) |
| 34 | return append([]byte(ProbePrefix+"|"), b...) |
| 35 | } |
| 36 | |
| 37 | func IsProbePayload(payload []byte) bool { |
| 38 | return bytes.HasPrefix(payload, []byte(ProbePrefix+"|")) || bytes.Equal(payload, []byte(ProbePrefix)) |