Resolve merge conflict

This commit is contained in:
Kristoffer Dalby
2021-08-13 10:33:19 +01:00
parent 5bfcf5c917
commit 9698abbfd5
10 changed files with 180 additions and 139 deletions

View File

@@ -10,9 +10,11 @@ import (
"encoding/json"
"fmt"
"io"
"strings"
"golang.org/x/crypto/nacl/box"
"inet.af/netaddr"
"tailscale.com/tailcfg"
"tailscale.com/types/wgkey"
)
@@ -58,6 +60,7 @@ func encode(v interface{}, pubKey *wgkey.Key, privKey *wgkey.Private) ([]byte, e
if err != nil {
return nil, err
}
return encodeMsg(b, pubKey, privKey)
}
@@ -139,3 +142,17 @@ func containsIPs(ips []netaddr.IP, ip netaddr.IP) bool {
return false
}
func tailNodesToString(nodes []*tailcfg.Node) string {
temp := make([]string, len(nodes))
for index, node := range nodes {
temp[index] = node.Name
}
return fmt.Sprintf("[ %s ](%d)", strings.Join(temp, ", "), len(temp))
}
func tailMapResponseToString(resp tailcfg.MapResponse) string {
return fmt.Sprintf("{ Node: %s, Peers: %s }", resp.Node.Name, tailNodesToString(resp.Peers))
}