mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-07-02 00:56:19 +00:00

* Reimplement AddPeer and RemovePeer for admin socket Fix #950 * Disconnect the peer on `removePeer` Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
13 lines
281 B
Go
13 lines
281 B
Go
package admin
|
|
|
|
type AddPeerRequest struct {
|
|
Uri string `json:"uri"`
|
|
Sintf string `json:"interface,omitempty"`
|
|
}
|
|
|
|
type AddPeerResponse struct{}
|
|
|
|
func (a *AdminSocket) addPeerHandler(req *AddPeerRequest, res *AddPeerResponse) error {
|
|
return a.core.AddPeer(req.Uri, req.Sintf)
|
|
}
|