code: func encode(msgType messageType, in interface{}) (*bytes.Buffer, error) {
  	buf := bytes.NewBuffer(nil)
  	buf.WriteByte(uint8(msgType))
  	hd := codec.MsgpackHandle{}
  	enc := codec.NewEncoder(buf, &hd)
  	err := enc.Encode(in)
  	return buf, err
  }
docs: // Encode writes an encoded object to a new bytes buffer