]> Cypherpunks.ru repositories - govpn.git/blobdiff - src/govpn/identify.go
Pretty print peer's identity in statistics
[govpn.git] / src / govpn / identify.go
index 54c87d31e0117a300bab5a6b21fc4edd5aec1f01..b028b393f0bfce87c2d3fc6ad219378e4c6b7b83 100644 (file)
@@ -37,6 +37,10 @@ func (id PeerId) String() string {
        return hex.EncodeToString(id[:])
 }
 
+func (id PeerId) MarshalJSON() ([]byte, error) {
+       return []byte(`"` + id.String() + `"`), nil
+}
+
 type CipherCache struct {
        c map[PeerId]*xtea.Cipher
        l sync.RWMutex