mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
提交origin2.0版本
This commit is contained in:
22
rpc/jsonprocessor.go
Normal file
22
rpc/jsonprocessor.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package rpc
|
||||
|
||||
import (
|
||||
|
||||
"encoding/json"
|
||||
|
||||
)
|
||||
|
||||
type JsonProcessor struct {
|
||||
}
|
||||
|
||||
|
||||
|
||||
func (slf *JsonProcessor) Marshal(v interface{}) ([]byte, error){
|
||||
return json.Marshal(v)
|
||||
}
|
||||
|
||||
func (slf *JsonProcessor) Unmarshal(data []byte, v interface{}) error{
|
||||
|
||||
return json.Unmarshal(data,v)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user