generic_hook.go
func (g GenericHook) Handle(w http.ResponseWriter, r *http.Request, repo *Repo) (int, error) {
	if r.Method != "POST" {
		return http.StatusMethodNotAllowed, errors.New("the request had an invalid method")
	}

	body, err := ioutil.ReadAll(r.Body)
	if err != nil {
		return http.StatusRequestTimeout, errors.New("could not read body from request")
	}

	err = g.handlePush(body, repo)
	if err != nil {
		return http.StatusBadRequest, err
	}

	return http.StatusOK, nil
}
func (g GenericHook) Handle(w http.ResponseWriter, r *http.Request, repo *Repo) (int, error) {
	if r.Method != "POST" {
		return http.StatusMethodNotAllowed, errors.New("the request had an invalid method")
	}

	body, err := ioutil.ReadAll(r.Body)
	if err != nil {
		return http.StatusRequestTimeout, errors.New("could not read body from request")
	}

	err = g.handlePush(body, repo)
	if err != nil {
		return http.StatusBadRequest, err
	}

	return http.StatusOK, nil
}
func ( g GenericHook ) Handle ( w http . ResponseWriter , r * http . Request , repo * Repo ) ( int , error ) { if r . Method != " " { return http . StatusMethodNotAllowed , errors . New ( " " ) } body , err := ioutil . ReadAll ( r . Body ) if err != nil { return http . StatusRequestTimeout , errors . New ( " " ) } err = g . handlePush ( body , repo ) if err != nil { return http . StatusBadRequest , err } return http . StatusOK , nil }
// Handle satisfies hookhandler.
Handle satisfies hookhandler .