func ErrStatus(w http.ResponseWriter, r *http.Request, message string, statusCode int, err error) {
	var content []byte
	var e error
	content, e = ioutil.ReadAll(r.Body)
	if e != nil {
		glog.Error("ioutil.ReadAll failed")
	}
	glog.Errorf("msg %v, r.Body %v, err: %v", message, string(content), errors.Wrap(err, ""))
	http.Error(w, message, statusCode)
}
ErrStatus sends a http error status
package util
import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net"
	"net/http"
	"time"
	"github.com/golang/glog"
	"github.com/pkg/errors"
	"github.com/sethgrid/pester"
)
type JoinRequest struct {
	NodeID string `json:"nodeID"`
	Addr   string `json:"addr"`
}
func (j *JoinRequest) Validate() error {
	if j.NodeID == "" {
		return fmt.Errorf("nodeID is empty")
	}
	_, err := net.DialTimeout("tcp", j.Addr, time.Second*3)
	if err != nil {
		return fmt.Errorf("invalid addr %v", err)
	}
	return nil
}