38 lines
598 B
Go
38 lines
598 B
Go
// 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
|
|
PublicIP []byte
|
|
Port uint16
|
|
Relay bool
|
|
PubKey []byte
|
|
PrivKey []byte
|
|
}
|
|
|
|
type Peer struct {
|
|
PeerIP byte
|
|
Version int64
|
|
Name string
|
|
PublicIP []byte
|
|
Port uint16
|
|
Relay bool
|
|
PubKey []byte
|
|
}
|
|
|
|
type NetworkState struct {
|
|
HubAddress string
|
|
|
|
// The requester's data:
|
|
Network []byte
|
|
PeerIP byte
|
|
PublicIP []byte
|
|
Port uint16
|
|
|
|
// All peer data.
|
|
Peers [256]*Peer
|
|
}
|