package rpc
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
type jsonCodec struct{}
|
|
|
|
func (jsonCodec) ID() string {
|
|
return CodecJSON
|
|
}
|
|
|
|
func (jsonCodec) Marshal(v interface{}) ([]byte, error) {
|
|
return json.Marshal(v)
|
|
}
|
|
|
|
func (jsonCodec) Unmarshal(b []byte, v interface{}) error {
|
|
return json.Unmarshal(b, v)
|
|
}
|