From: Sergey Matveev Date: Sat, 14 Nov 2015 16:16:03 +0000 (+0300) Subject: Pretty print peer's identity in statistics X-Git-Tag: 4.2^2~5 X-Git-Url: http://www.git.cypherpunks.ru/?p=govpn.git;a=commitdiff_plain;h=8cb65d70add539ceb6fbd68790b801d880653e8f Pretty print peer's identity in statistics Signed-off-by: Sergey Matveev --- diff --git a/src/govpn/identify.go b/src/govpn/identify.go index 54c87d3..b028b39 100644 --- a/src/govpn/identify.go +++ b/src/govpn/identify.go @@ -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