http urls monitor.

json.go 303B

123456789101112131415161718
  1. package codec
  2. import "encoding/json"
  3. type JsonCoder struct{}
  4. func (c *JsonCoder) Encoder(data interface{}) ([]byte, error) {
  5. return json.Marshal(data)
  6. }
  7. func (c *JsonCoder) Decoder(data []byte, v interface{}) error {
  8. return json.Unmarshal(data, v)
  9. }
  10. func init() {
  11. Register(JSON, &JsonCoder{})
  12. }