wip
This commit is contained in:
39
m/models.go
Normal file
39
m/models.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user