From 785d4029e9458b2772bcb4a5362fe0f9814f2062 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 5 Jan 2024 13:47:56 -0500 Subject: [PATCH] feat: add protocol types --- types/protocol.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 types/protocol.go diff --git a/types/protocol.go b/types/protocol.go new file mode 100644 index 0000000..bbf6cfd --- /dev/null +++ b/types/protocol.go @@ -0,0 +1,21 @@ +package types + +type ProtocolMethod int + +const ( + ProtocolMethodHandshakeOpen ProtocolMethod = 0x1 + ProtocolMethodHandshakeDone ProtocolMethod = 0x2 + ProtocolMethodSignedMessage ProtocolMethod = 0xA + ProtocolMethodHashQuery ProtocolMethod = 0x4 + ProtocolMethodAnnouncePeers ProtocolMethod = 0x8 + ProtocolMethodRegistryQuery ProtocolMethod = 0xD +) + +var ProtocolMethodMap = map[ProtocolMethod]string{ + ProtocolMethodHandshakeOpen: "HandshakeOpen", + ProtocolMethodHandshakeDone: "HandshakeDone", + ProtocolMethodSignedMessage: "SignedMessage", + ProtocolMethodHashQuery: "HashQuery", + ProtocolMethodAnnouncePeers: "AnnouncePeers", + ProtocolMethodRegistryQuery: "RegistryQuery", +}