diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-20 09:34:12 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-20 09:34:12 +0800 |
commit | 3983dd2428137211f84f299f9ce8690c22f50afd (patch) | |
tree | 3a2dc53b365e6f377fc82a3514150d1297fe549c /rpc/json.go | |
parent | 7daa8c2f6eb25511c6a54ad420709af911fc6748 (diff) | |
parent | 0a9dc1536c5d776844d6947a0090ff7e1a7c6ab4 (diff) | |
download | dexon-3983dd2428137211f84f299f9ce8690c22f50afd.tar dexon-3983dd2428137211f84f299f9ce8690c22f50afd.tar.gz dexon-3983dd2428137211f84f299f9ce8690c22f50afd.tar.bz2 dexon-3983dd2428137211f84f299f9ce8690c22f50afd.tar.lz dexon-3983dd2428137211f84f299f9ce8690c22f50afd.tar.xz dexon-3983dd2428137211f84f299f9ce8690c22f50afd.tar.zst dexon-3983dd2428137211f84f299f9ce8690c22f50afd.zip |
Merge branch 'release/v0.7.10'
Diffstat (limited to 'rpc/json.go')
-rw-r--r-- | rpc/json.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/rpc/json.go b/rpc/json.go new file mode 100644 index 000000000..e467f9a34 --- /dev/null +++ b/rpc/json.go @@ -0,0 +1,20 @@ +package rpc + +import ( + "encoding/json" + "io" +) + +type jsonWrapper struct{} + +func (self jsonWrapper) Send(writer io.Writer, v interface{}) (n int, err error) { + var payload []byte + payload, err = json.Marshal(v) + if err != nil { + return 0, err + } + + return writer.Write(payload) +} + +var JSON jsonWrapper |