From fbd3c39aa9488db73e213d2695eb8269c838a2cd Mon Sep 17 00:00:00 2001 From: qowevisa Date: Sat, 25 May 2024 09:19:08 +0300 Subject: [PATCH] Create types in separate file in communication package --- communication/types.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 communication/types.go diff --git a/communication/types.go b/communication/types.go new file mode 100644 index 0000000..feecf05 --- /dev/null +++ b/communication/types.go @@ -0,0 +1,26 @@ +package communication + +type ClientForServer struct { + ID uint16 + Nickname string +} + +type RegisteredUser struct { + ID uint16 +} + +const ( + LINK_STATUS_CREATED = 1 + iota + LINK_STATUS_EXPIRED +) + +const ( + LINK_LEN_V1 = 32 +) + +// NOTE: Data should be 32 or 64 bytes +type Link struct { + Status uint8 + Data []byte + UseCount uint32 +}