This commit is contained in:
jdl
2024-12-08 09:45:29 +01:00
parent 55a9bf9dc3
commit 03ff1aac80
60 changed files with 3165 additions and 2 deletions

39
m/models.go Normal file
View File

@@ -0,0 +1,39 @@
// The package `m` contains models shared between the hub and peer programs.
package m
type PeerConfig struct {
PeerIP byte
HubAddress string
Network []byte
APIKey string
IP []byte
Port uint16
Mediator bool
EncPubKey []byte
EncPrivKey []byte
SignPubKey []byte
SignPrivKey []byte
}
type Peer struct {
PeerIP byte
Name string
IP []byte
Port uint16
Mediator bool
EncPubKey []byte
SignPubKey []byte
}
type NetworkState struct {
HubAddress string
// The requester's data:
Network []byte
PeerIP byte
IP []byte
Port uint16
// All peer data.
Peers [256]*Peer
}