1234567891011121314151617181920212223242526272829303132333435363738 |
- package rpc
- import (
- "encoding/json"
- "net"
- )
- type Request struct {
- body []byte
- conn net.Conn
- Method string
- Params map[string]interface{}
- }
- func (r *Request) Bind(v interface{}) (err error) {
- err = json.Unmarshal(r.body, v)
- return
- }
- func (r *Request) Encode() []byte {
- return nil
- }
- func (r *Request) ParamValue(name string) interface{} {
- return nil
- }
- func (r *Request) Reset(conn net.Conn) {
- r.conn = conn
- }
- func ReadRequest(b []byte) *Request {
- return &Request{}
- }
- func NewRequest() *Request {
- return &Request{}
- }
|