mirror of
https://github.com/adnanh/webhook.git
synced 2025-05-23 05:42:30 +00:00
Use gofrs/uuid instead of satori/go.uuid
The satori package appears to be unmaintained. The gofrs package is a fork that is actively maintained by a larger group of Go developers.
This commit is contained in:
parent
7b87d6092f
commit
8ff3848ea3
16 changed files with 1019 additions and 578 deletions
14
webhook.go
14
webhook.go
|
@ -16,11 +16,9 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/adnanh/webhook/hook"
|
||||
|
||||
"github.com/codegangsta/negroni"
|
||||
"github.com/gofrs/uuid"
|
||||
"github.com/gorilla/mux"
|
||||
uuid "github.com/satori/go.uuid"
|
||||
|
||||
fsnotify "gopkg.in/fsnotify.v1"
|
||||
)
|
||||
|
||||
|
@ -229,7 +227,15 @@ func main() {
|
|||
|
||||
func hookHandler(w http.ResponseWriter, r *http.Request) {
|
||||
// generate a request id for logging
|
||||
rid := uuid.NewV4().String()[:6]
|
||||
u, err := uuid.NewV4()
|
||||
if err != nil {
|
||||
log.Printf("internal server error: %s", err)
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
fmt.Fprint(w, "Internal server error")
|
||||
return
|
||||
}
|
||||
|
||||
rid := u.String()[:6]
|
||||
|
||||
log.Printf("[%s] incoming HTTP request from %s\n", rid, r.RemoteAddr)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue