29 lines
458 B
Go
29 lines
458 B
Go
// The package `m` contains models shared between the hub and peer programs.
|
|
package m
|
|
|
|
type PeerInitArgs struct {
|
|
WGPubKey []byte
|
|
}
|
|
|
|
type PeerInitResp struct {
|
|
PeerIP byte
|
|
Network []byte
|
|
NetworkState NetworkState
|
|
}
|
|
|
|
type Peer struct {
|
|
PeerIP byte
|
|
Version int64
|
|
Name string
|
|
PublicIP1 []byte
|
|
Port1 uint16
|
|
PublicIP2 []byte
|
|
Port2 uint16
|
|
Relay bool
|
|
WGPubKey []byte
|
|
}
|
|
|
|
type NetworkState struct {
|
|
Peers [256]*Peer
|
|
}
|