Skip to content

Commit

Permalink
add peer network info to pull
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek9686 committed Oct 31, 2023
1 parent ef3fc00 commit 896041e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions controllers/hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,12 @@ func pull(w http.ResponseWriter, r *http.Request) {

serverConf.TrafficKey = key
response := models.HostPull{
Host: *host,
Nodes: logic.GetHostNodes(host),
ServerConfig: serverConf,
Peers: hPU.Peers,
PeerIDs: hPU.PeerIDs,
Host: *host,
Nodes: logic.GetHostNodes(host),
ServerConfig: serverConf,
Peers: hPU.Peers,
PeerIDs: hPU.PeerIDs,
HostNetworkInfo: hPU.HostNetworkInfo,
}

logger.Log(1, hostID, "completed a pull")
Expand Down
11 changes: 6 additions & 5 deletions models/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,12 @@ type TrafficKeys struct {

// HostPull - response of a host's pull
type HostPull struct {
Host Host `json:"host" yaml:"host"`
Nodes []Node `json:"nodes" yaml:"nodes"`
Peers []wgtypes.PeerConfig `json:"peers" yaml:"peers"`
ServerConfig ServerConfig `json:"server_config" yaml:"server_config"`
PeerIDs PeerMap `json:"peer_ids,omitempty" yaml:"peer_ids,omitempty"`
Host Host `json:"host" yaml:"host"`
Nodes []Node `json:"nodes" yaml:"nodes"`
Peers []wgtypes.PeerConfig `json:"peers" yaml:"peers"`
ServerConfig ServerConfig `json:"server_config" yaml:"server_config"`
PeerIDs PeerMap `json:"peer_ids,omitempty" yaml:"peer_ids,omitempty"`
HostNetworkInfo HostInfoMap `json:"host_network_info,omitempty" yaml:"host_network_info,omitempty"`
}

// NodeGet - struct for a single node get response
Expand Down

0 comments on commit 896041e

Please sign in to comment.