From 8bdcd6d576e9cd929f81f071d078924b500ea355 Mon Sep 17 00:00:00 2001 From: Jack Zampolin Date: Tue, 19 Jan 2016 23:14:11 -0800 Subject: [PATCH 01/10] First commit for ghwebhooks service plugin --- plugins/inputs/ghwebhooks/ghwebhooks.go | 369 ++++++++++++ plugins/inputs/ghwebhooks/models.go | 753 ++++++++++++++++++++++++ 2 files changed, 1122 insertions(+) create mode 100644 plugins/inputs/ghwebhooks/ghwebhooks.go create mode 100644 plugins/inputs/ghwebhooks/models.go diff --git a/plugins/inputs/ghwebhooks/ghwebhooks.go b/plugins/inputs/ghwebhooks/ghwebhooks.go new file mode 100644 index 000000000..c8bfbd2fc --- /dev/null +++ b/plugins/inputs/ghwebhooks/ghwebhooks.go @@ -0,0 +1,369 @@ +package ghwebhooks + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "os" + "sync" + "time" + + log "github.com/Sirupsen/logrus" + "github.com/gorilla/mux" + mod "github.com/influxdata/support-tools/ghWebhooks/models" + "github.com/influxdata/telegraf/plugins/inputs" +) + +func init() { + log.Info("Starting ghWebhook server...") + logFile, err := os.Create("server.log") + if err != nil { + log.WithFields(log.Fields{ + "time": time.Now(), + "error": err, + }).Warn("Error in creating log file") + } + log.SetLevel(log.InfoLevel) + log.SetOutput(logFile) + + inputs.Add("ghwebhooks", func() inputs.Input { return &GHWebhooks{} }) +} + +type GHWebhooks struct { + ServiceAddress string + MeasurementName string + + sync.Mutex + + // Channel for all incoming events from github + in chan mod.Event + done chan struct{} +} + +func (gh *GHWebhooks) SampleConfig() string { + return ` + # Address and port to host Webhook listener on + service_address = ":1618" + # Measurement name + measurement_name = "ghWebhooks" +` +} + +func (gh *GHWebhooks) Description() string { + return "Github Webhook Event collector" +} + +// Writes the points from <-gh.in to the Accumulator +func (gh *GHWebhooks) Gather(acc inputs.Accumulator) error { + gh.Lock() + defer gh.Unlock() + for { + select { + case <-gh.done: + return nil + case e := <-gh.in: + p := e.NewPoint() + acc.Add(gh.MeasurementName, p.Fields(), p.Tags(), p.Time()) + } + } + return nil +} + +func (gh *GHWebhooks) Start() error { + gh.Lock() + defer gh.Unlock() + for { + select { + case <-gh.done: + return nil + default: + r := mux.NewRouter() + r.HandleFunc("/webhooks", gh.webhookHandler).Methods("POST") + http.ListenAndServe(fmt.Sprintf(":%s", gh.ServiceAddress), r) + } + } +} + +func (gh *GHWebhooks) Stop() { + gh.Lock() + defer gh.Unlock() + log.Println("Stopping the ghWebhooks service") + close(gh.done) + close(gh.in) +} + +// Handles the /webhooks route +func (gh *GHWebhooks) webhookHandler(w http.ResponseWriter, r *http.Request) { + eventType := r.Header["X-Github-Event"][0] + data, err := ioutil.ReadAll(r.Body) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": eventType, "error": err} + log.WithFields(fields).Fatal("Error reading Github payload") + } + + // Send event down chan to GHWebhooks + e := NewEvent(data, eventType) + gh.in <- e + fmt.Printf("%v\n", e.NewPoint()) + w.WriteHeader(http.StatusOK) +} + +func newCommitComment(data []byte) mod.Event { + commitCommentStruct := mod.CommitCommentEvent{} + err := json.Unmarshal(data, &commitCommentStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "CommitCommentEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return commitCommentStruct +} + +func newCreate(data []byte) mod.Event { + createStruct := mod.CreateEvent{} + err := json.Unmarshal(data, &createStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "CreateEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return createStruct +} + +func newDelete(data []byte) mod.Event { + deleteStruct := mod.DeleteEvent{} + err := json.Unmarshal(data, &deleteStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "DeleteEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return deleteStruct +} + +func newDeployment(data []byte) mod.Event { + deploymentStruct := mod.DeploymentEvent{} + err := json.Unmarshal(data, &deploymentStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "DeploymentEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return deploymentStruct +} + +func newDeploymentStatus(data []byte) mod.Event { + deploymentStatusStruct := mod.DeploymentStatusEvent{} + err := json.Unmarshal(data, &deploymentStatusStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "DeploymentStatusEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return deploymentStatusStruct +} + +func newFork(data []byte) mod.Event { + forkStruct := mod.ForkEvent{} + err := json.Unmarshal(data, &forkStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "ForkEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return forkStruct +} + +func newGollum(data []byte) mod.Event { + gollumStruct := mod.GollumEvent{} + err := json.Unmarshal(data, &gollumStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "GollumEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return gollumStruct +} + +func newIssueComment(data []byte) mod.Event { + issueCommentStruct := mod.IssueCommentEvent{} + err := json.Unmarshal(data, &issueCommentStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "IssueCommentEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return issueCommentStruct +} + +func newIssues(data []byte) mod.Event { + issuesStruct := mod.IssuesEvent{} + err := json.Unmarshal(data, &issuesStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "IssuesEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return issuesStruct +} + +func newMember(data []byte) mod.Event { + memberStruct := mod.MemberEvent{} + err := json.Unmarshal(data, &memberStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "MemberEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return memberStruct +} + +func newMembership(data []byte) mod.Event { + membershipStruct := mod.MembershipEvent{} + err := json.Unmarshal(data, &membershipStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "MembershipEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return membershipStruct +} + +func newPageBuild(data []byte) mod.Event { + pageBuildEvent := mod.PageBuildEvent{} + err := json.Unmarshal(data, &pageBuildEvent) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "PageBuildEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return pageBuildEvent +} + +func newPublic(data []byte) mod.Event { + publicEvent := mod.PublicEvent{} + err := json.Unmarshal(data, &publicEvent) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "PublicEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return publicEvent +} + +func newPullRequest(data []byte) mod.Event { + pullRequestStruct := mod.PullRequestEvent{} + err := json.Unmarshal(data, &pullRequestStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "PullRequestEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return pullRequestStruct +} + +func newPullRequestReviewComment(data []byte) mod.Event { + pullRequestReviewCommentStruct := mod.PullRequestReviewCommentEvent{} + err := json.Unmarshal(data, &pullRequestReviewCommentStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "PullRequestReviewCommentEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return pullRequestReviewCommentStruct +} + +func newPush(data []byte) mod.Event { + pushStruct := mod.PushEvent{} + err := json.Unmarshal(data, &pushStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "PushEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return pushStruct +} + +func newRelease(data []byte) mod.Event { + releaseStruct := mod.ReleaseEvent{} + err := json.Unmarshal(data, &releaseStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "ReleaseEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return releaseStruct +} + +func newRepository(data []byte) mod.Event { + repositoryStruct := mod.RepositoryEvent{} + err := json.Unmarshal(data, &repositoryStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "RepositoryEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return repositoryStruct +} + +func newStatus(data []byte) mod.Event { + statusStruct := mod.StatusEvent{} + err := json.Unmarshal(data, &statusStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "StatusEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return statusStruct +} + +func newTeamAdd(data []byte) mod.Event { + teamAddStruct := mod.TeamAddEvent{} + err := json.Unmarshal(data, &teamAddStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "TeamAddEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return teamAddStruct +} + +func newWatch(data []byte) mod.Event { + watchStruct := mod.WatchEvent{} + err := json.Unmarshal(data, &watchStruct) + if err != nil { + fields := log.Fields{"time": time.Now(), "event": "WatchEvent", "error": err} + log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + } + return watchStruct +} + +func NewEvent(r []byte, t string) mod.Event { + log.WithFields(log.Fields{"event": t, "time": time.Now()}).Info("Event Recieved") + switch t { + case "commit_comment": + return newCommitComment(r) + case "create": + return newCreate(r) + case "delete": + return newDelete(r) + case "deployment": + return newDeployment(r) + case "deployment_status": + return newDeploymentStatus(r) + case "fork": + return newFork(r) + case "gollum": + return newGollum(r) + case "issue_comment": + return newIssueComment(r) + case "issues": + return newIssues(r) + case "member": + return newMember(r) + case "membership": + return newMembership(r) + case "page_build": + return newPageBuild(r) + case "public": + return newPublic(r) + case "pull_request": + return newPullRequest(r) + case "pull_request_review_comment": + return newPullRequestReviewComment(r) + case "push": + return newPush(r) + case "release": + return newRelease(r) + case "repository": + return newRepository(r) + case "status": + return newStatus(r) + case "team_add": + return newTeamAdd(r) + case "watch": + return newWatch(r) + } + return nil +} diff --git a/plugins/inputs/ghwebhooks/models.go b/plugins/inputs/ghwebhooks/models.go new file mode 100644 index 000000000..b310bb94d --- /dev/null +++ b/plugins/inputs/ghwebhooks/models.go @@ -0,0 +1,753 @@ +package models + +import ( + "fmt" + "time" + + log "github.com/Sirupsen/logrus" + "github.com/influxdata/influxdb/client/v2" +) + +const Measurement = "ghWebhooks" + +type Event interface { + NewPoint() *client.Point +} + +type Repository struct { + Repository string `json:"full_name"` + Private bool `json:"private"` + Stars int `json:"stargazers_count"` + Forks int `json:"forks_count"` + Issues int `json:"open_issues_count"` +} + +type Sender struct { + User string `json:"login"` + Admin bool `json:"site_admin"` +} + +type CommitComment struct { + Commit string `json:"commit_id"` + Body string `json:"body"` +} + +type Deployment struct { + Commit string `json:"sha"` + Task string `json:"task"` + Environment string `json:"environment"` + Description string `json:"description"` +} + +type Page struct { + Name string `json:"page_name"` + Title string `json:"title"` + Action string `json:"action"` +} + +type Issue struct { + Number int `json:"number"` + Title string `json:"title"` + Comments int `json:"comments"` +} + +type IssueComment struct { + Body string `json:"body"` +} + +type Team struct { + Name string `json:"name"` +} + +type PullRequest struct { + Number int `json:"number"` + State string `json:"state"` + Title string `json:"title"` + Comments int `json:"comments"` + Commits int `json:"commits"` + Additions int `json:"additions"` + Deletions int `json:"deletions"` + ChangedFiles int `json:"changed_files"` +} + +type PullRequestReviewComment struct { + File string `json:"path"` + Comment string `json:"body"` +} + +type Release struct { + TagName string `json:"tag_name"` +} + +type DeploymentStatus struct { + State string `json:"state"` + Description string `json:"description"` +} + +type CommitCommentEvent struct { + Comment CommitComment `json:"comment"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s CommitCommentEvent) NewPoint() *client.Point { + event := "commit_comment" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "commit": s.Comment.Commit, + "comment": s.Comment.Body, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type CreateEvent struct { + Ref string `json:"ref"` + RefType string `json:"ref_type"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s CreateEvent) NewPoint() *client.Point { + event := "create" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "ref": s.Ref, + "refType": s.RefType, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type DeleteEvent struct { + Ref string `json:"ref"` + RefType string `json:"ref_type"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s DeleteEvent) NewPoint() *client.Point { + event := "delete" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "ref": s.Ref, + "refType": s.RefType, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type DeploymentEvent struct { + Deployment Deployment `json:"deployment"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s DeploymentEvent) NewPoint() *client.Point { + event := "deployment" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "commit": s.Deployment.Commit, + "task": s.Deployment.Task, + "environment": s.Deployment.Environment, + "description": s.Deployment.Description, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type DeploymentStatusEvent struct { + Deployment Deployment `json:"deployment"` + DeploymentStatus DeploymentStatus `json:"deployment_status"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s DeploymentStatusEvent) NewPoint() *client.Point { + event := "delete" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "commit": s.Deployment.Commit, + "task": s.Deployment.Task, + "environment": s.Deployment.Environment, + "description": s.Deployment.Description, + "depState": s.DeploymentStatus.State, + "depDescription": s.DeploymentStatus.Description, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type ForkEvent struct { + Forkee Repository `json:"forkee"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s ForkEvent) NewPoint() *client.Point { + event := "fork" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "fork": s.Forkee.Repository, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type GollumEvent struct { + Pages []Page `json:"pages"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +// REVIEW: Going to be lazy and not deal with the pages. +func (s GollumEvent) NewPoint() *client.Point { + event := "gollum" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type IssueCommentEvent struct { + Issue Issue `json:"issue"` + Comment IssueComment `json:"comment"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s IssueCommentEvent) NewPoint() *client.Point { + event := "issue_comment" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + "issue": fmt.Sprintf("%v", s.Issue.Number), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "title": s.Issue.Title, + "comments": s.Issue.Comments, + "body": s.Comment.Body, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type IssuesEvent struct { + Action string `json:"action"` + Issue Issue `json:"issue"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s IssuesEvent) NewPoint() *client.Point { + event := "issue" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + "issue": fmt.Sprintf("%v", s.Issue.Number), + "action": s.Action, + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "title": s.Issue.Title, + "comments": s.Issue.Comments, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type MemberEvent struct { + Member Sender `json:"member"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s MemberEvent) NewPoint() *client.Point { + event := "member" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "newMember": s.Member.User, + "newMemberStatus": s.Member.Admin, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type MembershipEvent struct { + Action string `json:"action"` + Member Sender `json:"member"` + Sender Sender `json:"sender"` + Team Team `json:"team"` +} + +func (s MembershipEvent) NewPoint() *client.Point { + event := "membership" + t := map[string]string{ + "event": event, + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + "action": s.Action, + } + f := map[string]interface{}{ + "newMember": s.Member.User, + "newMemberStatus": s.Member.Admin, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type PageBuildEvent struct { + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s PageBuildEvent) NewPoint() *client.Point { + event := "page_build" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type PublicEvent struct { + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s PublicEvent) NewPoint() *client.Point { + event := "public" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type PullRequestEvent struct { + Action string `json:"action"` + PullRequest PullRequest `json:"pull_request"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s PullRequestEvent) NewPoint() *client.Point { + event := "pull_request" + t := map[string]string{ + "event": event, + "action": s.Action, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + "prNumber": fmt.Sprintf("%v", s.PullRequest.Number), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "state": s.PullRequest.State, + "title": s.PullRequest.Title, + "comments": s.PullRequest.Comments, + "commits": s.PullRequest.Commits, + "additions": s.PullRequest.Additions, + "deletions": s.PullRequest.Deletions, + "changedFiles": s.PullRequest.ChangedFiles, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type PullRequestReviewCommentEvent struct { + Comment PullRequestReviewComment `json:"comment"` + PullRequest PullRequest `json:"pull_request"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s PullRequestReviewCommentEvent) NewPoint() *client.Point { + event := "pull_request_review_comment" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + "prNumber": fmt.Sprintf("%v", s.PullRequest.Number), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "state": s.PullRequest.State, + "title": s.PullRequest.Title, + "comments": s.PullRequest.Comments, + "commits": s.PullRequest.Commits, + "additions": s.PullRequest.Additions, + "deletions": s.PullRequest.Deletions, + "changedFiles": s.PullRequest.ChangedFiles, + "commentFile": s.Comment.File, + "comment": s.Comment.Comment, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type PushEvent struct { + Ref string `json:"ref"` + Before string `json:"before"` + After string `json:"after"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s PushEvent) NewPoint() *client.Point { + event := "push" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "Ref": s.Ref, + "Before": s.Before, + "After": s.After, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type ReleaseEvent struct { + Release Release `json:"release"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s ReleaseEvent) NewPoint() *client.Point { + event := "release" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "tagName": s.Release.TagName, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type RepositoryEvent struct { + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s RepositoryEvent) NewPoint() *client.Point { + event := "repository" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type StatusEvent struct { + Commit string `json:"sha"` + State string `json:"state"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s StatusEvent) NewPoint() *client.Point { + event := "status" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "commit": s.Commit, + "state": s.State, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type TeamAddEvent struct { + Team Team `json:"team"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s TeamAddEvent) NewPoint() *client.Point { + event := "team_add" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "teamName": s.Team.Name, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} + +type WatchEvent struct { + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s WatchEvent) NewPoint() *client.Point { + event := "delete" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + } + time := time.Now() + p, err := client.NewPoint(Measurement, t, f, time) + if err != nil { + i := log.Fields{"event": event, "error": err} + log.WithFields(i).Fatal("Error creating new point...") + } + return p +} From 8653bae6acceada3e8ccbaa6b32828dc144d63f2 Mon Sep 17 00:00:00 2001 From: Jack Zampolin Date: Wed, 20 Jan 2016 10:49:42 -0800 Subject: [PATCH 02/10] Change start implementation --- plugins/inputs/ghwebhooks/ghwebhooks.go | 26 +++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/plugins/inputs/ghwebhooks/ghwebhooks.go b/plugins/inputs/ghwebhooks/ghwebhooks.go index c8bfbd2fc..57976c4f7 100644 --- a/plugins/inputs/ghwebhooks/ghwebhooks.go +++ b/plugins/inputs/ghwebhooks/ghwebhooks.go @@ -70,19 +70,19 @@ func (gh *GHWebhooks) Gather(acc inputs.Accumulator) error { return nil } +func (gh *GHWebhooks) listen() error { + r := mux.NewRouter() + r.HandleFunc("/webhooks", gh.webhookHandler).Methods("POST") + http.ListenAndServe(fmt.Sprintf(":%s", gh.ServiceAddress), r) +} + func (gh *GHWebhooks) Start() error { - gh.Lock() - defer gh.Unlock() - for { - select { - case <-gh.done: - return nil - default: - r := mux.NewRouter() - r.HandleFunc("/webhooks", gh.webhookHandler).Methods("POST") - http.ListenAndServe(fmt.Sprintf(":%s", gh.ServiceAddress), r) - } - } + gh.done = make(chan struct{}) + gh.in = make(chan mod.Event) + // Start the UDP listener + go gh.listen() + // Start the line parser + log.Printf("Started the ghwebhooks service on %s\n", s.ServiceAddress) } func (gh *GHWebhooks) Stop() { @@ -95,6 +95,8 @@ func (gh *GHWebhooks) Stop() { // Handles the /webhooks route func (gh *GHWebhooks) webhookHandler(w http.ResponseWriter, r *http.Request) { + gh.Lock() + defer gh.Unlock() eventType := r.Header["X-Github-Event"][0] data, err := ioutil.ReadAll(r.Body) if err != nil { From ddcd99a1ce3e559bc74d1de8c00a2167686fb121 Mon Sep 17 00:00:00 2001 From: Jack Zampolin Date: Wed, 20 Jan 2016 12:19:03 -0800 Subject: [PATCH 03/10] Push ghwebhooks branch --- CHANGELOG.md | 294 +++++++++--------- CONTRIBUTING.md | 10 +- Godeps | 2 +- README.md | 4 +- accumulator.go | 4 +- agent.go | 8 +- agent_test.go | 6 +- cmd/telegraf/telegraf.go | 8 +- internal/config/config.go | 8 +- internal/config/config_test.go | 8 +- plugins/inputs/aerospike/aerospike.go | 2 +- plugins/inputs/aerospike/aerospike_test.go | 2 +- plugins/inputs/all/all.go | 73 ++--- plugins/inputs/apache/apache.go | 2 +- plugins/inputs/apache/apache_test.go | 2 +- plugins/inputs/bcache/bcache.go | 2 +- plugins/inputs/bcache/bcache_test.go | 2 +- plugins/inputs/disque/disque.go | 2 +- plugins/inputs/disque/disque_test.go | 2 +- plugins/inputs/elasticsearch/elasticsearch.go | 4 +- .../elasticsearch/elasticsearch_test.go | 2 +- plugins/inputs/exec/exec.go | 4 +- plugins/inputs/exec/exec_test.go | 2 +- plugins/inputs/ghwebhooks/ghwebhooks.go | 29 +- .../inputs/ghwebhooks/{ => models}/models.go | 0 plugins/inputs/haproxy/haproxy.go | 2 +- plugins/inputs/haproxy/haproxy_test.go | 2 +- plugins/inputs/httpjson/httpjson.go | 4 +- plugins/inputs/httpjson/httpjson_test.go | 2 +- plugins/inputs/influxdb/influxdb.go | 2 +- plugins/inputs/influxdb/influxdb_test.go | 4 +- plugins/inputs/jolokia/jolokia.go | 2 +- plugins/inputs/jolokia/jolokia_test.go | 2 +- .../inputs/kafka_consumer/kafka_consumer.go | 4 +- .../kafka_consumer_integration_test.go | 2 +- .../kafka_consumer/kafka_consumer_test.go | 4 +- plugins/inputs/leofs/leofs.go | 2 +- plugins/inputs/leofs/leofs_test.go | 2 +- plugins/inputs/lustre2/lustre2.go | 4 +- plugins/inputs/lustre2/lustre2_test.go | 2 +- plugins/inputs/mailchimp/mailchimp.go | 2 +- plugins/inputs/mailchimp/mailchimp_test.go | 2 +- plugins/inputs/memcached/memcached.go | 2 +- plugins/inputs/memcached/memcached_test.go | 2 +- plugins/inputs/mongodb/mongodb.go | 2 +- plugins/inputs/mongodb/mongodb_data.go | 2 +- plugins/inputs/mongodb/mongodb_data_test.go | 2 +- plugins/inputs/mongodb/mongodb_server.go | 2 +- plugins/inputs/mongodb/mongodb_server_test.go | 2 +- plugins/inputs/mysql/mysql.go | 2 +- plugins/inputs/mysql/mysql_test.go | 2 +- plugins/inputs/nginx/nginx.go | 2 +- plugins/inputs/nginx/nginx_test.go | 2 +- plugins/inputs/nsq/nsq.go | 2 +- plugins/inputs/nsq/nsq_test.go | 2 +- plugins/inputs/passenger/passenger.go | 2 +- plugins/inputs/passenger/passenger_test.go | 2 +- plugins/inputs/phpfpm/phpfpm.go | 2 +- plugins/inputs/phpfpm/phpfpm_test.go | 2 +- plugins/inputs/ping/ping.go | 2 +- plugins/inputs/ping/ping_test.go | 2 +- plugins/inputs/postgresql/postgresql.go | 2 +- plugins/inputs/postgresql/postgresql_test.go | 2 +- plugins/inputs/procstat/procstat.go | 2 +- plugins/inputs/procstat/procstat_test.go | 2 +- plugins/inputs/procstat/spec_processor.go | 2 +- plugins/inputs/prometheus/prometheus.go | 2 +- plugins/inputs/prometheus/prometheus_test.go | 2 +- plugins/inputs/puppetagent/puppetagent.go | 2 +- .../inputs/puppetagent/puppetagent_test.go | 2 +- plugins/inputs/rabbitmq/rabbitmq.go | 2 +- plugins/inputs/rabbitmq/rabbitmq_test.go | 2 +- plugins/inputs/redis/redis.go | 2 +- plugins/inputs/redis/redis_test.go | 2 +- plugins/inputs/rethinkdb/rethinkdb.go | 2 +- plugins/inputs/rethinkdb/rethinkdb_data.go | 2 +- .../inputs/rethinkdb/rethinkdb_data_test.go | 2 +- plugins/inputs/rethinkdb/rethinkdb_server.go | 2 +- .../inputs/rethinkdb/rethinkdb_server_test.go | 2 +- plugins/inputs/sensors/sensors.go | 2 +- plugins/inputs/statsd/README.md | 2 +- plugins/inputs/statsd/statsd.go | 4 +- plugins/inputs/statsd/statsd_test.go | 2 +- plugins/inputs/system/cpu.go | 2 +- plugins/inputs/system/cpu_test.go | 2 +- plugins/inputs/system/disk.go | 2 +- plugins/inputs/system/disk_test.go | 2 +- plugins/inputs/system/docker.go | 2 +- plugins/inputs/system/docker_test.go | 2 +- plugins/inputs/system/memory.go | 2 +- plugins/inputs/system/memory_test.go | 2 +- plugins/inputs/system/net.go | 2 +- plugins/inputs/system/net_test.go | 2 +- plugins/inputs/system/netstat.go | 2 +- plugins/inputs/system/ps.go | 4 +- plugins/inputs/system/system.go | 2 +- plugins/inputs/trig/trig.go | 2 +- plugins/inputs/trig/trig_test.go | 2 +- plugins/inputs/twemproxy/twemproxy.go | 2 +- plugins/inputs/twemproxy/twemproxy_test.go | 2 +- plugins/inputs/zfs/zfs.go | 4 +- plugins/inputs/zfs/zfs_test.go | 2 +- plugins/inputs/zookeeper/zookeeper.go | 2 +- plugins/inputs/zookeeper/zookeeper_test.go | 2 +- plugins/outputs/all/all.go | 26 +- plugins/outputs/amon/amon.go | 6 +- plugins/outputs/amon/amon_test.go | 4 +- plugins/outputs/amqp/amqp.go | 4 +- plugins/outputs/amqp/amqp_test.go | 2 +- plugins/outputs/datadog/datadog.go | 6 +- plugins/outputs/datadog/datadog_test.go | 4 +- plugins/outputs/graphite/graphite.go | 4 +- plugins/outputs/graphite/graphite_test.go | 2 +- plugins/outputs/influxdb/influxdb.go | 6 +- plugins/outputs/influxdb/influxdb_test.go | 2 +- plugins/outputs/kafka/kafka.go | 4 +- plugins/outputs/kafka/kafka_test.go | 2 +- plugins/outputs/kinesis/kinesis.go | 4 +- plugins/outputs/kinesis/kinesis_test.go | 2 +- plugins/outputs/librato/librato.go | 6 +- plugins/outputs/librato/librato_test.go | 4 +- plugins/outputs/mqtt/mqtt.go | 6 +- plugins/outputs/mqtt/mqtt_test.go | 2 +- plugins/outputs/nsq/nsq.go | 4 +- plugins/outputs/nsq/nsq_test.go | 2 +- plugins/outputs/opentsdb/opentsdb.go | 4 +- plugins/outputs/opentsdb/opentsdb_test.go | 2 +- .../prometheus_client/prometheus_client.go | 4 +- .../prometheus_client_test.go | 6 +- plugins/outputs/registry.go | 2 +- plugins/outputs/riemann/riemann.go | 4 +- plugins/outputs/riemann/riemann_test.go | 2 +- scripts/Vagrantfile | 4 +- scripts/circle-test.sh | 6 +- scripts/telegraf.service | 2 +- testutil/testutil.go | 2 +- 136 files changed, 396 insertions(+), 400 deletions(-) rename plugins/inputs/ghwebhooks/{ => models}/models.go (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9319c775e..e86c74ada 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ## v0.10.1 [unreleased] ### Features -- [#509](https://github.com/influxdb/telegraf/pull/509): Flatten JSON arrays with indices. Thanks @psilva261! +- [#509](https://github.com/influxdata/telegraf/pull/509): Flatten JSON arrays with indices. Thanks @psilva261! - [#512](https://github.com/influxdata/telegraf/pull/512): Python 3 build script, add lsof dep to package. Thanks @Ormod! - [#475](https://github.com/influxdata/telegraf/pull/475): Add response time to httpjson plugin. Thanks @titilambert! - [#519](https://github.com/influxdata/telegraf/pull/519): Added a sensors input based on lm-sensors. Thanks @md14454! @@ -12,14 +12,14 @@ - [#539](https://github.com/influxdata/telegraf/pull/539): Reload config on SIGHUP. Thanks @titilambert! - [#522](https://github.com/influxdata/telegraf/pull/522): Phusion passenger input plugin. Thanks @kureikain! - [#541](https://github.com/influxdata/telegraf/pull/541): Kafka output TLS cert support. Thanks @Ormod! -- [#551](https://github.com/influxdb/telegraf/pull/551): Statsd UDP read packet size now defaults to 1500 bytes, and is configurable. +- [#551](https://github.com/influxdata/telegraf/pull/551): Statsd UDP read packet size now defaults to 1500 bytes, and is configurable. - [#552](https://github.com/influxdata/telegraf/pull/552): Support for collection interval jittering. ### Bugfixes -- [#506](https://github.com/influxdb/telegraf/pull/506): Ping input doesn't return response time metric when timeout. Thanks @titilambert! -- [#508](https://github.com/influxdb/telegraf/pull/508): Fix prometheus cardinality issue with the `net` plugin +- [#506](https://github.com/influxdata/telegraf/pull/506): Ping input doesn't return response time metric when timeout. Thanks @titilambert! +- [#508](https://github.com/influxdata/telegraf/pull/508): Fix prometheus cardinality issue with the `net` plugin - [#499](https://github.com/influxdata/telegraf/issues/499) & [#502](https://github.com/influxdata/telegraf/issues/502): php fpm unix socket and other fixes, thanks @kureikain! -- [#543](https://github.com/influxdb/telegraf/issues/543): Statsd Packet size sometimes truncated. +- [#543](https://github.com/influxdata/telegraf/issues/543): Statsd Packet size sometimes truncated. ## v0.10.0 [2016-01-12] @@ -62,29 +62,29 @@ configurations overwritten by the upgrade. There is a backup stored at ## v0.2.5 [unreleased] ### Features -- [#427](https://github.com/influxdb/telegraf/pull/427): zfs plugin: pool stats added. Thanks @allenpetersen! -- [#428](https://github.com/influxdb/telegraf/pull/428): Amazon Kinesis output. Thanks @jimmystewpot! -- [#449](https://github.com/influxdb/telegraf/pull/449): influxdb plugin, thanks @mark-rushakoff +- [#427](https://github.com/influxdata/telegraf/pull/427): zfs plugin: pool stats added. Thanks @allenpetersen! +- [#428](https://github.com/influxdata/telegraf/pull/428): Amazon Kinesis output. Thanks @jimmystewpot! +- [#449](https://github.com/influxdata/telegraf/pull/449): influxdb plugin, thanks @mark-rushakoff ### Bugfixes -- [#430](https://github.com/influxdb/telegraf/issues/430): Network statistics removed in elasticsearch 2.1. Thanks @jipperinbham! -- [#452](https://github.com/influxdb/telegraf/issues/452): Elasticsearch open file handles error. Thanks @jipperinbham! +- [#430](https://github.com/influxdata/telegraf/issues/430): Network statistics removed in elasticsearch 2.1. Thanks @jipperinbham! +- [#452](https://github.com/influxdata/telegraf/issues/452): Elasticsearch open file handles error. Thanks @jipperinbham! ## v0.2.4 [2015-12-08] ### Features -- [#412](https://github.com/influxdb/telegraf/pull/412): Additional memcached stats. Thanks @mgresser! -- [#410](https://github.com/influxdb/telegraf/pull/410): Additional redis metrics. Thanks @vlaadbrain! -- [#414](https://github.com/influxdb/telegraf/issues/414): Jolokia plugin auth parameters -- [#415](https://github.com/influxdb/telegraf/issues/415): memcached plugin: support unix sockets -- [#418](https://github.com/influxdb/telegraf/pull/418): memcached plugin additional unit tests. -- [#408](https://github.com/influxdb/telegraf/pull/408): MailChimp plugin. -- [#382](https://github.com/influxdb/telegraf/pull/382): Add system wide network protocol stats to `net` plugin. -- [#401](https://github.com/influxdb/telegraf/pull/401): Support pass/drop/tagpass/tagdrop for outputs. Thanks @oldmantaiter! +- [#412](https://github.com/influxdata/telegraf/pull/412): Additional memcached stats. Thanks @mgresser! +- [#410](https://github.com/influxdata/telegraf/pull/410): Additional redis metrics. Thanks @vlaadbrain! +- [#414](https://github.com/influxdata/telegraf/issues/414): Jolokia plugin auth parameters +- [#415](https://github.com/influxdata/telegraf/issues/415): memcached plugin: support unix sockets +- [#418](https://github.com/influxdata/telegraf/pull/418): memcached plugin additional unit tests. +- [#408](https://github.com/influxdata/telegraf/pull/408): MailChimp plugin. +- [#382](https://github.com/influxdata/telegraf/pull/382): Add system wide network protocol stats to `net` plugin. +- [#401](https://github.com/influxdata/telegraf/pull/401): Support pass/drop/tagpass/tagdrop for outputs. Thanks @oldmantaiter! ### Bugfixes -- [#405](https://github.com/influxdb/telegraf/issues/405): Prometheus output cardinality issue -- [#388](https://github.com/influxdb/telegraf/issues/388): Fix collection hangup when cpu times decrement. +- [#405](https://github.com/influxdata/telegraf/issues/405): Prometheus output cardinality issue +- [#388](https://github.com/influxdata/telegraf/issues/388): Fix collection hangup when cpu times decrement. ## v0.2.3 [2015-11-30] @@ -113,15 +113,15 @@ same type can be specified, like this: - Aerospike plugin: tag changed from `host` -> `aerospike_host` ### Features -- [#379](https://github.com/influxdb/telegraf/pull/379): Riemann output, thanks @allenj! -- [#375](https://github.com/influxdb/telegraf/pull/375): kafka_consumer service plugin. -- [#392](https://github.com/influxdb/telegraf/pull/392): Procstat plugin can now accept pgrep -f pattern, thanks @ecarreras! -- [#383](https://github.com/influxdb/telegraf/pull/383): Specify plugins as a list. -- [#354](https://github.com/influxdb/telegraf/pull/354): Add ability to specify multiple metrics in one statsd line. Thanks @MerlinDMC! +- [#379](https://github.com/influxdata/telegraf/pull/379): Riemann output, thanks @allenj! +- [#375](https://github.com/influxdata/telegraf/pull/375): kafka_consumer service plugin. +- [#392](https://github.com/influxdata/telegraf/pull/392): Procstat plugin can now accept pgrep -f pattern, thanks @ecarreras! +- [#383](https://github.com/influxdata/telegraf/pull/383): Specify plugins as a list. +- [#354](https://github.com/influxdata/telegraf/pull/354): Add ability to specify multiple metrics in one statsd line. Thanks @MerlinDMC! ### Bugfixes -- [#371](https://github.com/influxdb/telegraf/issues/371): Kafka consumer plugin not functioning. -- [#389](https://github.com/influxdb/telegraf/issues/389): NaN value panic +- [#371](https://github.com/influxdata/telegraf/issues/371): Kafka consumer plugin not functioning. +- [#389](https://github.com/influxdata/telegraf/issues/389): NaN value panic ## v0.2.2 [2015-11-18] @@ -130,7 +130,7 @@ same type can be specified, like this: lists of servers/URLs. 0.2.2 is being released solely to fix that bug ### Bugfixes -- [#377](https://github.com/influxdb/telegraf/pull/377): Fix for duplicate slices in inputs. +- [#377](https://github.com/influxdata/telegraf/pull/377): Fix for duplicate slices in inputs. ## v0.2.1 [2015-11-16] @@ -147,22 +147,22 @@ changed to just run docker commands in the Makefile. See `make docker-run` and same type. ### Features -- [#325](https://github.com/influxdb/telegraf/pull/325): NSQ output. Thanks @jrxFive! -- [#318](https://github.com/influxdb/telegraf/pull/318): Prometheus output. Thanks @oldmantaiter! -- [#338](https://github.com/influxdb/telegraf/pull/338): Restart Telegraf on package upgrade. Thanks @linsomniac! -- [#337](https://github.com/influxdb/telegraf/pull/337): Jolokia plugin, thanks @saiello! -- [#350](https://github.com/influxdb/telegraf/pull/350): Amon output. -- [#365](https://github.com/influxdb/telegraf/pull/365): Twemproxy plugin by @codeb2cc -- [#317](https://github.com/influxdb/telegraf/issues/317): ZFS plugin, thanks @cornerot! -- [#364](https://github.com/influxdb/telegraf/pull/364): Support InfluxDB UDP output. -- [#370](https://github.com/influxdb/telegraf/pull/370): Support specifying multiple outputs, as lists. -- [#372](https://github.com/influxdb/telegraf/pull/372): Remove gosigar and update go-dockerclient for FreeBSD support. Thanks @MerlinDMC! +- [#325](https://github.com/influxdata/telegraf/pull/325): NSQ output. Thanks @jrxFive! +- [#318](https://github.com/influxdata/telegraf/pull/318): Prometheus output. Thanks @oldmantaiter! +- [#338](https://github.com/influxdata/telegraf/pull/338): Restart Telegraf on package upgrade. Thanks @linsomniac! +- [#337](https://github.com/influxdata/telegraf/pull/337): Jolokia plugin, thanks @saiello! +- [#350](https://github.com/influxdata/telegraf/pull/350): Amon output. +- [#365](https://github.com/influxdata/telegraf/pull/365): Twemproxy plugin by @codeb2cc +- [#317](https://github.com/influxdata/telegraf/issues/317): ZFS plugin, thanks @cornerot! +- [#364](https://github.com/influxdata/telegraf/pull/364): Support InfluxDB UDP output. +- [#370](https://github.com/influxdata/telegraf/pull/370): Support specifying multiple outputs, as lists. +- [#372](https://github.com/influxdata/telegraf/pull/372): Remove gosigar and update go-dockerclient for FreeBSD support. Thanks @MerlinDMC! ### Bugfixes -- [#331](https://github.com/influxdb/telegraf/pull/331): Dont overwrite host tag in redis plugin. -- [#336](https://github.com/influxdb/telegraf/pull/336): Mongodb plugin should take 2 measurements. -- [#351](https://github.com/influxdb/telegraf/issues/317): Fix continual "CREATE DATABASE" in writes -- [#360](https://github.com/influxdb/telegraf/pull/360): Apply prefix before ShouldPass check. Thanks @sotfo! +- [#331](https://github.com/influxdata/telegraf/pull/331): Dont overwrite host tag in redis plugin. +- [#336](https://github.com/influxdata/telegraf/pull/336): Mongodb plugin should take 2 measurements. +- [#351](https://github.com/influxdata/telegraf/issues/317): Fix continual "CREATE DATABASE" in writes +- [#360](https://github.com/influxdata/telegraf/pull/360): Apply prefix before ShouldPass check. Thanks @sotfo! ## v0.2.0 [2015-10-27] @@ -183,38 +183,38 @@ be controlled via the `round_interval` and `flush_jitter` config options. - Telegraf will now retry metric flushes twice ### Features -- [#205](https://github.com/influxdb/telegraf/issues/205): Include per-db redis keyspace info -- [#226](https://github.com/influxdb/telegraf/pull/226): Add timestamps to points in Kafka/AMQP outputs. Thanks @ekini -- [#90](https://github.com/influxdb/telegraf/issues/90): Add Docker labels to tags in docker plugin -- [#223](https://github.com/influxdb/telegraf/pull/223): Add port tag to nginx plugin. Thanks @neezgee! -- [#227](https://github.com/influxdb/telegraf/pull/227): Add command intervals to exec plugin. Thanks @jpalay! -- [#241](https://github.com/influxdb/telegraf/pull/241): MQTT Output. Thanks @shirou! +- [#205](https://github.com/influxdata/telegraf/issues/205): Include per-db redis keyspace info +- [#226](https://github.com/influxdata/telegraf/pull/226): Add timestamps to points in Kafka/AMQP outputs. Thanks @ekini +- [#90](https://github.com/influxdata/telegraf/issues/90): Add Docker labels to tags in docker plugin +- [#223](https://github.com/influxdata/telegraf/pull/223): Add port tag to nginx plugin. Thanks @neezgee! +- [#227](https://github.com/influxdata/telegraf/pull/227): Add command intervals to exec plugin. Thanks @jpalay! +- [#241](https://github.com/influxdata/telegraf/pull/241): MQTT Output. Thanks @shirou! - Memory plugin: cached and buffered measurements re-added - Logging: additional logging for each collection interval, track the number of metrics collected and from how many inputs. -- [#240](https://github.com/influxdb/telegraf/pull/240): procstat plugin, thanks @ranjib! -- [#244](https://github.com/influxdb/telegraf/pull/244): netstat plugin, thanks @shirou! -- [#262](https://github.com/influxdb/telegraf/pull/262): zookeeper plugin, thanks @jrxFive! -- [#237](https://github.com/influxdb/telegraf/pull/237): statsd service plugin, thanks @sparrc -- [#273](https://github.com/influxdb/telegraf/pull/273): puppet agent plugin, thats @jrxFive! -- [#280](https://github.com/influxdb/telegraf/issues/280): Use InfluxDB client v2. -- [#281](https://github.com/influxdb/telegraf/issues/281): Eliminate need to deep copy Batch Points. -- [#286](https://github.com/influxdb/telegraf/issues/286): bcache plugin, thanks @cornerot! -- [#287](https://github.com/influxdb/telegraf/issues/287): Batch AMQP output, thanks @ekini! -- [#301](https://github.com/influxdb/telegraf/issues/301): Collect on even intervals -- [#298](https://github.com/influxdb/telegraf/pull/298): Support retrying output writes -- [#300](https://github.com/influxdb/telegraf/issues/300): aerospike plugin. Thanks @oldmantaiter! -- [#322](https://github.com/influxdb/telegraf/issues/322): Librato output. Thanks @jipperinbham! +- [#240](https://github.com/influxdata/telegraf/pull/240): procstat plugin, thanks @ranjib! +- [#244](https://github.com/influxdata/telegraf/pull/244): netstat plugin, thanks @shirou! +- [#262](https://github.com/influxdata/telegraf/pull/262): zookeeper plugin, thanks @jrxFive! +- [#237](https://github.com/influxdata/telegraf/pull/237): statsd service plugin, thanks @sparrc +- [#273](https://github.com/influxdata/telegraf/pull/273): puppet agent plugin, thats @jrxFive! +- [#280](https://github.com/influxdata/telegraf/issues/280): Use InfluxDB client v2. +- [#281](https://github.com/influxdata/telegraf/issues/281): Eliminate need to deep copy Batch Points. +- [#286](https://github.com/influxdata/telegraf/issues/286): bcache plugin, thanks @cornerot! +- [#287](https://github.com/influxdata/telegraf/issues/287): Batch AMQP output, thanks @ekini! +- [#301](https://github.com/influxdata/telegraf/issues/301): Collect on even intervals +- [#298](https://github.com/influxdata/telegraf/pull/298): Support retrying output writes +- [#300](https://github.com/influxdata/telegraf/issues/300): aerospike plugin. Thanks @oldmantaiter! +- [#322](https://github.com/influxdata/telegraf/issues/322): Librato output. Thanks @jipperinbham! ### Bugfixes -- [#228](https://github.com/influxdb/telegraf/pull/228): New version of package will replace old one. Thanks @ekini! -- [#232](https://github.com/influxdb/telegraf/pull/232): Fix bashism run during deb package installation. Thanks @yankcrime! -- [#261](https://github.com/influxdb/telegraf/issues/260): RabbitMQ panics if wrong credentials given. Thanks @ekini! -- [#245](https://github.com/influxdb/telegraf/issues/245): Document Exec plugin example. Thanks @ekini! -- [#264](https://github.com/influxdb/telegraf/issues/264): logrotate config file fixes. Thanks @linsomniac! -- [#290](https://github.com/influxdb/telegraf/issues/290): Fix some plugins sending their values as strings. -- [#289](https://github.com/influxdb/telegraf/issues/289): Fix accumulator panic on nil tags. -- [#302](https://github.com/influxdb/telegraf/issues/302): Fix `[tags]` getting applied, thanks @gotyaoi! +- [#228](https://github.com/influxdata/telegraf/pull/228): New version of package will replace old one. Thanks @ekini! +- [#232](https://github.com/influxdata/telegraf/pull/232): Fix bashism run during deb package installation. Thanks @yankcrime! +- [#261](https://github.com/influxdata/telegraf/issues/260): RabbitMQ panics if wrong credentials given. Thanks @ekini! +- [#245](https://github.com/influxdata/telegraf/issues/245): Document Exec plugin example. Thanks @ekini! +- [#264](https://github.com/influxdata/telegraf/issues/264): logrotate config file fixes. Thanks @linsomniac! +- [#290](https://github.com/influxdata/telegraf/issues/290): Fix some plugins sending their values as strings. +- [#289](https://github.com/influxdata/telegraf/issues/289): Fix accumulator panic on nil tags. +- [#302](https://github.com/influxdata/telegraf/issues/302): Fix `[tags]` getting applied, thanks @gotyaoi! ## v0.1.9 [2015-09-22] @@ -240,27 +240,27 @@ have been renamed for consistency. Some measurements have also been removed from re-added in a "verbose" mode if there is demand for it. ### Features -- [#143](https://github.com/influxdb/telegraf/issues/143): InfluxDB clustering support -- [#181](https://github.com/influxdb/telegraf/issues/181): Makefile GOBIN support. Thanks @Vye! -- [#203](https://github.com/influxdb/telegraf/pull/200): AMQP output. Thanks @ekini! -- [#182](https://github.com/influxdb/telegraf/pull/182): OpenTSDB output. Thanks @rplessl! -- [#187](https://github.com/influxdb/telegraf/pull/187): Retry output sink connections on startup. -- [#220](https://github.com/influxdb/telegraf/pull/220): Add port tag to apache plugin. Thanks @neezgee! -- [#217](https://github.com/influxdb/telegraf/pull/217): Add filtering for output sinks +- [#143](https://github.com/influxdata/telegraf/issues/143): InfluxDB clustering support +- [#181](https://github.com/influxdata/telegraf/issues/181): Makefile GOBIN support. Thanks @Vye! +- [#203](https://github.com/influxdata/telegraf/pull/200): AMQP output. Thanks @ekini! +- [#182](https://github.com/influxdata/telegraf/pull/182): OpenTSDB output. Thanks @rplessl! +- [#187](https://github.com/influxdata/telegraf/pull/187): Retry output sink connections on startup. +- [#220](https://github.com/influxdata/telegraf/pull/220): Add port tag to apache plugin. Thanks @neezgee! +- [#217](https://github.com/influxdata/telegraf/pull/217): Add filtering for output sinks and filtering when specifying a config file. ### Bugfixes -- [#170](https://github.com/influxdb/telegraf/issues/170): Systemd support -- [#175](https://github.com/influxdb/telegraf/issues/175): Set write precision before gathering metrics -- [#178](https://github.com/influxdb/telegraf/issues/178): redis plugin, multiple server thread hang bug +- [#170](https://github.com/influxdata/telegraf/issues/170): Systemd support +- [#175](https://github.com/influxdata/telegraf/issues/175): Set write precision before gathering metrics +- [#178](https://github.com/influxdata/telegraf/issues/178): redis plugin, multiple server thread hang bug - Fix net plugin on darwin -- [#84](https://github.com/influxdb/telegraf/issues/84): Fix docker plugin on CentOS. Thanks @neezgee! -- [#189](https://github.com/influxdb/telegraf/pull/189): Fix mem_used_perc. Thanks @mced! -- [#192](https://github.com/influxdb/telegraf/issues/192): Increase compatibility of postgresql plugin. Now supports versions 8.1+ -- [#203](https://github.com/influxdb/telegraf/issues/203): EL5 rpm support. Thanks @ekini! -- [#206](https://github.com/influxdb/telegraf/issues/206): CPU steal/guest values wrong on linux. -- [#212](https://github.com/influxdb/telegraf/issues/212): Add hashbang to postinstall script. Thanks @ekini! -- [#212](https://github.com/influxdb/telegraf/issues/212): Fix makefile warning. Thanks @ekini! +- [#84](https://github.com/influxdata/telegraf/issues/84): Fix docker plugin on CentOS. Thanks @neezgee! +- [#189](https://github.com/influxdata/telegraf/pull/189): Fix mem_used_perc. Thanks @mced! +- [#192](https://github.com/influxdata/telegraf/issues/192): Increase compatibility of postgresql plugin. Now supports versions 8.1+ +- [#203](https://github.com/influxdata/telegraf/issues/203): EL5 rpm support. Thanks @ekini! +- [#206](https://github.com/influxdata/telegraf/issues/206): CPU steal/guest values wrong on linux. +- [#212](https://github.com/influxdata/telegraf/issues/212): Add hashbang to postinstall script. Thanks @ekini! +- [#212](https://github.com/influxdata/telegraf/issues/212): Fix makefile warning. Thanks @ekini! ## v0.1.8 [2015-09-04] @@ -269,106 +269,106 @@ and filtering when specifying a config file. - Now using Go 1.5 to build telegraf ### Features -- [#150](https://github.com/influxdb/telegraf/pull/150): Add Host Uptime metric to system plugin -- [#158](https://github.com/influxdb/telegraf/pull/158): Apache Plugin. Thanks @KPACHbIuLLIAnO4 -- [#159](https://github.com/influxdb/telegraf/pull/159): Use second precision for InfluxDB writes -- [#165](https://github.com/influxdb/telegraf/pull/165): Add additional metrics to mysql plugin. Thanks @nickscript0 -- [#162](https://github.com/influxdb/telegraf/pull/162): Write UTC by default, provide option -- [#166](https://github.com/influxdb/telegraf/pull/166): Upload binaries to S3 -- [#169](https://github.com/influxdb/telegraf/pull/169): Ping plugin +- [#150](https://github.com/influxdata/telegraf/pull/150): Add Host Uptime metric to system plugin +- [#158](https://github.com/influxdata/telegraf/pull/158): Apache Plugin. Thanks @KPACHbIuLLIAnO4 +- [#159](https://github.com/influxdata/telegraf/pull/159): Use second precision for InfluxDB writes +- [#165](https://github.com/influxdata/telegraf/pull/165): Add additional metrics to mysql plugin. Thanks @nickscript0 +- [#162](https://github.com/influxdata/telegraf/pull/162): Write UTC by default, provide option +- [#166](https://github.com/influxdata/telegraf/pull/166): Upload binaries to S3 +- [#169](https://github.com/influxdata/telegraf/pull/169): Ping plugin ### Bugfixes ## v0.1.7 [2015-08-28] ### Features -- [#38](https://github.com/influxdb/telegraf/pull/38): Kafka output producer. -- [#133](https://github.com/influxdb/telegraf/pull/133): Add plugin.Gather error logging. Thanks @nickscript0! -- [#136](https://github.com/influxdb/telegraf/issues/136): Add a -usage flag for printing usage of a single plugin. -- [#137](https://github.com/influxdb/telegraf/issues/137): Memcached: fix when a value contains a space -- [#138](https://github.com/influxdb/telegraf/issues/138): MySQL server address tag. -- [#142](https://github.com/influxdb/telegraf/pull/142): Add Description and SampleConfig funcs to output interface +- [#38](https://github.com/influxdata/telegraf/pull/38): Kafka output producer. +- [#133](https://github.com/influxdata/telegraf/pull/133): Add plugin.Gather error logging. Thanks @nickscript0! +- [#136](https://github.com/influxdata/telegraf/issues/136): Add a -usage flag for printing usage of a single plugin. +- [#137](https://github.com/influxdata/telegraf/issues/137): Memcached: fix when a value contains a space +- [#138](https://github.com/influxdata/telegraf/issues/138): MySQL server address tag. +- [#142](https://github.com/influxdata/telegraf/pull/142): Add Description and SampleConfig funcs to output interface - Indent the toml config file for readability ### Bugfixes -- [#128](https://github.com/influxdb/telegraf/issues/128): system_load measurement missing. -- [#129](https://github.com/influxdb/telegraf/issues/129): Latest pkg url fix. -- [#131](https://github.com/influxdb/telegraf/issues/131): Fix memory reporting on linux & darwin. Thanks @subhachandrachandra! -- [#140](https://github.com/influxdb/telegraf/issues/140): Memory plugin prec->perc typo fix. Thanks @brunoqc! +- [#128](https://github.com/influxdata/telegraf/issues/128): system_load measurement missing. +- [#129](https://github.com/influxdata/telegraf/issues/129): Latest pkg url fix. +- [#131](https://github.com/influxdata/telegraf/issues/131): Fix memory reporting on linux & darwin. Thanks @subhachandrachandra! +- [#140](https://github.com/influxdata/telegraf/issues/140): Memory plugin prec->perc typo fix. Thanks @brunoqc! ## v0.1.6 [2015-08-20] ### Features -- [#112](https://github.com/influxdb/telegraf/pull/112): Datadog output. Thanks @jipperinbham! -- [#116](https://github.com/influxdb/telegraf/pull/116): Use godep to vendor all dependencies -- [#120](https://github.com/influxdb/telegraf/pull/120): Httpjson plugin. Thanks @jpalay & @alvaromorales! +- [#112](https://github.com/influxdata/telegraf/pull/112): Datadog output. Thanks @jipperinbham! +- [#116](https://github.com/influxdata/telegraf/pull/116): Use godep to vendor all dependencies +- [#120](https://github.com/influxdata/telegraf/pull/120): Httpjson plugin. Thanks @jpalay & @alvaromorales! ### Bugfixes -- [#113](https://github.com/influxdb/telegraf/issues/113): Update README with Telegraf/InfluxDB compatibility -- [#118](https://github.com/influxdb/telegraf/pull/118): Fix for disk usage stats in Windows. Thanks @srfraser! -- [#122](https://github.com/influxdb/telegraf/issues/122): Fix for DiskUsage segv fault. Thanks @srfraser! -- [#126](https://github.com/influxdb/telegraf/issues/126): Nginx plugin not catching net.SplitHostPort error +- [#113](https://github.com/influxdata/telegraf/issues/113): Update README with Telegraf/InfluxDB compatibility +- [#118](https://github.com/influxdata/telegraf/pull/118): Fix for disk usage stats in Windows. Thanks @srfraser! +- [#122](https://github.com/influxdata/telegraf/issues/122): Fix for DiskUsage segv fault. Thanks @srfraser! +- [#126](https://github.com/influxdata/telegraf/issues/126): Nginx plugin not catching net.SplitHostPort error ## v0.1.5 [2015-08-13] ### Features -- [#54](https://github.com/influxdb/telegraf/pull/54): MongoDB plugin. Thanks @jipperinbham! -- [#55](https://github.com/influxdb/telegraf/pull/55): Elasticsearch plugin. Thanks @brocaar! -- [#71](https://github.com/influxdb/telegraf/pull/71): HAProxy plugin. Thanks @kureikain! -- [#72](https://github.com/influxdb/telegraf/pull/72): Adding TokuDB metrics to MySQL. Thanks vadimtk! -- [#73](https://github.com/influxdb/telegraf/pull/73): RabbitMQ plugin. Thanks @ianunruh! -- [#77](https://github.com/influxdb/telegraf/issues/77): Automatically create database. -- [#79](https://github.com/influxdb/telegraf/pull/56): Nginx plugin. Thanks @codeb2cc! -- [#86](https://github.com/influxdb/telegraf/pull/86): Lustre2 plugin. Thanks srfraser! -- [#91](https://github.com/influxdb/telegraf/pull/91): Unit testing -- [#92](https://github.com/influxdb/telegraf/pull/92): Exec plugin. Thanks @alvaromorales! -- [#98](https://github.com/influxdb/telegraf/pull/98): LeoFS plugin. Thanks @mocchira! -- [#103](https://github.com/influxdb/telegraf/pull/103): Filter by metric tags. Thanks @srfraser! -- [#106](https://github.com/influxdb/telegraf/pull/106): Options to filter plugins on startup. Thanks @zepouet! -- [#107](https://github.com/influxdb/telegraf/pull/107): Multiple outputs beyong influxdb. Thanks @jipperinbham! -- [#108](https://github.com/influxdb/telegraf/issues/108): Support setting per-CPU and total-CPU gathering. -- [#111](https://github.com/influxdb/telegraf/pull/111): Report CPU Usage in cpu plugin. Thanks @jpalay! +- [#54](https://github.com/influxdata/telegraf/pull/54): MongoDB plugin. Thanks @jipperinbham! +- [#55](https://github.com/influxdata/telegraf/pull/55): Elasticsearch plugin. Thanks @brocaar! +- [#71](https://github.com/influxdata/telegraf/pull/71): HAProxy plugin. Thanks @kureikain! +- [#72](https://github.com/influxdata/telegraf/pull/72): Adding TokuDB metrics to MySQL. Thanks vadimtk! +- [#73](https://github.com/influxdata/telegraf/pull/73): RabbitMQ plugin. Thanks @ianunruh! +- [#77](https://github.com/influxdata/telegraf/issues/77): Automatically create database. +- [#79](https://github.com/influxdata/telegraf/pull/56): Nginx plugin. Thanks @codeb2cc! +- [#86](https://github.com/influxdata/telegraf/pull/86): Lustre2 plugin. Thanks srfraser! +- [#91](https://github.com/influxdata/telegraf/pull/91): Unit testing +- [#92](https://github.com/influxdata/telegraf/pull/92): Exec plugin. Thanks @alvaromorales! +- [#98](https://github.com/influxdata/telegraf/pull/98): LeoFS plugin. Thanks @mocchira! +- [#103](https://github.com/influxdata/telegraf/pull/103): Filter by metric tags. Thanks @srfraser! +- [#106](https://github.com/influxdata/telegraf/pull/106): Options to filter plugins on startup. Thanks @zepouet! +- [#107](https://github.com/influxdata/telegraf/pull/107): Multiple outputs beyong influxdb. Thanks @jipperinbham! +- [#108](https://github.com/influxdata/telegraf/issues/108): Support setting per-CPU and total-CPU gathering. +- [#111](https://github.com/influxdata/telegraf/pull/111): Report CPU Usage in cpu plugin. Thanks @jpalay! ### Bugfixes -- [#85](https://github.com/influxdb/telegraf/pull/85): Fix GetLocalHost testutil function for mac users -- [#89](https://github.com/influxdb/telegraf/pull/89): go fmt fixes -- [#94](https://github.com/influxdb/telegraf/pull/94): Fix for issue #93, explicitly call sarama.v1 -> sarama -- [#101](https://github.com/influxdb/telegraf/issues/101): switch back from master branch if building locally -- [#99](https://github.com/influxdb/telegraf/issues/99): update integer output to new InfluxDB line protocol format +- [#85](https://github.com/influxdata/telegraf/pull/85): Fix GetLocalHost testutil function for mac users +- [#89](https://github.com/influxdata/telegraf/pull/89): go fmt fixes +- [#94](https://github.com/influxdata/telegraf/pull/94): Fix for issue #93, explicitly call sarama.v1 -> sarama +- [#101](https://github.com/influxdata/telegraf/issues/101): switch back from master branch if building locally +- [#99](https://github.com/influxdata/telegraf/issues/99): update integer output to new InfluxDB line protocol format ## v0.1.4 [2015-07-09] ### Features -- [#56](https://github.com/influxdb/telegraf/pull/56): Update README for Kafka plugin. Thanks @EmilS! +- [#56](https://github.com/influxdata/telegraf/pull/56): Update README for Kafka plugin. Thanks @EmilS! ### Bugfixes -- [#50](https://github.com/influxdb/telegraf/pull/50): Fix init.sh script to use telegraf directory. Thanks @jseriff! -- [#52](https://github.com/influxdb/telegraf/pull/52): Update CHANGELOG to reference updated directory. Thanks @benfb! +- [#50](https://github.com/influxdata/telegraf/pull/50): Fix init.sh script to use telegraf directory. Thanks @jseriff! +- [#52](https://github.com/influxdata/telegraf/pull/52): Update CHANGELOG to reference updated directory. Thanks @benfb! ## v0.1.3 [2015-07-05] ### Features -- [#35](https://github.com/influxdb/telegraf/pull/35): Add Kafka plugin. Thanks @EmilS! -- [#47](https://github.com/influxdb/telegraf/pull/47): Add RethinkDB plugin. Thanks @jipperinbham! +- [#35](https://github.com/influxdata/telegraf/pull/35): Add Kafka plugin. Thanks @EmilS! +- [#47](https://github.com/influxdata/telegraf/pull/47): Add RethinkDB plugin. Thanks @jipperinbham! ### Bugfixes -- [#45](https://github.com/influxdb/telegraf/pull/45): Skip disk tags that don't have a value. Thanks @jhofeditz! -- [#43](https://github.com/influxdb/telegraf/pull/43): Fix bug in MySQL plugin. Thanks @marcosnils! +- [#45](https://github.com/influxdata/telegraf/pull/45): Skip disk tags that don't have a value. Thanks @jhofeditz! +- [#43](https://github.com/influxdata/telegraf/pull/43): Fix bug in MySQL plugin. Thanks @marcosnils! ## v0.1.2 [2015-07-01] ### Features -- [#12](https://github.com/influxdb/telegraf/pull/12): Add Linux/ARM to the list of built binaries. Thanks @voxxit! -- [#14](https://github.com/influxdb/telegraf/pull/14): Clarify the S3 buckets that Telegraf is pushed to. -- [#16](https://github.com/influxdb/telegraf/pull/16): Convert Redis to use URI, support Redis AUTH. Thanks @jipperinbham! -- [#21](https://github.com/influxdb/telegraf/pull/21): Add memcached plugin. Thanks @Yukki! +- [#12](https://github.com/influxdata/telegraf/pull/12): Add Linux/ARM to the list of built binaries. Thanks @voxxit! +- [#14](https://github.com/influxdata/telegraf/pull/14): Clarify the S3 buckets that Telegraf is pushed to. +- [#16](https://github.com/influxdata/telegraf/pull/16): Convert Redis to use URI, support Redis AUTH. Thanks @jipperinbham! +- [#21](https://github.com/influxdata/telegraf/pull/21): Add memcached plugin. Thanks @Yukki! ### Bugfixes -- [#13](https://github.com/influxdb/telegraf/pull/13): Fix the packaging script. -- [#19](https://github.com/influxdb/telegraf/pull/19): Add host name to metric tags. Thanks @sherifzain! -- [#20](https://github.com/influxdb/telegraf/pull/20): Fix race condition with accumulator mutex. Thanks @nkatsaros! -- [#23](https://github.com/influxdb/telegraf/pull/23): Change name of folder for packages. Thanks @colinrymer! -- [#32](https://github.com/influxdb/telegraf/pull/32): Fix spelling of memoory -> memory. Thanks @tylernisonoff! +- [#13](https://github.com/influxdata/telegraf/pull/13): Fix the packaging script. +- [#19](https://github.com/influxdata/telegraf/pull/19): Add host name to metric tags. Thanks @sherifzain! +- [#20](https://github.com/influxdata/telegraf/pull/20): Fix race condition with accumulator mutex. Thanks @nkatsaros! +- [#23](https://github.com/influxdata/telegraf/pull/23): Change name of folder for packages. Thanks @colinrymer! +- [#32](https://github.com/influxdata/telegraf/pull/32): Fix spelling of memoory -> memory. Thanks @tylernisonoff! ## v0.1.1 [2015-06-19] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a47ad2f17..dfe6a77f4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ and submit new inputs. * Input Plugins should call `inputs.Add` in their `init` function to register themselves. See below for a quick example. * Input Plugins must be added to the -`github.com/influxdb/telegraf/plugins/inputs/all/all.go` file. +`github.com/influxdata/telegraf/plugins/inputs/all/all.go` file. * The `SampleConfig` function should return valid toml that describes how the plugin can be configured. This is include in `telegraf -sample-config`. * The `Description` function should say in one line what this plugin does. @@ -75,7 +75,7 @@ package simple // simple.go -import "github.com/influxdb/telegraf/plugins/inputs" +import "github.com/influxdata/telegraf/plugins/inputs" type Simple struct { Ok bool @@ -147,7 +147,7 @@ similar constructs. * Outputs should call `outputs.Add` in their `init` function to register themselves. See below for a quick example. * To be available within Telegraf itself, plugins must add themselves to the -`github.com/influxdb/telegraf/plugins/outputs/all/all.go` file. +`github.com/influxdata/telegraf/plugins/outputs/all/all.go` file. * The `SampleConfig` function should return valid toml that describes how the output can be configured. This is include in `telegraf -sample-config`. * The `Description` function should say in one line what this output does. @@ -171,7 +171,7 @@ package simpleoutput // simpleoutput.go -import "github.com/influxdb/telegraf/plugins/outputs" +import "github.com/influxdata/telegraf/plugins/outputs" type Simple struct { Ok bool @@ -252,7 +252,7 @@ which would take some time to replicate. To overcome this situation we've decided to use docker containers to provide a fast and reproducible environment to test those services which require it. For other situations -(i.e: https://github.com/influxdb/telegraf/blob/master/plugins/redis/redis_test.go) +(i.e: https://github.com/influxdata/telegraf/blob/master/plugins/redis/redis_test.go) a simple mock will suffice. To execute Telegraf tests follow these simple steps: diff --git a/Godeps b/Godeps index f719539f5..c62d6feda 100644 --- a/Godeps +++ b/Godeps @@ -22,7 +22,7 @@ github.com/hailocab/go-hostpool 50839ee41f32bfca8d03a183031aa634b2dc1c64 github.com/hashicorp/go-msgpack fa3f63826f7c23912c15263591e65d54d080b458 github.com/hashicorp/raft b95f335efee1992886864389183ebda0c0a5d0f6 github.com/hashicorp/raft-boltdb d1e82c1ec3f15ee991f7cc7ffd5b67ff6f5bbaee -github.com/influxdb/influxdb 0e0f85a0c1fd1788ae4f9145531b02c539cfa5b5 +github.com/influxdata/influxdb 0e0f85a0c1fd1788ae4f9145531b02c539cfa5b5 github.com/jmespath/go-jmespath c01cf91b011868172fdcd9f41838e80c9d716264 github.com/klauspost/crc32 999f3125931f6557b991b2f8472172bdfa578d38 github.com/lib/pq 8ad2b298cadd691a77015666a5372eae5dbfac8f diff --git a/README.md b/README.md index 80c739d03..5a997d363 100644 --- a/README.md +++ b/README.md @@ -77,8 +77,8 @@ if you don't have it already. You also must build with golang version 1.5+. 1. [Install Go](https://golang.org/doc/install) 2. [Setup your GOPATH](https://golang.org/doc/code.html#GOPATH) -3. Run `go get github.com/influxdb/telegraf` -4. Run `cd $GOPATH/src/github.com/influxdb/telegraf` +3. Run `go get github.com/influxdata/telegraf` +4. Run `cd $GOPATH/src/github.com/influxdata/telegraf` 5. Run `make` ### How to use it: diff --git a/accumulator.go b/accumulator.go index 429f3a42c..c628907d7 100644 --- a/accumulator.go +++ b/accumulator.go @@ -7,9 +7,9 @@ import ( "sync" "time" - "github.com/influxdb/telegraf/internal/config" + "github.com/influxdata/telegraf/internal/config" - "github.com/influxdb/influxdb/client/v2" + "github.com/influxdata/influxdb/client/v2" ) type Accumulator interface { diff --git a/agent.go b/agent.go index 25b157c54..772c1c27e 100644 --- a/agent.go +++ b/agent.go @@ -10,11 +10,11 @@ import ( "sync" "time" - "github.com/influxdb/telegraf/internal/config" - "github.com/influxdb/telegraf/plugins/inputs" - "github.com/influxdb/telegraf/plugins/outputs" + "github.com/influxdata/telegraf/internal/config" + "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/outputs" - "github.com/influxdb/influxdb/client/v2" + "github.com/influxdata/influxdb/client/v2" ) // Agent runs telegraf and collects data based on the given config diff --git a/agent_test.go b/agent_test.go index 1cb020c7b..3420e665a 100644 --- a/agent_test.go +++ b/agent_test.go @@ -5,12 +5,12 @@ import ( "testing" "time" - "github.com/influxdb/telegraf/internal/config" + "github.com/influxdata/telegraf/internal/config" // needing to load the plugins - _ "github.com/influxdb/telegraf/plugins/inputs/all" + _ "github.com/influxdata/telegraf/plugins/inputs/all" // needing to load the outputs - _ "github.com/influxdb/telegraf/plugins/outputs/all" + _ "github.com/influxdata/telegraf/plugins/outputs/all" ) func TestAgent_LoadPlugin(t *testing.T) { diff --git a/cmd/telegraf/telegraf.go b/cmd/telegraf/telegraf.go index 554569012..72fb9fdcf 100644 --- a/cmd/telegraf/telegraf.go +++ b/cmd/telegraf/telegraf.go @@ -9,10 +9,10 @@ import ( "strings" "syscall" - "github.com/influxdb/telegraf" - "github.com/influxdb/telegraf/internal/config" - _ "github.com/influxdb/telegraf/plugins/inputs/all" - _ "github.com/influxdb/telegraf/plugins/outputs/all" + "github.com/influxdata/telegraf" + "github.com/influxdata/telegraf/internal/config" + _ "github.com/influxdata/telegraf/plugins/inputs/all" + _ "github.com/influxdata/telegraf/plugins/outputs/all" ) var fDebug = flag.Bool("debug", false, diff --git a/internal/config/config.go b/internal/config/config.go index e4d7fbc9d..3b5e4ff17 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -10,14 +10,14 @@ import ( "strings" "time" - "github.com/influxdb/telegraf/internal" - "github.com/influxdb/telegraf/plugins/inputs" - "github.com/influxdb/telegraf/plugins/outputs" + "github.com/influxdata/telegraf/internal" + "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/outputs" "github.com/naoina/toml" "github.com/naoina/toml/ast" - "github.com/influxdb/influxdb/client/v2" + "github.com/influxdata/influxdb/client/v2" ) // Config specifies the URL/user/password for the database that telegraf diff --git a/internal/config/config_test.go b/internal/config/config_test.go index c8ed79bdf..40af30c1e 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -4,10 +4,10 @@ import ( "testing" "time" - "github.com/influxdb/telegraf/plugins/inputs" - "github.com/influxdb/telegraf/plugins/inputs/exec" - "github.com/influxdb/telegraf/plugins/inputs/memcached" - "github.com/influxdb/telegraf/plugins/inputs/procstat" + "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs/exec" + "github.com/influxdata/telegraf/plugins/inputs/memcached" + "github.com/influxdata/telegraf/plugins/inputs/procstat" "github.com/stretchr/testify/assert" ) diff --git a/plugins/inputs/aerospike/aerospike.go b/plugins/inputs/aerospike/aerospike.go index 5f847ebfa..aa015a4c0 100644 --- a/plugins/inputs/aerospike/aerospike.go +++ b/plugins/inputs/aerospike/aerospike.go @@ -4,7 +4,7 @@ import ( "bytes" "encoding/binary" "fmt" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" "net" "strconv" "strings" diff --git a/plugins/inputs/aerospike/aerospike_test.go b/plugins/inputs/aerospike/aerospike_test.go index 3f4d909a2..74b70eb1d 100644 --- a/plugins/inputs/aerospike/aerospike_test.go +++ b/plugins/inputs/aerospike/aerospike_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/all/all.go b/plugins/inputs/all/all.go index c9e8ea4c8..f2643aef8 100644 --- a/plugins/inputs/all/all.go +++ b/plugins/inputs/all/all.go @@ -1,40 +1,41 @@ package all import ( - _ "github.com/influxdb/telegraf/plugins/inputs/aerospike" - _ "github.com/influxdb/telegraf/plugins/inputs/apache" - _ "github.com/influxdb/telegraf/plugins/inputs/bcache" - _ "github.com/influxdb/telegraf/plugins/inputs/disque" - _ "github.com/influxdb/telegraf/plugins/inputs/elasticsearch" - _ "github.com/influxdb/telegraf/plugins/inputs/exec" - _ "github.com/influxdb/telegraf/plugins/inputs/haproxy" - _ "github.com/influxdb/telegraf/plugins/inputs/httpjson" - _ "github.com/influxdb/telegraf/plugins/inputs/influxdb" - _ "github.com/influxdb/telegraf/plugins/inputs/jolokia" - _ "github.com/influxdb/telegraf/plugins/inputs/kafka_consumer" - _ "github.com/influxdb/telegraf/plugins/inputs/leofs" - _ "github.com/influxdb/telegraf/plugins/inputs/lustre2" - _ "github.com/influxdb/telegraf/plugins/inputs/mailchimp" - _ "github.com/influxdb/telegraf/plugins/inputs/memcached" - _ "github.com/influxdb/telegraf/plugins/inputs/mongodb" - _ "github.com/influxdb/telegraf/plugins/inputs/mysql" - _ "github.com/influxdb/telegraf/plugins/inputs/nginx" - _ "github.com/influxdb/telegraf/plugins/inputs/nsq" - _ "github.com/influxdb/telegraf/plugins/inputs/passenger" - _ "github.com/influxdb/telegraf/plugins/inputs/phpfpm" - _ "github.com/influxdb/telegraf/plugins/inputs/ping" - _ "github.com/influxdb/telegraf/plugins/inputs/postgresql" - _ "github.com/influxdb/telegraf/plugins/inputs/procstat" - _ "github.com/influxdb/telegraf/plugins/inputs/prometheus" - _ "github.com/influxdb/telegraf/plugins/inputs/puppetagent" - _ "github.com/influxdb/telegraf/plugins/inputs/rabbitmq" - _ "github.com/influxdb/telegraf/plugins/inputs/redis" - _ "github.com/influxdb/telegraf/plugins/inputs/rethinkdb" - _ "github.com/influxdb/telegraf/plugins/inputs/sensors" - _ "github.com/influxdb/telegraf/plugins/inputs/statsd" - _ "github.com/influxdb/telegraf/plugins/inputs/system" - _ "github.com/influxdb/telegraf/plugins/inputs/trig" - _ "github.com/influxdb/telegraf/plugins/inputs/twemproxy" - _ "github.com/influxdb/telegraf/plugins/inputs/zfs" - _ "github.com/influxdb/telegraf/plugins/inputs/zookeeper" + _ "github.com/influxdata/telegraf/plugins/inputs/aerospike" + _ "github.com/influxdata/telegraf/plugins/inputs/apache" + _ "github.com/influxdata/telegraf/plugins/inputs/bcache" + _ "github.com/influxdata/telegraf/plugins/inputs/disque" + _ "github.com/influxdata/telegraf/plugins/inputs/elasticsearch" + _ "github.com/influxdata/telegraf/plugins/inputs/exec" + _ "github.com/influxdata/telegraf/plugins/inputs/ghwebhooks" + _ "github.com/influxdata/telegraf/plugins/inputs/haproxy" + _ "github.com/influxdata/telegraf/plugins/inputs/httpjson" + _ "github.com/influxdata/telegraf/plugins/inputs/influxdb" + _ "github.com/influxdata/telegraf/plugins/inputs/jolokia" + _ "github.com/influxdata/telegraf/plugins/inputs/kafka_consumer" + _ "github.com/influxdata/telegraf/plugins/inputs/leofs" + _ "github.com/influxdata/telegraf/plugins/inputs/lustre2" + _ "github.com/influxdata/telegraf/plugins/inputs/mailchimp" + _ "github.com/influxdata/telegraf/plugins/inputs/memcached" + _ "github.com/influxdata/telegraf/plugins/inputs/mongodb" + _ "github.com/influxdata/telegraf/plugins/inputs/mysql" + _ "github.com/influxdata/telegraf/plugins/inputs/nginx" + _ "github.com/influxdata/telegraf/plugins/inputs/nsq" + _ "github.com/influxdata/telegraf/plugins/inputs/passenger" + _ "github.com/influxdata/telegraf/plugins/inputs/phpfpm" + _ "github.com/influxdata/telegraf/plugins/inputs/ping" + _ "github.com/influxdata/telegraf/plugins/inputs/postgresql" + _ "github.com/influxdata/telegraf/plugins/inputs/procstat" + _ "github.com/influxdata/telegraf/plugins/inputs/prometheus" + _ "github.com/influxdata/telegraf/plugins/inputs/puppetagent" + _ "github.com/influxdata/telegraf/plugins/inputs/rabbitmq" + _ "github.com/influxdata/telegraf/plugins/inputs/redis" + _ "github.com/influxdata/telegraf/plugins/inputs/rethinkdb" + _ "github.com/influxdata/telegraf/plugins/inputs/sensors" + _ "github.com/influxdata/telegraf/plugins/inputs/statsd" + _ "github.com/influxdata/telegraf/plugins/inputs/system" + _ "github.com/influxdata/telegraf/plugins/inputs/trig" + _ "github.com/influxdata/telegraf/plugins/inputs/twemproxy" + _ "github.com/influxdata/telegraf/plugins/inputs/zfs" + _ "github.com/influxdata/telegraf/plugins/inputs/zookeeper" ) diff --git a/plugins/inputs/apache/apache.go b/plugins/inputs/apache/apache.go index f48bac336..317a635d3 100644 --- a/plugins/inputs/apache/apache.go +++ b/plugins/inputs/apache/apache.go @@ -11,7 +11,7 @@ import ( "sync" "time" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type Apache struct { diff --git a/plugins/inputs/apache/apache_test.go b/plugins/inputs/apache/apache_test.go index 16c319974..8eed61ca6 100644 --- a/plugins/inputs/apache/apache_test.go +++ b/plugins/inputs/apache/apache_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/bcache/bcache.go b/plugins/inputs/bcache/bcache.go index 146849eef..b6d6eb130 100644 --- a/plugins/inputs/bcache/bcache.go +++ b/plugins/inputs/bcache/bcache.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type Bcache struct { diff --git a/plugins/inputs/bcache/bcache_test.go b/plugins/inputs/bcache/bcache_test.go index 0f34d016b..bd191528f 100644 --- a/plugins/inputs/bcache/bcache_test.go +++ b/plugins/inputs/bcache/bcache_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/disque/disque.go b/plugins/inputs/disque/disque.go index 334fdd554..364e78fbc 100644 --- a/plugins/inputs/disque/disque.go +++ b/plugins/inputs/disque/disque.go @@ -10,7 +10,7 @@ import ( "strings" "sync" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type Disque struct { diff --git a/plugins/inputs/disque/disque_test.go b/plugins/inputs/disque/disque_test.go index 91c7dc979..f060e9568 100644 --- a/plugins/inputs/disque/disque_test.go +++ b/plugins/inputs/disque/disque_test.go @@ -6,7 +6,7 @@ import ( "net" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/elasticsearch/elasticsearch.go b/plugins/inputs/elasticsearch/elasticsearch.go index f8185a053..9b59537c0 100644 --- a/plugins/inputs/elasticsearch/elasticsearch.go +++ b/plugins/inputs/elasticsearch/elasticsearch.go @@ -6,8 +6,8 @@ import ( "net/http" "time" - "github.com/influxdb/telegraf/internal" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/internal" + "github.com/influxdata/telegraf/plugins/inputs" ) const statsPath = "/_nodes/stats" diff --git a/plugins/inputs/elasticsearch/elasticsearch_test.go b/plugins/inputs/elasticsearch/elasticsearch_test.go index 62c3cb8fd..f94d3f9ac 100644 --- a/plugins/inputs/elasticsearch/elasticsearch_test.go +++ b/plugins/inputs/elasticsearch/elasticsearch_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/exec/exec.go b/plugins/inputs/exec/exec.go index b3c1001f8..603ba1464 100644 --- a/plugins/inputs/exec/exec.go +++ b/plugins/inputs/exec/exec.go @@ -8,8 +8,8 @@ import ( "github.com/gonuts/go-shellquote" - "github.com/influxdb/telegraf/internal" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/internal" + "github.com/influxdata/telegraf/plugins/inputs" ) const sampleConfig = ` diff --git a/plugins/inputs/exec/exec_test.go b/plugins/inputs/exec/exec_test.go index 64fd69fce..8bf47c1d0 100644 --- a/plugins/inputs/exec/exec_test.go +++ b/plugins/inputs/exec/exec_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/ghwebhooks/ghwebhooks.go b/plugins/inputs/ghwebhooks/ghwebhooks.go index 57976c4f7..9ba06d76a 100644 --- a/plugins/inputs/ghwebhooks/ghwebhooks.go +++ b/plugins/inputs/ghwebhooks/ghwebhooks.go @@ -5,7 +5,6 @@ import ( "fmt" "io/ioutil" "net/http" - "os" "sync" "time" @@ -16,17 +15,6 @@ import ( ) func init() { - log.Info("Starting ghWebhook server...") - logFile, err := os.Create("server.log") - if err != nil { - log.WithFields(log.Fields{ - "time": time.Now(), - "error": err, - }).Warn("Error in creating log file") - } - log.SetLevel(log.InfoLevel) - log.SetOutput(logFile) - inputs.Add("ghwebhooks", func() inputs.Input { return &GHWebhooks{} }) } @@ -71,18 +59,26 @@ func (gh *GHWebhooks) Gather(acc inputs.Accumulator) error { } func (gh *GHWebhooks) listen() error { + fmt.Println("in listen!") r := mux.NewRouter() - r.HandleFunc("/webhooks", gh.webhookHandler).Methods("POST") - http.ListenAndServe(fmt.Sprintf(":%s", gh.ServiceAddress), r) + r.HandleFunc("/", gh.webhookHandler).Methods("POST") + err := http.ListenAndServe(fmt.Sprintf(":%s", gh.ServiceAddress), r) + if err != nil { + return err + } + fmt.Println("Exiting listen") + return nil } func (gh *GHWebhooks) Start() error { + fmt.Println("In start function") gh.done = make(chan struct{}) gh.in = make(chan mod.Event) // Start the UDP listener go gh.listen() // Start the line parser - log.Printf("Started the ghwebhooks service on %s\n", s.ServiceAddress) + log.Printf("Started the ghwebhooks service on %s\n", gh.ServiceAddress) + return nil } func (gh *GHWebhooks) Stop() { @@ -95,8 +91,7 @@ func (gh *GHWebhooks) Stop() { // Handles the /webhooks route func (gh *GHWebhooks) webhookHandler(w http.ResponseWriter, r *http.Request) { - gh.Lock() - defer gh.Unlock() + fmt.Println("In webhook handler") eventType := r.Header["X-Github-Event"][0] data, err := ioutil.ReadAll(r.Body) if err != nil { diff --git a/plugins/inputs/ghwebhooks/models.go b/plugins/inputs/ghwebhooks/models/models.go similarity index 100% rename from plugins/inputs/ghwebhooks/models.go rename to plugins/inputs/ghwebhooks/models/models.go diff --git a/plugins/inputs/haproxy/haproxy.go b/plugins/inputs/haproxy/haproxy.go index 23b92fc26..c2e334424 100644 --- a/plugins/inputs/haproxy/haproxy.go +++ b/plugins/inputs/haproxy/haproxy.go @@ -3,7 +3,7 @@ package haproxy import ( "encoding/csv" "fmt" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" "io" "net/http" "net/url" diff --git a/plugins/inputs/haproxy/haproxy_test.go b/plugins/inputs/haproxy/haproxy_test.go index e514bc7ad..7b86f2b50 100644 --- a/plugins/inputs/haproxy/haproxy_test.go +++ b/plugins/inputs/haproxy/haproxy_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "net/http" diff --git a/plugins/inputs/httpjson/httpjson.go b/plugins/inputs/httpjson/httpjson.go index 5763fd6fa..b90a02e5b 100644 --- a/plugins/inputs/httpjson/httpjson.go +++ b/plugins/inputs/httpjson/httpjson.go @@ -11,8 +11,8 @@ import ( "sync" "time" - "github.com/influxdb/telegraf/internal" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/internal" + "github.com/influxdata/telegraf/plugins/inputs" ) type HttpJson struct { diff --git a/plugins/inputs/httpjson/httpjson_test.go b/plugins/inputs/httpjson/httpjson_test.go index 3f14290ff..0ea5e9e42 100644 --- a/plugins/inputs/httpjson/httpjson_test.go +++ b/plugins/inputs/httpjson/httpjson_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/influxdb/influxdb.go b/plugins/inputs/influxdb/influxdb.go index cf5742e1d..e65c8afd2 100644 --- a/plugins/inputs/influxdb/influxdb.go +++ b/plugins/inputs/influxdb/influxdb.go @@ -8,7 +8,7 @@ import ( "strings" "sync" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type InfluxDB struct { diff --git a/plugins/inputs/influxdb/influxdb_test.go b/plugins/inputs/influxdb/influxdb_test.go index 0e02cc6bd..e7b43e7bc 100644 --- a/plugins/inputs/influxdb/influxdb_test.go +++ b/plugins/inputs/influxdb/influxdb_test.go @@ -5,8 +5,8 @@ import ( "net/http/httptest" "testing" - "github.com/influxdb/telegraf/plugins/inputs/influxdb" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/plugins/inputs/influxdb" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/jolokia/jolokia.go b/plugins/inputs/jolokia/jolokia.go index 36811bd27..7579ecb4a 100644 --- a/plugins/inputs/jolokia/jolokia.go +++ b/plugins/inputs/jolokia/jolokia.go @@ -8,7 +8,7 @@ import ( "net/http" "net/url" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type Server struct { diff --git a/plugins/inputs/jolokia/jolokia_test.go b/plugins/inputs/jolokia/jolokia_test.go index d29b8a810..63b47ebff 100644 --- a/plugins/inputs/jolokia/jolokia_test.go +++ b/plugins/inputs/jolokia/jolokia_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" _ "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/kafka_consumer/kafka_consumer.go b/plugins/inputs/kafka_consumer/kafka_consumer.go index f3558e2e5..a0f1d3d11 100644 --- a/plugins/inputs/kafka_consumer/kafka_consumer.go +++ b/plugins/inputs/kafka_consumer/kafka_consumer.go @@ -5,8 +5,8 @@ import ( "strings" "sync" - "github.com/influxdb/influxdb/models" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/influxdb/models" + "github.com/influxdata/telegraf/plugins/inputs" "github.com/Shopify/sarama" "github.com/wvanbergen/kafka/consumergroup" diff --git a/plugins/inputs/kafka_consumer/kafka_consumer_integration_test.go b/plugins/inputs/kafka_consumer/kafka_consumer_integration_test.go index 9f554d9ab..0611467ff 100644 --- a/plugins/inputs/kafka_consumer/kafka_consumer_integration_test.go +++ b/plugins/inputs/kafka_consumer/kafka_consumer_integration_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/Shopify/sarama" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/kafka_consumer/kafka_consumer_test.go b/plugins/inputs/kafka_consumer/kafka_consumer_test.go index dcd38f6c4..560e130c0 100644 --- a/plugins/inputs/kafka_consumer/kafka_consumer_test.go +++ b/plugins/inputs/kafka_consumer/kafka_consumer_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/influxdb/influxdb/models" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/influxdb/models" + "github.com/influxdata/telegraf/testutil" "github.com/Shopify/sarama" "github.com/stretchr/testify/assert" diff --git a/plugins/inputs/leofs/leofs.go b/plugins/inputs/leofs/leofs.go index c65db5f37..f4dd314b7 100644 --- a/plugins/inputs/leofs/leofs.go +++ b/plugins/inputs/leofs/leofs.go @@ -3,7 +3,7 @@ package leofs import ( "bufio" "fmt" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" "net/url" "os/exec" "strconv" diff --git a/plugins/inputs/leofs/leofs_test.go b/plugins/inputs/leofs/leofs_test.go index 48a82a18a..292cd15d0 100644 --- a/plugins/inputs/leofs/leofs_test.go +++ b/plugins/inputs/leofs/leofs_test.go @@ -1,7 +1,7 @@ package leofs import ( - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "io/ioutil" diff --git a/plugins/inputs/lustre2/lustre2.go b/plugins/inputs/lustre2/lustre2.go index 90222af79..d6266de73 100644 --- a/plugins/inputs/lustre2/lustre2.go +++ b/plugins/inputs/lustre2/lustre2.go @@ -13,8 +13,8 @@ import ( "strconv" "strings" - "github.com/influxdb/telegraf/internal" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/internal" + "github.com/influxdata/telegraf/plugins/inputs" ) // Lustre proc files can change between versions, so we want to future-proof diff --git a/plugins/inputs/lustre2/lustre2_test.go b/plugins/inputs/lustre2/lustre2_test.go index cea98fa1e..9e560df2c 100644 --- a/plugins/inputs/lustre2/lustre2_test.go +++ b/plugins/inputs/lustre2/lustre2_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/mailchimp/mailchimp.go b/plugins/inputs/mailchimp/mailchimp.go index 4b148a95c..284ac61e1 100644 --- a/plugins/inputs/mailchimp/mailchimp.go +++ b/plugins/inputs/mailchimp/mailchimp.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type MailChimp struct { diff --git a/plugins/inputs/mailchimp/mailchimp_test.go b/plugins/inputs/mailchimp/mailchimp_test.go index 5e5394581..0c4dab56d 100644 --- a/plugins/inputs/mailchimp/mailchimp_test.go +++ b/plugins/inputs/mailchimp/mailchimp_test.go @@ -7,7 +7,7 @@ import ( "net/url" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/memcached/memcached.go b/plugins/inputs/memcached/memcached.go index 1d9ee9547..078f05aa3 100644 --- a/plugins/inputs/memcached/memcached.go +++ b/plugins/inputs/memcached/memcached.go @@ -8,7 +8,7 @@ import ( "strconv" "time" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) // Memcached is a memcached plugin diff --git a/plugins/inputs/memcached/memcached_test.go b/plugins/inputs/memcached/memcached_test.go index 6e2f8452a..210adffdb 100644 --- a/plugins/inputs/memcached/memcached_test.go +++ b/plugins/inputs/memcached/memcached_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/mongodb/mongodb.go b/plugins/inputs/mongodb/mongodb.go index 4cb3ffee5..ce73c3a14 100644 --- a/plugins/inputs/mongodb/mongodb.go +++ b/plugins/inputs/mongodb/mongodb.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" "gopkg.in/mgo.v2" ) diff --git a/plugins/inputs/mongodb/mongodb_data.go b/plugins/inputs/mongodb/mongodb_data.go index 15f8c479b..c0c68c330 100644 --- a/plugins/inputs/mongodb/mongodb_data.go +++ b/plugins/inputs/mongodb/mongodb_data.go @@ -5,7 +5,7 @@ import ( "reflect" "strconv" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type MongodbData struct { diff --git a/plugins/inputs/mongodb/mongodb_data_test.go b/plugins/inputs/mongodb/mongodb_data_test.go index 5d24a7a09..3166ab018 100644 --- a/plugins/inputs/mongodb/mongodb_data_test.go +++ b/plugins/inputs/mongodb/mongodb_data_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" ) diff --git a/plugins/inputs/mongodb/mongodb_server.go b/plugins/inputs/mongodb/mongodb_server.go index 795cf97d7..87552f906 100644 --- a/plugins/inputs/mongodb/mongodb_server.go +++ b/plugins/inputs/mongodb/mongodb_server.go @@ -4,7 +4,7 @@ import ( "net/url" "time" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" ) diff --git a/plugins/inputs/mongodb/mongodb_server_test.go b/plugins/inputs/mongodb/mongodb_server_test.go index ec536bbef..52869724c 100644 --- a/plugins/inputs/mongodb/mongodb_server_test.go +++ b/plugins/inputs/mongodb/mongodb_server_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/mysql/mysql.go b/plugins/inputs/mysql/mysql.go index f9126b5ea..7434a282a 100644 --- a/plugins/inputs/mysql/mysql.go +++ b/plugins/inputs/mysql/mysql.go @@ -6,7 +6,7 @@ import ( "strings" _ "github.com/go-sql-driver/mysql" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type Mysql struct { diff --git a/plugins/inputs/mysql/mysql_test.go b/plugins/inputs/mysql/mysql_test.go index 2362002bc..855e8ba52 100644 --- a/plugins/inputs/mysql/mysql_test.go +++ b/plugins/inputs/mysql/mysql_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/nginx/nginx.go b/plugins/inputs/nginx/nginx.go index 18e3244f7..6ea665b7e 100644 --- a/plugins/inputs/nginx/nginx.go +++ b/plugins/inputs/nginx/nginx.go @@ -11,7 +11,7 @@ import ( "sync" "time" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type Nginx struct { diff --git a/plugins/inputs/nginx/nginx_test.go b/plugins/inputs/nginx/nginx_test.go index 9d694bc26..895e3e583 100644 --- a/plugins/inputs/nginx/nginx_test.go +++ b/plugins/inputs/nginx/nginx_test.go @@ -8,7 +8,7 @@ import ( "net/url" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/nsq/nsq.go b/plugins/inputs/nsq/nsq.go index 48a709a37..9b680a0db 100644 --- a/plugins/inputs/nsq/nsq.go +++ b/plugins/inputs/nsq/nsq.go @@ -31,7 +31,7 @@ import ( "sync" "time" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) // Might add Lookupd endpoints for cluster discovery diff --git a/plugins/inputs/nsq/nsq_test.go b/plugins/inputs/nsq/nsq_test.go index fc34a710b..23fd19a42 100644 --- a/plugins/inputs/nsq/nsq_test.go +++ b/plugins/inputs/nsq/nsq_test.go @@ -7,7 +7,7 @@ import ( "net/url" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/passenger/passenger.go b/plugins/inputs/passenger/passenger.go index 2d98f8c58..c5b049b7c 100644 --- a/plugins/inputs/passenger/passenger.go +++ b/plugins/inputs/passenger/passenger.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" "golang.org/x/net/html/charset" ) diff --git a/plugins/inputs/passenger/passenger_test.go b/plugins/inputs/passenger/passenger_test.go index 3440c5337..6124a968e 100644 --- a/plugins/inputs/passenger/passenger_test.go +++ b/plugins/inputs/passenger/passenger_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/phpfpm/phpfpm.go b/plugins/inputs/phpfpm/phpfpm.go index 5600334b2..0166f7bea 100644 --- a/plugins/inputs/phpfpm/phpfpm.go +++ b/plugins/inputs/phpfpm/phpfpm.go @@ -12,7 +12,7 @@ import ( "strings" "sync" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) const ( diff --git a/plugins/inputs/phpfpm/phpfpm_test.go b/plugins/inputs/phpfpm/phpfpm_test.go index 58db0cf8b..c965e5a13 100644 --- a/plugins/inputs/phpfpm/phpfpm_test.go +++ b/plugins/inputs/phpfpm/phpfpm_test.go @@ -10,7 +10,7 @@ import ( "net/http/httptest" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/ping/ping.go b/plugins/inputs/ping/ping.go index ff7cebb99..aa1d5bf36 100644 --- a/plugins/inputs/ping/ping.go +++ b/plugins/inputs/ping/ping.go @@ -7,7 +7,7 @@ import ( "strings" "sync" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) // HostPinger is a function that runs the "ping" function using a list of diff --git a/plugins/inputs/ping/ping_test.go b/plugins/inputs/ping/ping_test.go index b98a08be8..be603a49c 100644 --- a/plugins/inputs/ping/ping_test.go +++ b/plugins/inputs/ping/ping_test.go @@ -6,7 +6,7 @@ import ( "sort" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" ) diff --git a/plugins/inputs/postgresql/postgresql.go b/plugins/inputs/postgresql/postgresql.go index c356cea77..3398f5ac0 100644 --- a/plugins/inputs/postgresql/postgresql.go +++ b/plugins/inputs/postgresql/postgresql.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" _ "github.com/lib/pq" ) diff --git a/plugins/inputs/postgresql/postgresql_test.go b/plugins/inputs/postgresql/postgresql_test.go index 0f4ff5579..8baae39a6 100644 --- a/plugins/inputs/postgresql/postgresql_test.go +++ b/plugins/inputs/postgresql/postgresql_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/procstat/procstat.go b/plugins/inputs/procstat/procstat.go index 5e596d6d8..99d7573fc 100644 --- a/plugins/inputs/procstat/procstat.go +++ b/plugins/inputs/procstat/procstat.go @@ -10,7 +10,7 @@ import ( "github.com/shirou/gopsutil/process" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type Procstat struct { diff --git a/plugins/inputs/procstat/procstat_test.go b/plugins/inputs/procstat/procstat_test.go index 6ec6834ca..e5f081372 100644 --- a/plugins/inputs/procstat/procstat_test.go +++ b/plugins/inputs/procstat/procstat_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" ) func TestGather(t *testing.T) { diff --git a/plugins/inputs/procstat/spec_processor.go b/plugins/inputs/procstat/spec_processor.go index 9c7e53826..052c57a75 100644 --- a/plugins/inputs/procstat/spec_processor.go +++ b/plugins/inputs/procstat/spec_processor.go @@ -6,7 +6,7 @@ import ( "github.com/shirou/gopsutil/process" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type SpecProcessor struct { diff --git a/plugins/inputs/prometheus/prometheus.go b/plugins/inputs/prometheus/prometheus.go index 758788b8d..e6374b8d6 100644 --- a/plugins/inputs/prometheus/prometheus.go +++ b/plugins/inputs/prometheus/prometheus.go @@ -3,7 +3,7 @@ package prometheus import ( "errors" "fmt" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" "github.com/prometheus/common/expfmt" "github.com/prometheus/common/model" "io" diff --git a/plugins/inputs/prometheus/prometheus_test.go b/plugins/inputs/prometheus/prometheus_test.go index 901fe2da2..2009cbb11 100644 --- a/plugins/inputs/prometheus/prometheus_test.go +++ b/plugins/inputs/prometheus/prometheus_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/puppetagent/puppetagent.go b/plugins/inputs/puppetagent/puppetagent.go index d0bedae9e..eee9186b3 100644 --- a/plugins/inputs/puppetagent/puppetagent.go +++ b/plugins/inputs/puppetagent/puppetagent.go @@ -8,7 +8,7 @@ import ( "reflect" "strings" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) // PuppetAgent is a PuppetAgent plugin diff --git a/plugins/inputs/puppetagent/puppetagent_test.go b/plugins/inputs/puppetagent/puppetagent_test.go index 1d854ab46..d1470bc27 100644 --- a/plugins/inputs/puppetagent/puppetagent_test.go +++ b/plugins/inputs/puppetagent/puppetagent_test.go @@ -1,7 +1,7 @@ package puppetagent import ( - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "testing" ) diff --git a/plugins/inputs/rabbitmq/rabbitmq.go b/plugins/inputs/rabbitmq/rabbitmq.go index fc95af494..c062b3164 100644 --- a/plugins/inputs/rabbitmq/rabbitmq.go +++ b/plugins/inputs/rabbitmq/rabbitmq.go @@ -7,7 +7,7 @@ import ( "strconv" "time" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) const DefaultUsername = "guest" diff --git a/plugins/inputs/rabbitmq/rabbitmq_test.go b/plugins/inputs/rabbitmq/rabbitmq_test.go index 12b7aee70..4bdc980db 100644 --- a/plugins/inputs/rabbitmq/rabbitmq_test.go +++ b/plugins/inputs/rabbitmq/rabbitmq_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/redis/redis.go b/plugins/inputs/redis/redis.go index c9e98e886..735aa2052 100644 --- a/plugins/inputs/redis/redis.go +++ b/plugins/inputs/redis/redis.go @@ -10,7 +10,7 @@ import ( "strings" "sync" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type Redis struct { diff --git a/plugins/inputs/redis/redis_test.go b/plugins/inputs/redis/redis_test.go index ec0cf998c..612595cdb 100644 --- a/plugins/inputs/redis/redis_test.go +++ b/plugins/inputs/redis/redis_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/rethinkdb/rethinkdb.go b/plugins/inputs/rethinkdb/rethinkdb.go index 17873f1ce..1f28dab25 100644 --- a/plugins/inputs/rethinkdb/rethinkdb.go +++ b/plugins/inputs/rethinkdb/rethinkdb.go @@ -5,7 +5,7 @@ import ( "net/url" "sync" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" "gopkg.in/dancannon/gorethink.v1" ) diff --git a/plugins/inputs/rethinkdb/rethinkdb_data.go b/plugins/inputs/rethinkdb/rethinkdb_data.go index 3ea429d82..8093fa5ba 100644 --- a/plugins/inputs/rethinkdb/rethinkdb_data.go +++ b/plugins/inputs/rethinkdb/rethinkdb_data.go @@ -4,7 +4,7 @@ import ( "reflect" "time" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type serverStatus struct { diff --git a/plugins/inputs/rethinkdb/rethinkdb_data_test.go b/plugins/inputs/rethinkdb/rethinkdb_data_test.go index 3441370a3..6159016c0 100644 --- a/plugins/inputs/rethinkdb/rethinkdb_data_test.go +++ b/plugins/inputs/rethinkdb/rethinkdb_data_test.go @@ -3,7 +3,7 @@ package rethinkdb import ( "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" ) diff --git a/plugins/inputs/rethinkdb/rethinkdb_server.go b/plugins/inputs/rethinkdb/rethinkdb_server.go index 4af916a4d..6ca7a3af1 100644 --- a/plugins/inputs/rethinkdb/rethinkdb_server.go +++ b/plugins/inputs/rethinkdb/rethinkdb_server.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" "gopkg.in/dancannon/gorethink.v1" ) diff --git a/plugins/inputs/rethinkdb/rethinkdb_server_test.go b/plugins/inputs/rethinkdb/rethinkdb_server_test.go index 21ab0dbbd..c4b644222 100644 --- a/plugins/inputs/rethinkdb/rethinkdb_server_test.go +++ b/plugins/inputs/rethinkdb/rethinkdb_server_test.go @@ -5,7 +5,7 @@ package rethinkdb import ( "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/sensors/sensors.go b/plugins/inputs/sensors/sensors.go index 18e26278d..81001abd8 100644 --- a/plugins/inputs/sensors/sensors.go +++ b/plugins/inputs/sensors/sensors.go @@ -7,7 +7,7 @@ import ( "github.com/md14454/gosensors" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type Sensors struct { diff --git a/plugins/inputs/statsd/README.md b/plugins/inputs/statsd/README.md index 76255f3b0..49b8ff842 100644 --- a/plugins/inputs/statsd/README.md +++ b/plugins/inputs/statsd/README.md @@ -157,4 +157,4 @@ mem.cached.localhost:256|g ``` There are many more options available, -[More details can be found here](https://github.com/influxdb/influxdb/tree/master/services/graphite#templates) +[More details can be found here](https://github.com/influxdata/influxdb/tree/master/services/graphite#templates) diff --git a/plugins/inputs/statsd/statsd.go b/plugins/inputs/statsd/statsd.go index d9f597bcf..1fac4aba0 100644 --- a/plugins/inputs/statsd/statsd.go +++ b/plugins/inputs/statsd/statsd.go @@ -10,9 +10,9 @@ import ( "strings" "sync" - "github.com/influxdb/influxdb/services/graphite" + "github.com/influxdata/influxdb/services/graphite" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) const UDP_PACKET_SIZE int = 1500 diff --git a/plugins/inputs/statsd/statsd_test.go b/plugins/inputs/statsd/statsd_test.go index a8aae2e9e..6fc1f6933 100644 --- a/plugins/inputs/statsd/statsd_test.go +++ b/plugins/inputs/statsd/statsd_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" ) // Invalid lines should return an error diff --git a/plugins/inputs/system/cpu.go b/plugins/inputs/system/cpu.go index 298df20bb..95c854b2c 100644 --- a/plugins/inputs/system/cpu.go +++ b/plugins/inputs/system/cpu.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" "github.com/shirou/gopsutil/cpu" ) diff --git a/plugins/inputs/system/cpu_test.go b/plugins/inputs/system/cpu_test.go index c85734adc..77d90e2a5 100644 --- a/plugins/inputs/system/cpu_test.go +++ b/plugins/inputs/system/cpu_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/shirou/gopsutil/cpu" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/plugins/inputs/system/disk.go b/plugins/inputs/system/disk.go index 5d1553dd4..6a792e7dd 100644 --- a/plugins/inputs/system/disk.go +++ b/plugins/inputs/system/disk.go @@ -3,7 +3,7 @@ package system import ( "fmt" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type DiskStats struct { diff --git a/plugins/inputs/system/disk_test.go b/plugins/inputs/system/disk_test.go index 6ea110fef..f59c0b7d6 100644 --- a/plugins/inputs/system/disk_test.go +++ b/plugins/inputs/system/disk_test.go @@ -3,7 +3,7 @@ package system import ( "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/shirou/gopsutil/disk" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/plugins/inputs/system/docker.go b/plugins/inputs/system/docker.go index 3a77fad5f..4f60c771e 100644 --- a/plugins/inputs/system/docker.go +++ b/plugins/inputs/system/docker.go @@ -5,7 +5,7 @@ package system import ( "fmt" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type DockerStats struct { diff --git a/plugins/inputs/system/docker_test.go b/plugins/inputs/system/docker_test.go index 9ed06dd3e..6f680d8be 100644 --- a/plugins/inputs/system/docker_test.go +++ b/plugins/inputs/system/docker_test.go @@ -5,7 +5,7 @@ package system import ( "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/shirou/gopsutil/cpu" "github.com/shirou/gopsutil/docker" diff --git a/plugins/inputs/system/memory.go b/plugins/inputs/system/memory.go index f58a8cd92..32a2f2b09 100644 --- a/plugins/inputs/system/memory.go +++ b/plugins/inputs/system/memory.go @@ -3,7 +3,7 @@ package system import ( "fmt" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type MemStats struct { diff --git a/plugins/inputs/system/memory_test.go b/plugins/inputs/system/memory_test.go index bf461e2e2..0a85bc869 100644 --- a/plugins/inputs/system/memory_test.go +++ b/plugins/inputs/system/memory_test.go @@ -3,7 +3,7 @@ package system import ( "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/shirou/gopsutil/mem" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/system/net.go b/plugins/inputs/system/net.go index 42f0d5854..7f71f5200 100644 --- a/plugins/inputs/system/net.go +++ b/plugins/inputs/system/net.go @@ -5,7 +5,7 @@ import ( "net" "strings" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type NetIOStats struct { diff --git a/plugins/inputs/system/net_test.go b/plugins/inputs/system/net_test.go index 3ec2cb990..3297acf07 100644 --- a/plugins/inputs/system/net_test.go +++ b/plugins/inputs/system/net_test.go @@ -4,7 +4,7 @@ import ( "syscall" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/shirou/gopsutil/net" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/system/netstat.go b/plugins/inputs/system/netstat.go index 71f2a0da6..0fe704ee0 100644 --- a/plugins/inputs/system/netstat.go +++ b/plugins/inputs/system/netstat.go @@ -4,7 +4,7 @@ import ( "fmt" "syscall" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type NetStats struct { diff --git a/plugins/inputs/system/ps.go b/plugins/inputs/system/ps.go index 966747718..0bdb7eb94 100644 --- a/plugins/inputs/system/ps.go +++ b/plugins/inputs/system/ps.go @@ -5,8 +5,8 @@ import ( "os" "strings" - "github.com/influxdb/telegraf/internal" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/internal" + "github.com/influxdata/telegraf/plugins/inputs" dc "github.com/fsouza/go-dockerclient" "github.com/shirou/gopsutil/cpu" diff --git a/plugins/inputs/system/system.go b/plugins/inputs/system/system.go index 813ab84f5..4a0a76d48 100644 --- a/plugins/inputs/system/system.go +++ b/plugins/inputs/system/system.go @@ -8,7 +8,7 @@ import ( "github.com/shirou/gopsutil/host" "github.com/shirou/gopsutil/load" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type SystemStats struct{} diff --git a/plugins/inputs/trig/trig.go b/plugins/inputs/trig/trig.go index 13c44e247..604f9734a 100644 --- a/plugins/inputs/trig/trig.go +++ b/plugins/inputs/trig/trig.go @@ -3,7 +3,7 @@ package trig import ( "math" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type Trig struct { diff --git a/plugins/inputs/trig/trig_test.go b/plugins/inputs/trig/trig_test.go index 82605b0a5..1471edbea 100644 --- a/plugins/inputs/trig/trig_test.go +++ b/plugins/inputs/trig/trig_test.go @@ -4,7 +4,7 @@ import ( "math" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" ) func TestTrig(t *testing.T) { diff --git a/plugins/inputs/twemproxy/twemproxy.go b/plugins/inputs/twemproxy/twemproxy.go index 95c9d0ba0..6dcce8058 100644 --- a/plugins/inputs/twemproxy/twemproxy.go +++ b/plugins/inputs/twemproxy/twemproxy.go @@ -7,7 +7,7 @@ import ( "net" "time" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) type Twemproxy struct { diff --git a/plugins/inputs/twemproxy/twemproxy_test.go b/plugins/inputs/twemproxy/twemproxy_test.go index 60209d1a1..dd79048e0 100644 --- a/plugins/inputs/twemproxy/twemproxy_test.go +++ b/plugins/inputs/twemproxy/twemproxy_test.go @@ -5,7 +5,7 @@ import ( "net" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/zfs/zfs.go b/plugins/inputs/zfs/zfs.go index 109b261f8..13f2d9806 100644 --- a/plugins/inputs/zfs/zfs.go +++ b/plugins/inputs/zfs/zfs.go @@ -6,8 +6,8 @@ import ( "strconv" "strings" - "github.com/influxdb/telegraf/internal" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/internal" + "github.com/influxdata/telegraf/plugins/inputs" ) type Zfs struct { diff --git a/plugins/inputs/zfs/zfs_test.go b/plugins/inputs/zfs/zfs_test.go index 9530084d0..e40d91c02 100644 --- a/plugins/inputs/zfs/zfs_test.go +++ b/plugins/inputs/zfs/zfs_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/zookeeper/zookeeper.go b/plugins/inputs/zookeeper/zookeeper.go index 93a07840d..c2940f5e3 100644 --- a/plugins/inputs/zookeeper/zookeeper.go +++ b/plugins/inputs/zookeeper/zookeeper.go @@ -10,7 +10,7 @@ import ( "strings" "time" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" ) // Zookeeper is a zookeeper plugin diff --git a/plugins/inputs/zookeeper/zookeeper_test.go b/plugins/inputs/zookeeper/zookeeper_test.go index 354382ecc..bc02ffb9d 100644 --- a/plugins/inputs/zookeeper/zookeeper_test.go +++ b/plugins/inputs/zookeeper/zookeeper_test.go @@ -3,7 +3,7 @@ package zookeeper import ( "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/outputs/all/all.go b/plugins/outputs/all/all.go index 7eedb592a..e05d53acc 100644 --- a/plugins/outputs/all/all.go +++ b/plugins/outputs/all/all.go @@ -1,17 +1,17 @@ package all import ( - _ "github.com/influxdb/telegraf/plugins/outputs/amon" - _ "github.com/influxdb/telegraf/plugins/outputs/amqp" - _ "github.com/influxdb/telegraf/plugins/outputs/datadog" - _ "github.com/influxdb/telegraf/plugins/outputs/graphite" - _ "github.com/influxdb/telegraf/plugins/outputs/influxdb" - _ "github.com/influxdb/telegraf/plugins/outputs/kafka" - _ "github.com/influxdb/telegraf/plugins/outputs/kinesis" - _ "github.com/influxdb/telegraf/plugins/outputs/librato" - _ "github.com/influxdb/telegraf/plugins/outputs/mqtt" - _ "github.com/influxdb/telegraf/plugins/outputs/nsq" - _ "github.com/influxdb/telegraf/plugins/outputs/opentsdb" - _ "github.com/influxdb/telegraf/plugins/outputs/prometheus_client" - _ "github.com/influxdb/telegraf/plugins/outputs/riemann" + _ "github.com/influxdata/telegraf/plugins/outputs/amon" + _ "github.com/influxdata/telegraf/plugins/outputs/amqp" + _ "github.com/influxdata/telegraf/plugins/outputs/datadog" + _ "github.com/influxdata/telegraf/plugins/outputs/graphite" + _ "github.com/influxdata/telegraf/plugins/outputs/influxdb" + _ "github.com/influxdata/telegraf/plugins/outputs/kafka" + _ "github.com/influxdata/telegraf/plugins/outputs/kinesis" + _ "github.com/influxdata/telegraf/plugins/outputs/librato" + _ "github.com/influxdata/telegraf/plugins/outputs/mqtt" + _ "github.com/influxdata/telegraf/plugins/outputs/nsq" + _ "github.com/influxdata/telegraf/plugins/outputs/opentsdb" + _ "github.com/influxdata/telegraf/plugins/outputs/prometheus_client" + _ "github.com/influxdata/telegraf/plugins/outputs/riemann" ) diff --git a/plugins/outputs/amon/amon.go b/plugins/outputs/amon/amon.go index d8fceb035..e9f2c9f30 100644 --- a/plugins/outputs/amon/amon.go +++ b/plugins/outputs/amon/amon.go @@ -8,9 +8,9 @@ import ( "net/http" "strings" - "github.com/influxdb/influxdb/client/v2" - "github.com/influxdb/telegraf/internal" - "github.com/influxdb/telegraf/plugins/outputs" + "github.com/influxdata/influxdb/client/v2" + "github.com/influxdata/telegraf/internal" + "github.com/influxdata/telegraf/plugins/outputs" ) type Amon struct { diff --git a/plugins/outputs/amon/amon_test.go b/plugins/outputs/amon/amon_test.go index cfe4e9f23..b725bab9e 100644 --- a/plugins/outputs/amon/amon_test.go +++ b/plugins/outputs/amon/amon_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" - "github.com/influxdb/influxdb/client/v2" + "github.com/influxdata/influxdb/client/v2" ) func TestBuildPoint(t *testing.T) { diff --git a/plugins/outputs/amqp/amqp.go b/plugins/outputs/amqp/amqp.go index e1d6302a1..bdbf47b86 100644 --- a/plugins/outputs/amqp/amqp.go +++ b/plugins/outputs/amqp/amqp.go @@ -10,8 +10,8 @@ import ( "sync" "time" - "github.com/influxdb/influxdb/client/v2" - "github.com/influxdb/telegraf/plugins/outputs" + "github.com/influxdata/influxdb/client/v2" + "github.com/influxdata/telegraf/plugins/outputs" "github.com/streadway/amqp" ) diff --git a/plugins/outputs/amqp/amqp_test.go b/plugins/outputs/amqp/amqp_test.go index 4c6a9a8d3..a65634cab 100644 --- a/plugins/outputs/amqp/amqp_test.go +++ b/plugins/outputs/amqp/amqp_test.go @@ -3,7 +3,7 @@ package amqp import ( "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/outputs/datadog/datadog.go b/plugins/outputs/datadog/datadog.go index 4231b1f28..7d6539789 100644 --- a/plugins/outputs/datadog/datadog.go +++ b/plugins/outputs/datadog/datadog.go @@ -10,9 +10,9 @@ import ( "sort" "strings" - "github.com/influxdb/influxdb/client/v2" - "github.com/influxdb/telegraf/internal" - "github.com/influxdb/telegraf/plugins/outputs" + "github.com/influxdata/influxdb/client/v2" + "github.com/influxdata/telegraf/internal" + "github.com/influxdata/telegraf/plugins/outputs" ) type Datadog struct { diff --git a/plugins/outputs/datadog/datadog_test.go b/plugins/outputs/datadog/datadog_test.go index fe0b7c1fe..968a8e9c8 100644 --- a/plugins/outputs/datadog/datadog_test.go +++ b/plugins/outputs/datadog/datadog_test.go @@ -9,9 +9,9 @@ import ( "testing" "time" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" - "github.com/influxdb/influxdb/client/v2" + "github.com/influxdata/influxdb/client/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/outputs/graphite/graphite.go b/plugins/outputs/graphite/graphite.go index dd2af8eb1..f9781041f 100644 --- a/plugins/outputs/graphite/graphite.go +++ b/plugins/outputs/graphite/graphite.go @@ -3,8 +3,8 @@ package graphite import ( "errors" "fmt" - "github.com/influxdb/influxdb/client/v2" - "github.com/influxdb/telegraf/plugins/outputs" + "github.com/influxdata/influxdb/client/v2" + "github.com/influxdata/telegraf/plugins/outputs" "log" "math/rand" "net" diff --git a/plugins/outputs/graphite/graphite_test.go b/plugins/outputs/graphite/graphite_test.go index e9000c3c7..be4cc2472 100644 --- a/plugins/outputs/graphite/graphite_test.go +++ b/plugins/outputs/graphite/graphite_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/influxdb/influxdb/client/v2" + "github.com/influxdata/influxdb/client/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/plugins/outputs/influxdb/influxdb.go b/plugins/outputs/influxdb/influxdb.go index f6b79b009..f45f020b6 100644 --- a/plugins/outputs/influxdb/influxdb.go +++ b/plugins/outputs/influxdb/influxdb.go @@ -9,9 +9,9 @@ import ( "strings" "time" - "github.com/influxdb/influxdb/client/v2" - "github.com/influxdb/telegraf/internal" - "github.com/influxdb/telegraf/plugins/outputs" + "github.com/influxdata/influxdb/client/v2" + "github.com/influxdata/telegraf/internal" + "github.com/influxdata/telegraf/plugins/outputs" ) type InfluxDB struct { diff --git a/plugins/outputs/influxdb/influxdb_test.go b/plugins/outputs/influxdb/influxdb_test.go index cf1d7d9b3..5da0c056f 100644 --- a/plugins/outputs/influxdb/influxdb_test.go +++ b/plugins/outputs/influxdb/influxdb_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/outputs/kafka/kafka.go b/plugins/outputs/kafka/kafka.go index 55ef35fb4..b16347c92 100644 --- a/plugins/outputs/kafka/kafka.go +++ b/plugins/outputs/kafka/kafka.go @@ -6,8 +6,8 @@ import ( "errors" "fmt" "github.com/Shopify/sarama" - "github.com/influxdb/influxdb/client/v2" - "github.com/influxdb/telegraf/plugins/outputs" + "github.com/influxdata/influxdb/client/v2" + "github.com/influxdata/telegraf/plugins/outputs" "io/ioutil" ) diff --git a/plugins/outputs/kafka/kafka_test.go b/plugins/outputs/kafka/kafka_test.go index 2c1734857..2af343778 100644 --- a/plugins/outputs/kafka/kafka_test.go +++ b/plugins/outputs/kafka/kafka_test.go @@ -3,7 +3,7 @@ package kafka import ( "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/outputs/kinesis/kinesis.go b/plugins/outputs/kinesis/kinesis.go index 11e26fdf9..f04f1c7c6 100644 --- a/plugins/outputs/kinesis/kinesis.go +++ b/plugins/outputs/kinesis/kinesis.go @@ -15,8 +15,8 @@ import ( "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kinesis" - "github.com/influxdb/influxdb/client/v2" - "github.com/influxdb/telegraf/plugins/outputs" + "github.com/influxdata/influxdb/client/v2" + "github.com/influxdata/telegraf/plugins/outputs" ) type KinesisOutput struct { diff --git a/plugins/outputs/kinesis/kinesis_test.go b/plugins/outputs/kinesis/kinesis_test.go index 4c667c860..76eb6ebca 100644 --- a/plugins/outputs/kinesis/kinesis_test.go +++ b/plugins/outputs/kinesis/kinesis_test.go @@ -1,7 +1,7 @@ package kinesis import ( - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" "testing" ) diff --git a/plugins/outputs/librato/librato.go b/plugins/outputs/librato/librato.go index 75aecb756..6afcb4542 100644 --- a/plugins/outputs/librato/librato.go +++ b/plugins/outputs/librato/librato.go @@ -7,9 +7,9 @@ import ( "log" "net/http" - "github.com/influxdb/influxdb/client/v2" - "github.com/influxdb/telegraf/internal" - "github.com/influxdb/telegraf/plugins/outputs" + "github.com/influxdata/influxdb/client/v2" + "github.com/influxdata/telegraf/internal" + "github.com/influxdata/telegraf/plugins/outputs" ) type Librato struct { diff --git a/plugins/outputs/librato/librato_test.go b/plugins/outputs/librato/librato_test.go index 129352027..25418baa5 100644 --- a/plugins/outputs/librato/librato_test.go +++ b/plugins/outputs/librato/librato_test.go @@ -9,9 +9,9 @@ import ( "testing" "time" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" - "github.com/influxdb/influxdb/client/v2" + "github.com/influxdata/influxdb/client/v2" "github.com/stretchr/testify/require" ) diff --git a/plugins/outputs/mqtt/mqtt.go b/plugins/outputs/mqtt/mqtt.go index a70b2e575..7c47cf741 100644 --- a/plugins/outputs/mqtt/mqtt.go +++ b/plugins/outputs/mqtt/mqtt.go @@ -10,9 +10,9 @@ import ( "sync" paho "git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.golang.git" - "github.com/influxdb/influxdb/client/v2" - "github.com/influxdb/telegraf/internal" - "github.com/influxdb/telegraf/plugins/outputs" + "github.com/influxdata/influxdb/client/v2" + "github.com/influxdata/telegraf/internal" + "github.com/influxdata/telegraf/plugins/outputs" ) const MaxClientIdLen = 8 diff --git a/plugins/outputs/mqtt/mqtt_test.go b/plugins/outputs/mqtt/mqtt_test.go index 0922b83ed..f25f4497f 100644 --- a/plugins/outputs/mqtt/mqtt_test.go +++ b/plugins/outputs/mqtt/mqtt_test.go @@ -3,7 +3,7 @@ package mqtt import ( "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/outputs/nsq/nsq.go b/plugins/outputs/nsq/nsq.go index db58670a2..79818ec5c 100644 --- a/plugins/outputs/nsq/nsq.go +++ b/plugins/outputs/nsq/nsq.go @@ -2,8 +2,8 @@ package nsq import ( "fmt" - "github.com/influxdb/influxdb/client/v2" - "github.com/influxdb/telegraf/plugins/outputs" + "github.com/influxdata/influxdb/client/v2" + "github.com/influxdata/telegraf/plugins/outputs" "github.com/nsqio/go-nsq" ) diff --git a/plugins/outputs/nsq/nsq_test.go b/plugins/outputs/nsq/nsq_test.go index 4448383f4..b2d703a70 100644 --- a/plugins/outputs/nsq/nsq_test.go +++ b/plugins/outputs/nsq/nsq_test.go @@ -3,7 +3,7 @@ package nsq import ( "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/outputs/opentsdb/opentsdb.go b/plugins/outputs/opentsdb/opentsdb.go index 236385d71..6e9f3e26a 100644 --- a/plugins/outputs/opentsdb/opentsdb.go +++ b/plugins/outputs/opentsdb/opentsdb.go @@ -8,8 +8,8 @@ import ( "strings" "time" - "github.com/influxdb/influxdb/client/v2" - "github.com/influxdb/telegraf/plugins/outputs" + "github.com/influxdata/influxdb/client/v2" + "github.com/influxdata/telegraf/plugins/outputs" ) type OpenTSDB struct { diff --git a/plugins/outputs/opentsdb/opentsdb_test.go b/plugins/outputs/opentsdb/opentsdb_test.go index f75bd7205..92df3fb52 100644 --- a/plugins/outputs/opentsdb/opentsdb_test.go +++ b/plugins/outputs/opentsdb/opentsdb_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/outputs/prometheus_client/prometheus_client.go b/plugins/outputs/prometheus_client/prometheus_client.go index 1fbf9056a..4e429722a 100644 --- a/plugins/outputs/prometheus_client/prometheus_client.go +++ b/plugins/outputs/prometheus_client/prometheus_client.go @@ -5,8 +5,8 @@ import ( "log" "net/http" - "github.com/influxdb/influxdb/client/v2" - "github.com/influxdb/telegraf/plugins/outputs" + "github.com/influxdata/influxdb/client/v2" + "github.com/influxdata/telegraf/plugins/outputs" "github.com/prometheus/client_golang/prometheus" ) diff --git a/plugins/outputs/prometheus_client/prometheus_client_test.go b/plugins/outputs/prometheus_client/prometheus_client_test.go index dc353486c..73163ee1d 100644 --- a/plugins/outputs/prometheus_client/prometheus_client_test.go +++ b/plugins/outputs/prometheus_client/prometheus_client_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/influxdb/influxdb/client/v2" - "github.com/influxdb/telegraf/plugins/inputs/prometheus" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/influxdb/client/v2" + "github.com/influxdata/telegraf/plugins/inputs/prometheus" + "github.com/influxdata/telegraf/testutil" ) var pTesting *PrometheusClient diff --git a/plugins/outputs/registry.go b/plugins/outputs/registry.go index d7ea30492..d4c6ba1e5 100644 --- a/plugins/outputs/registry.go +++ b/plugins/outputs/registry.go @@ -1,7 +1,7 @@ package outputs import ( - "github.com/influxdb/influxdb/client/v2" + "github.com/influxdata/influxdb/client/v2" ) type Output interface { diff --git a/plugins/outputs/riemann/riemann.go b/plugins/outputs/riemann/riemann.go index afbde0051..c1b22ec46 100644 --- a/plugins/outputs/riemann/riemann.go +++ b/plugins/outputs/riemann/riemann.go @@ -6,8 +6,8 @@ import ( "os" "github.com/amir/raidman" - "github.com/influxdb/influxdb/client/v2" - "github.com/influxdb/telegraf/plugins/outputs" + "github.com/influxdata/influxdb/client/v2" + "github.com/influxdata/telegraf/plugins/outputs" ) type Riemann struct { diff --git a/plugins/outputs/riemann/riemann_test.go b/plugins/outputs/riemann/riemann_test.go index 31e9478b1..8b3f27ac0 100644 --- a/plugins/outputs/riemann/riemann_test.go +++ b/plugins/outputs/riemann/riemann_test.go @@ -3,7 +3,7 @@ package riemann import ( "testing" - "github.com/influxdb/telegraf/testutil" + "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/scripts/Vagrantfile b/scripts/Vagrantfile index 3c0199bdb..a04450d6d 100644 --- a/scripts/Vagrantfile +++ b/scripts/Vagrantfile @@ -7,7 +7,7 @@ VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "ubuntu/trusty64" - config.vm.synced_folder "..", "/home/vagrant/go/src/github.com/influxdb/telegraf", + config.vm.synced_folder "..", "/home/vagrant/go/src/github.com/influxdata/telegraf", type: "rsync", rsync__args: ["--verbose", "--archive", "--delete", "-z", "--safe-links"], rsync__exclude: ["./telegraf", ".vagrant/"] @@ -26,7 +26,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| gvm use go1.4.2 --default echo "export PATH=$PATH:$GOPATH/bin" >> "$HOME/.bashrc" echo 'export GOPATH=/home/vagrant/go' >> "$HOME/.bashrc" - cd "$HOME/go/src/github.com/influxdb/telegraf" &&\ + cd "$HOME/go/src/github.com/influxdata/telegraf" &&\ rm -rf Godeps/_workspace/pkg &&\ GOPATH="$HOME/go" make SHELL diff --git a/scripts/circle-test.sh b/scripts/circle-test.sh index 96319bf72..bbad51506 100755 --- a/scripts/circle-test.sh +++ b/scripts/circle-test.sh @@ -34,7 +34,7 @@ export GOPATH=$BUILD_DIR # Turning off GOGC speeds up build times export GOGC=off export PATH=$GOPATH/bin:$PATH -exit_if_fail mkdir -p $GOPATH/src/github.com/influxdb +exit_if_fail mkdir -p $GOPATH/src/github.com/influxdata # Dump some test config to the log. echo "Test configuration" @@ -44,8 +44,8 @@ echo "\$GOPATH: $GOPATH" echo "\$CIRCLE_BRANCH: $CIRCLE_BRANCH" # Move the checked-out source to a better location -exit_if_fail mv $HOME/telegraf $GOPATH/src/github.com/influxdb -exit_if_fail cd $GOPATH/src/github.com/influxdb/telegraf +exit_if_fail mv $HOME/telegraf $GOPATH/src/github.com/influxdata +exit_if_fail cd $GOPATH/src/github.com/influxdata/telegraf # Verify that go fmt has been run check_go_fmt diff --git a/scripts/telegraf.service b/scripts/telegraf.service index d92f3072c..6f4450402 100644 --- a/scripts/telegraf.service +++ b/scripts/telegraf.service @@ -1,6 +1,6 @@ [Unit] Description=The plugin-driven server agent for reporting metrics into InfluxDB -Documentation=https://github.com/influxdb/telegraf +Documentation=https://github.com/influxdata/telegraf After=network.target [Service] diff --git a/testutil/testutil.go b/testutil/testutil.go index 581220299..436b57361 100644 --- a/testutil/testutil.go +++ b/testutil/testutil.go @@ -6,7 +6,7 @@ import ( "os" "time" - "github.com/influxdb/influxdb/client/v2" + "github.com/influxdata/influxdb/client/v2" ) var localhost = "localhost" From 46b367e74b39c2f971b7ec24daab61a266572a7e Mon Sep 17 00:00:00 2001 From: Jack Zampolin Date: Fri, 22 Jan 2016 16:43:33 -0800 Subject: [PATCH 04/10] Add tests --- plugins/inputs/ghwebhooks/ghwebhooks.go | 232 +- plugins/inputs/ghwebhooks/ghwebhooks_test.go | 238 ++ plugins/inputs/ghwebhooks/models/mock_json.go | 3561 +++++++++++++++++ plugins/inputs/ghwebhooks/models/models.go | 131 +- 4 files changed, 3946 insertions(+), 216 deletions(-) create mode 100644 plugins/inputs/ghwebhooks/ghwebhooks_test.go create mode 100644 plugins/inputs/ghwebhooks/models/mock_json.go diff --git a/plugins/inputs/ghwebhooks/ghwebhooks.go b/plugins/inputs/ghwebhooks/ghwebhooks.go index 9ba06d76a..3ff3842ef 100644 --- a/plugins/inputs/ghwebhooks/ghwebhooks.go +++ b/plugins/inputs/ghwebhooks/ghwebhooks.go @@ -4,11 +4,10 @@ import ( "encoding/json" "fmt" "io/ioutil" + "log" "net/http" "sync" - "time" - log "github.com/Sirupsen/logrus" "github.com/gorilla/mux" mod "github.com/influxdata/support-tools/ghWebhooks/models" "github.com/influxdata/telegraf/plugins/inputs" @@ -21,12 +20,14 @@ func init() { type GHWebhooks struct { ServiceAddress string MeasurementName string - + // Lock for the struct sync.Mutex + // Events buffer to store events between Gather calls + events []mod.Event +} - // Channel for all incoming events from github - in chan mod.Event - done chan struct{} +func NewGHWebhooks() *GHWebhooks { + return &GHWebhooks{} } func (gh *GHWebhooks) SampleConfig() string { @@ -34,290 +35,261 @@ func (gh *GHWebhooks) SampleConfig() string { # Address and port to host Webhook listener on service_address = ":1618" # Measurement name - measurement_name = "ghWebhooks" + measurement_name = "ghwebhooks" ` } func (gh *GHWebhooks) Description() string { - return "Github Webhook Event collector" + return "A Github Webhook Event collector" } // Writes the points from <-gh.in to the Accumulator func (gh *GHWebhooks) Gather(acc inputs.Accumulator) error { gh.Lock() defer gh.Unlock() - for { - select { - case <-gh.done: - return nil - case e := <-gh.in: - p := e.NewPoint() - acc.Add(gh.MeasurementName, p.Fields(), p.Tags(), p.Time()) - } + for _, event := range gh.events { + p := event.NewPoint() + acc.AddFields(gh.MeasurementName, p.Fields(), p.Tags(), p.Time()) } + gh.events = make([]mod.Event, 0) return nil } -func (gh *GHWebhooks) listen() error { - fmt.Println("in listen!") +func (gh *GHWebhooks) Listen() { r := mux.NewRouter() - r.HandleFunc("/", gh.webhookHandler).Methods("POST") - err := http.ListenAndServe(fmt.Sprintf(":%s", gh.ServiceAddress), r) + r.HandleFunc("/", gh.eventHandler).Methods("POST") + err := http.ListenAndServe(fmt.Sprintf("%s", gh.ServiceAddress), r) if err != nil { - return err + log.Printf("Error starting server: %v", err) } - fmt.Println("Exiting listen") - return nil } func (gh *GHWebhooks) Start() error { - fmt.Println("In start function") - gh.done = make(chan struct{}) - gh.in = make(chan mod.Event) - // Start the UDP listener - go gh.listen() - // Start the line parser + go gh.Listen() log.Printf("Started the ghwebhooks service on %s\n", gh.ServiceAddress) return nil } func (gh *GHWebhooks) Stop() { - gh.Lock() - defer gh.Unlock() log.Println("Stopping the ghWebhooks service") - close(gh.done) - close(gh.in) } -// Handles the /webhooks route -func (gh *GHWebhooks) webhookHandler(w http.ResponseWriter, r *http.Request) { - fmt.Println("In webhook handler") +// Handles the / route +func (gh *GHWebhooks) eventHandler(w http.ResponseWriter, r *http.Request) { eventType := r.Header["X-Github-Event"][0] data, err := ioutil.ReadAll(r.Body) if err != nil { - fields := log.Fields{"time": time.Now(), "event": eventType, "error": err} - log.WithFields(fields).Fatal("Error reading Github payload") + w.WriteHeader(http.StatusBadRequest) } - - // Send event down chan to GHWebhooks - e := NewEvent(data, eventType) - gh.in <- e - fmt.Printf("%v\n", e.NewPoint()) + e, err := NewEvent(data, eventType) + if err != nil { + w.WriteHeader(http.StatusBadRequest) + } + gh.Lock() + gh.events = append(gh.events, e) + gh.Unlock() w.WriteHeader(http.StatusOK) } -func newCommitComment(data []byte) mod.Event { +func newCommitComment(data []byte) (mod.Event, error) { commitCommentStruct := mod.CommitCommentEvent{} err := json.Unmarshal(data, &commitCommentStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "CommitCommentEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return commitCommentStruct + return commitCommentStruct, nil } -func newCreate(data []byte) mod.Event { +func newCreate(data []byte) (mod.Event, error) { createStruct := mod.CreateEvent{} err := json.Unmarshal(data, &createStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "CreateEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return createStruct + return createStruct, nil } -func newDelete(data []byte) mod.Event { +func newDelete(data []byte) (mod.Event, error) { deleteStruct := mod.DeleteEvent{} err := json.Unmarshal(data, &deleteStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "DeleteEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return deleteStruct + return deleteStruct, nil } -func newDeployment(data []byte) mod.Event { +func newDeployment(data []byte) (mod.Event, error) { deploymentStruct := mod.DeploymentEvent{} err := json.Unmarshal(data, &deploymentStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "DeploymentEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return deploymentStruct + return deploymentStruct, nil } -func newDeploymentStatus(data []byte) mod.Event { +func newDeploymentStatus(data []byte) (mod.Event, error) { deploymentStatusStruct := mod.DeploymentStatusEvent{} err := json.Unmarshal(data, &deploymentStatusStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "DeploymentStatusEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return deploymentStatusStruct + return deploymentStatusStruct, nil } -func newFork(data []byte) mod.Event { +func newFork(data []byte) (mod.Event, error) { forkStruct := mod.ForkEvent{} err := json.Unmarshal(data, &forkStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "ForkEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return forkStruct + return forkStruct, nil } -func newGollum(data []byte) mod.Event { +func newGollum(data []byte) (mod.Event, error) { gollumStruct := mod.GollumEvent{} err := json.Unmarshal(data, &gollumStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "GollumEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return gollumStruct + return gollumStruct, nil } -func newIssueComment(data []byte) mod.Event { +func newIssueComment(data []byte) (mod.Event, error) { issueCommentStruct := mod.IssueCommentEvent{} err := json.Unmarshal(data, &issueCommentStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "IssueCommentEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return issueCommentStruct + return issueCommentStruct, nil } -func newIssues(data []byte) mod.Event { +func newIssues(data []byte) (mod.Event, error) { issuesStruct := mod.IssuesEvent{} err := json.Unmarshal(data, &issuesStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "IssuesEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return issuesStruct + return issuesStruct, nil } -func newMember(data []byte) mod.Event { +func newMember(data []byte) (mod.Event, error) { memberStruct := mod.MemberEvent{} err := json.Unmarshal(data, &memberStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "MemberEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return memberStruct + return memberStruct, nil } -func newMembership(data []byte) mod.Event { +func newMembership(data []byte) (mod.Event, error) { membershipStruct := mod.MembershipEvent{} err := json.Unmarshal(data, &membershipStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "MembershipEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return membershipStruct + return membershipStruct, nil } -func newPageBuild(data []byte) mod.Event { +func newPageBuild(data []byte) (mod.Event, error) { pageBuildEvent := mod.PageBuildEvent{} err := json.Unmarshal(data, &pageBuildEvent) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "PageBuildEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return pageBuildEvent + return pageBuildEvent, nil } -func newPublic(data []byte) mod.Event { +func newPublic(data []byte) (mod.Event, error) { publicEvent := mod.PublicEvent{} err := json.Unmarshal(data, &publicEvent) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "PublicEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return publicEvent + return publicEvent, nil } -func newPullRequest(data []byte) mod.Event { +func newPullRequest(data []byte) (mod.Event, error) { pullRequestStruct := mod.PullRequestEvent{} err := json.Unmarshal(data, &pullRequestStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "PullRequestEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return pullRequestStruct + return pullRequestStruct, nil } -func newPullRequestReviewComment(data []byte) mod.Event { +func newPullRequestReviewComment(data []byte) (mod.Event, error) { pullRequestReviewCommentStruct := mod.PullRequestReviewCommentEvent{} err := json.Unmarshal(data, &pullRequestReviewCommentStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "PullRequestReviewCommentEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return pullRequestReviewCommentStruct + return pullRequestReviewCommentStruct, nil } -func newPush(data []byte) mod.Event { +func newPush(data []byte) (mod.Event, error) { pushStruct := mod.PushEvent{} err := json.Unmarshal(data, &pushStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "PushEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return pushStruct + return pushStruct, nil } -func newRelease(data []byte) mod.Event { +func newRelease(data []byte) (mod.Event, error) { releaseStruct := mod.ReleaseEvent{} err := json.Unmarshal(data, &releaseStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "ReleaseEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return releaseStruct + return releaseStruct, nil } -func newRepository(data []byte) mod.Event { +func newRepository(data []byte) (mod.Event, error) { repositoryStruct := mod.RepositoryEvent{} err := json.Unmarshal(data, &repositoryStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "RepositoryEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return repositoryStruct + return repositoryStruct, nil } -func newStatus(data []byte) mod.Event { +func newStatus(data []byte) (mod.Event, error) { statusStruct := mod.StatusEvent{} err := json.Unmarshal(data, &statusStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "StatusEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return statusStruct + return statusStruct, nil } -func newTeamAdd(data []byte) mod.Event { +func newTeamAdd(data []byte) (mod.Event, error) { teamAddStruct := mod.TeamAddEvent{} err := json.Unmarshal(data, &teamAddStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "TeamAddEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return teamAddStruct + return teamAddStruct, nil } -func newWatch(data []byte) mod.Event { +func newWatch(data []byte) (mod.Event, error) { watchStruct := mod.WatchEvent{} err := json.Unmarshal(data, &watchStruct) if err != nil { - fields := log.Fields{"time": time.Now(), "event": "WatchEvent", "error": err} - log.WithFields(fields).Fatalf("Error in unmarshaling JSON") + return nil, err } - return watchStruct + return watchStruct, nil } -func NewEvent(r []byte, t string) mod.Event { - log.WithFields(log.Fields{"event": t, "time": time.Now()}).Info("Event Recieved") +type newEventError struct { + s string +} + +func (e *newEventError) Error() string { + return e.s +} + +func NewEvent(r []byte, t string) (mod.Event, error) { + log.Printf("New %v event recieved", t) switch t { case "commit_comment": return newCommitComment(r) @@ -362,5 +334,5 @@ func NewEvent(r []byte, t string) mod.Event { case "watch": return newWatch(r) } - return nil + return nil, &newEventError{"Not a recgonized event type"} } diff --git a/plugins/inputs/ghwebhooks/ghwebhooks_test.go b/plugins/inputs/ghwebhooks/ghwebhooks_test.go new file mode 100644 index 000000000..028715aeb --- /dev/null +++ b/plugins/inputs/ghwebhooks/ghwebhooks_test.go @@ -0,0 +1,238 @@ +package ghwebhooks + +import ( + "net/http" + "net/http/httptest" + "strings" + "testing" + + mod "github.com/influxdata/telegraf/plugins/inputs/ghwebhooks/models" +) + +func TestCommitCommentEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.CommitCommentEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "commit_comment") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestDeleteEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.DeleteEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "delete") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestDeploymentEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.DeploymentEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "deployment") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestDeploymentStatusEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.DeploymentStatusEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "deployment_status") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestForkEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.ForkEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "fork") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestGollumEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.GollumEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "gollum") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestIssueCommentEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.IssueCommentEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "issue_comment") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestIssuesEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.IssuesEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "issues") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestMemberEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.MemberEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "member") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestMembershipEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.MembershipEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "membership") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestPageBuildEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.PageBuildEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "page_build") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestPublicEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.PublicEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "public") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestPullRequestReviewCommentEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.PullRequestReviewCommentEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "pull_request_review_comment") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestPushEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.PushEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "push") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestReleaseEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.ReleaseEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "release") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestRepositoryEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.RepositoryEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "repository") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestStatusEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.StatusEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "status") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestTeamAddEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.TeamAddEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "team_add") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestWatchEvent(t *testing.T) { + gh := NewGHWebhooks() + jsonString := mod.Mock{}.WatchEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "watch") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} diff --git a/plugins/inputs/ghwebhooks/models/mock_json.go b/plugins/inputs/ghwebhooks/models/mock_json.go new file mode 100644 index 000000000..4d2232e07 --- /dev/null +++ b/plugins/inputs/ghwebhooks/models/mock_json.go @@ -0,0 +1,3561 @@ +package models + +type Mock struct{} + +func (_ Mock) CommitCommentEventJSON() string { + return `{ + "action": "created", + "comment": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/comments/11056394", + "html_url": "https://github.com/baxterthehacker/public-repo/commit/9049f1265b7d61be4a8904a9a27120d2064dab3b#commitcomment-11056394", + "id": 11056394, + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "position": null, + "line": null, + "path": null, + "commit_id": "9049f1265b7d61be4a8904a9a27120d2064dab3b", + "created_at": "2015-05-05T23:40:29Z", + "updated_at": "2015-05-05T23:40:29Z", + "body": "This is a really good change! :+1:" + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func (_ Mock) CreateEventJSON() string { + return `{ + "ref": "0.0.1", + "ref_type": "tag", + "master_branch": "master", + "description": "", + "pusher_type": "user", + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:38Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func (_ Mock) DeleteEventJSON() string { + return `{ + "ref": "simple-tag", + "ref_type": "tag", + "pusher_type": "user", + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:40Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func (_ Mock) DeploymentEventJSON() string { + return `{ + "deployment": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692", + "id": 710692, + "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", + "ref": "master", + "task": "deploy", + "payload": { + }, + "environment": "production", + "description": null, + "creator": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2015-05-05T23:40:38Z", + "updated_at": "2015-05-05T23:40:38Z", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692/statuses", + "repository_url": "https://api.github.com/repos/baxterthehacker/public-repo" + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:38Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func (_ Mock) DeploymentStatusEventJSON() string { + return `{ + "deployment": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692", + "id": 710692, + "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", + "ref": "master", + "task": "deploy", + "payload": { + }, + "environment": "production", + "description": null, + "creator": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2015-05-05T23:40:38Z", + "updated_at": "2015-05-05T23:40:38Z", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692/statuses", + "repository_url": "https://api.github.com/repos/baxterthehacker/public-repo" + }, + "deployment_status": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692/statuses/1115122", + "id": 1115122, + "state": "success", + "creator": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "description": null, + "target_url": null, + "created_at": "2015-05-05T23:40:39Z", + "updated_at": "2015-05-05T23:40:39Z", + "deployment_url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692", + "repository_url": "https://api.github.com/repos/baxterthehacker/public-repo" + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:38Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +} +` +} + +func (_ Mock) ForkEventJSON() string { + return `{ + "forkee": { + "id": 35129393, + "name": "public-repo", + "full_name": "baxterandthehackers/public-repo", + "owner": { + "login": "baxterandthehackers", + "id": 7649605, + "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterandthehackers", + "html_url": "https://github.com/baxterandthehackers", + "followers_url": "https://api.github.com/users/baxterandthehackers/followers", + "following_url": "https://api.github.com/users/baxterandthehackers/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterandthehackers/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterandthehackers/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterandthehackers/subscriptions", + "organizations_url": "https://api.github.com/users/baxterandthehackers/orgs", + "repos_url": "https://api.github.com/users/baxterandthehackers/repos", + "events_url": "https://api.github.com/users/baxterandthehackers/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterandthehackers/received_events", + "type": "Organization", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterandthehackers/public-repo", + "description": "", + "fork": true, + "url": "https://api.github.com/repos/baxterandthehackers/public-repo", + "forks_url": "https://api.github.com/repos/baxterandthehackers/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterandthehackers/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterandthehackers/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterandthehackers/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterandthehackers/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterandthehackers/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterandthehackers/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterandthehackers/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterandthehackers/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterandthehackers/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterandthehackers/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterandthehackers/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterandthehackers/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterandthehackers/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterandthehackers/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterandthehackers/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterandthehackers/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterandthehackers/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterandthehackers/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterandthehackers/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterandthehackers/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterandthehackers/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterandthehackers/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterandthehackers/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterandthehackers/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterandthehackers/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterandthehackers/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterandthehackers/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterandthehackers/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterandthehackers/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:30Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterandthehackers/public-repo.git", + "ssh_url": "git@github.com:baxterandthehackers/public-repo.git", + "clone_url": "https://github.com/baxterandthehackers/public-repo.git", + "svn_url": "https://github.com/baxterandthehackers/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 0, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "public": true + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 1, + "mirror_url": null, + "open_issues_count": 2, + "forks": 1, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterandthehackers", + "id": 7649605, + "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterandthehackers", + "html_url": "https://github.com/baxterandthehackers", + "followers_url": "https://api.github.com/users/baxterandthehackers/followers", + "following_url": "https://api.github.com/users/baxterandthehackers/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterandthehackers/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterandthehackers/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterandthehackers/subscriptions", + "organizations_url": "https://api.github.com/users/baxterandthehackers/orgs", + "repos_url": "https://api.github.com/users/baxterandthehackers/repos", + "events_url": "https://api.github.com/users/baxterandthehackers/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterandthehackers/received_events", + "type": "Organization", + "site_admin": false + } +}` +} + +func (_ Mock) GollumEventJSON() string { + return `{ + "pages": [ + { + "page_name": "Home", + "title": "Home", + "summary": null, + "action": "created", + "sha": "91ea1bd42aa2ba166b86e8aefe049e9837214e67", + "html_url": "https://github.com/baxterthehacker/public-repo/wiki/Home" + } + ], + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:17Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 0, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "jasonrudolph", + "id": 2988, + "avatar_url": "https://avatars.githubusercontent.com/u/2988?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/jasonrudolph", + "html_url": "https://github.com/jasonrudolph", + "followers_url": "https://api.github.com/users/jasonrudolph/followers", + "following_url": "https://api.github.com/users/jasonrudolph/following{/other_user}", + "gists_url": "https://api.github.com/users/jasonrudolph/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jasonrudolph/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jasonrudolph/subscriptions", + "organizations_url": "https://api.github.com/users/jasonrudolph/orgs", + "repos_url": "https://api.github.com/users/jasonrudolph/repos", + "events_url": "https://api.github.com/users/jasonrudolph/events{/privacy}", + "received_events_url": "https://api.github.com/users/jasonrudolph/received_events", + "type": "User", + "site_admin": true + } +}` +} + +func (_ Mock) IssueCommentEventJSON() string { + return `{ + "action": "created", + "issue": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2/labels{/name}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2/comments", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2/events", + "html_url": "https://github.com/baxterthehacker/public-repo/issues/2", + "id": 73464126, + "number": 2, + "title": "Spelling error in the README file", + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "labels": [ + { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/labels/bug", + "name": "bug", + "color": "fc2929" + } + ], + "state": "open", + "locked": false, + "assignee": null, + "milestone": null, + "comments": 1, + "created_at": "2015-05-05T23:40:28Z", + "updated_at": "2015-05-05T23:40:28Z", + "closed_at": null, + "body": "It looks like you accidently spelled 'commit' with two 't's." + }, + "comment": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments/99262140", + "html_url": "https://github.com/baxterthehacker/public-repo/issues/2#issuecomment-99262140", + "issue_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2", + "id": 99262140, + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2015-05-05T23:40:28Z", + "updated_at": "2015-05-05T23:40:28Z", + "body": "You are totally right! I'll get this fixed right away." + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func (_ Mock) IssuesEventJSON() string { + return `{ + "action": "opened", + "issue": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2/labels{/name}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2/comments", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2/events", + "html_url": "https://github.com/baxterthehacker/public-repo/issues/2", + "id": 73464126, + "number": 2, + "title": "Spelling error in the README file", + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "labels": [ + { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/labels/bug", + "name": "bug", + "color": "fc2929" + } + ], + "state": "open", + "locked": false, + "assignee": null, + "milestone": null, + "comments": 0, + "created_at": "2015-05-05T23:40:28Z", + "updated_at": "2015-05-05T23:40:28Z", + "closed_at": null, + "body": "It looks like you accidently spelled 'commit' with two 't's." + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func (_ Mock) MemberEventJSON() string { + return `{ + "action": "added", + "member": { + "login": "octocat", + "id": 583231, + "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/octocat", + "html_url": "https://github.com/octocat", + "followers_url": "https://api.github.com/users/octocat/followers", + "following_url": "https://api.github.com/users/octocat/following{/other_user}", + "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", + "organizations_url": "https://api.github.com/users/octocat/orgs", + "repos_url": "https://api.github.com/users/octocat/repos", + "events_url": "https://api.github.com/users/octocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/octocat/received_events", + "type": "User", + "site_admin": false + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:40Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func (_ Mock) MembershipEventJSON() string { + return `{ + "action": "added", + "scope": "team", + "member": { + "login": "kdaigle", + "id": 2501, + "avatar_url": "https://avatars.githubusercontent.com/u/2501?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/kdaigle", + "html_url": "https://github.com/kdaigle", + "followers_url": "https://api.github.com/users/kdaigle/followers", + "following_url": "https://api.github.com/users/kdaigle/following{/other_user}", + "gists_url": "https://api.github.com/users/kdaigle/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kdaigle/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kdaigle/subscriptions", + "organizations_url": "https://api.github.com/users/kdaigle/orgs", + "repos_url": "https://api.github.com/users/kdaigle/repos", + "events_url": "https://api.github.com/users/kdaigle/events{/privacy}", + "received_events_url": "https://api.github.com/users/kdaigle/received_events", + "type": "User", + "site_admin": true + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=2", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "team": { + "name": "Contractors", + "id": 123456, + "slug": "contractors", + "permission": "admin", + "url": "https://api.github.com/teams/123456", + "members_url": "https://api.github.com/teams/123456/members{/member}", + "repositories_url": "https://api.github.com/teams/123456/repos" + }, + "organization": { + "login": "baxterandthehackers", + "id": 7649605, + "url": "https://api.github.com/orgs/baxterandthehackers", + "repos_url": "https://api.github.com/orgs/baxterandthehackers/repos", + "events_url": "https://api.github.com/orgs/baxterandthehackers/events", + "members_url": "https://api.github.com/orgs/baxterandthehackers/members{/member}", + "public_members_url": "https://api.github.com/orgs/baxterandthehackers/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=2" + } +}` +} + +func (_ Mock) PageBuildEventJSON() string { + return `{ + "id": 15995382, + "build": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/pages/builds/15995382", + "status": "built", + "error": { + "message": null + }, + "pusher": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "commit": "053b99542c83021d6b202d1a1f5ecd5ef7084e55", + "duration": 3790, + "created_at": "2015-05-05T23:40:13Z", + "updated_at": "2015-05-05T23:40:17Z" + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:17Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 0, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func (_ Mock) PublicEventJSON() string { + return `{ + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:41Z", + "pushed_at": "2015-05-05T23:40:40Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func (_ Mock) PullRequestReviewCommentEventJSON() string { + return `{ + "action": "created", + "comment": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments/29724692", + "id": 29724692, + "diff_hunk": "@@ -1 +1 @@\n-# public-repo", + "path": "README.md", + "position": 1, + "original_position": 1, + "commit_id": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "original_commit_id": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "body": "Maybe you should use more emojji on this line.", + "created_at": "2015-05-05T23:40:27Z", + "updated_at": "2015-05-05T23:40:27Z", + "html_url": "https://github.com/baxterthehacker/public-repo/pull/1#discussion_r29724692", + "pull_request_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1", + "_links": { + "self": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments/29724692" + }, + "html": { + "href": "https://github.com/baxterthehacker/public-repo/pull/1#discussion_r29724692" + }, + "pull_request": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1" + } + } + }, + "pull_request": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1", + "id": 34778301, + "html_url": "https://github.com/baxterthehacker/public-repo/pull/1", + "diff_url": "https://github.com/baxterthehacker/public-repo/pull/1.diff", + "patch_url": "https://github.com/baxterthehacker/public-repo/pull/1.patch", + "issue_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1", + "number": 1, + "state": "open", + "locked": false, + "title": "Update the README with new information", + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "body": "This is a pretty simple change that we need to pull into master.", + "created_at": "2015-05-05T23:40:27Z", + "updated_at": "2015-05-05T23:40:27Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": "18721552ba489fb84e12958c1b5694b5475f7991", + "assignee": null, + "milestone": null, + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/commits", + "review_comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/comments", + "review_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1/comments", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "head": { + "label": "baxterthehacker:changes", + "ref": "changes", + "sha": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 1, + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "master" + } + }, + "base": { + "label": "baxterthehacker:master", + "ref": "master", + "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 1, + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "master" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1" + }, + "html": { + "href": "https://github.com/baxterthehacker/public-repo/pull/1" + }, + "issue": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1" + }, + "comments": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c" + } + } + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 1, + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func (_ Mock) PullRequestEventJSON() string { + return `{ + "action": "opened", + "number": 1, + "pull_request": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1", + "id": 34778301, + "html_url": "https://github.com/baxterthehacker/public-repo/pull/1", + "diff_url": "https://github.com/baxterthehacker/public-repo/pull/1.diff", + "patch_url": "https://github.com/baxterthehacker/public-repo/pull/1.patch", + "issue_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1", + "number": 1, + "state": "open", + "locked": false, + "title": "Update the README with new information", + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "body": "This is a pretty simple change that we need to pull into master.", + "created_at": "2015-05-05T23:40:27Z", + "updated_at": "2015-05-05T23:40:27Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": null, + "assignee": null, + "milestone": null, + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/commits", + "review_comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/comments", + "review_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1/comments", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "head": { + "label": "baxterthehacker:changes", + "ref": "changes", + "sha": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:26Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 1, + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "master" + } + }, + "base": { + "label": "baxterthehacker:master", + "ref": "master", + "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:26Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 1, + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "master" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1" + }, + "html": { + "href": "https://github.com/baxterthehacker/public-repo/pull/1" + }, + "issue": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1" + }, + "comments": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c" + } + }, + "merged": false, + "mergeable": null, + "mergeable_state": "unknown", + "merged_by": null, + "comments": 0, + "review_comments": 0, + "commits": 1, + "additions": 1, + "deletions": 1, + "changed_files": 1 + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:26Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 1, + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func (_ Mock) PushEventJSON() string { + return `{ + "ref": "refs/heads/changes", + "before": "9049f1265b7d61be4a8904a9a27120d2064dab3b", + "after": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "created": false, + "deleted": false, + "forced": false, + "base_ref": null, + "compare": "https://github.com/baxterthehacker/public-repo/compare/9049f1265b7d...0d1a26e67d8f", + "commits": [ + { + "id": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "distinct": true, + "message": "Update README.md", + "timestamp": "2015-05-05T19:40:15-04:00", + "url": "https://github.com/baxterthehacker/public-repo/commit/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "author": { + "name": "baxterthehacker", + "email": "baxterthehacker@users.noreply.github.com", + "username": "baxterthehacker" + }, + "committer": { + "name": "baxterthehacker", + "email": "baxterthehacker@users.noreply.github.com", + "username": "baxterthehacker" + }, + "added": [ + + ], + "removed": [ + + ], + "modified": [ + "README.md" + ] + } + ], + "head_commit": { + "id": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "distinct": true, + "message": "Update README.md", + "timestamp": "2015-05-05T19:40:15-04:00", + "url": "https://github.com/baxterthehacker/public-repo/commit/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "author": { + "name": "baxterthehacker", + "email": "baxterthehacker@users.noreply.github.com", + "username": "baxterthehacker" + }, + "committer": { + "name": "baxterthehacker", + "email": "baxterthehacker@users.noreply.github.com", + "username": "baxterthehacker" + }, + "added": [ + + ], + "removed": [ + + ], + "modified": [ + "README.md" + ] + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "name": "baxterthehacker", + "email": "baxterthehacker@users.noreply.github.com" + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://github.com/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": 1430869212, + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": 1430869217, + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 0, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "stargazers": 0, + "master_branch": "master" + }, + "pusher": { + "name": "baxterthehacker", + "email": "baxterthehacker@users.noreply.github.com" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func (_ Mock) RepositoryEventJSON() string { + return `{ + "action": "created", + "repository": { + "id": 27496774, + "name": "new-repository", + "full_name": "baxterandthehackers/new-repository", + "owner": { + "login": "baxterandthehackers", + "id": 7649605, + "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterandthehackers", + "html_url": "https://github.com/baxterandthehackers", + "followers_url": "https://api.github.com/users/baxterandthehackers/followers", + "following_url": "https://api.github.com/users/baxterandthehackers/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterandthehackers/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterandthehackers/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterandthehackers/subscriptions", + "organizations_url": "https://api.github.com/users/baxterandthehackers/orgs", + "repos_url": "https://api.github.com/users/baxterandthehackers/repos", + "events_url": "https://api.github.com/users/baxterandthehackers/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterandthehackers/received_events", + "type": "Organization", + "site_admin": false + }, + "private": true, + "html_url": "https://github.com/baxterandthehackers/new-repository", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterandthehackers/new-repository", + "forks_url": "https://api.github.com/repos/baxterandthehackers/new-repository/forks", + "keys_url": "https://api.github.com/repos/baxterandthehackers/new-repository/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterandthehackers/new-repository/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterandthehackers/new-repository/teams", + "hooks_url": "https://api.github.com/repos/baxterandthehackers/new-repository/hooks", + "issue_events_url": "https://api.github.com/repos/baxterandthehackers/new-repository/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterandthehackers/new-repository/events", + "assignees_url": "https://api.github.com/repos/baxterandthehackers/new-repository/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterandthehackers/new-repository/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterandthehackers/new-repository/tags", + "blobs_url": "https://api.github.com/repos/baxterandthehackers/new-repository/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterandthehackers/new-repository/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterandthehackers/new-repository/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterandthehackers/new-repository/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterandthehackers/new-repository/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterandthehackers/new-repository/languages", + "stargazers_url": "https://api.github.com/repos/baxterandthehackers/new-repository/stargazers", + "contributors_url": "https://api.github.com/repos/baxterandthehackers/new-repository/contributors", + "subscribers_url": "https://api.github.com/repos/baxterandthehackers/new-repository/subscribers", + "subscription_url": "https://api.github.com/repos/baxterandthehackers/new-repository/subscription", + "commits_url": "https://api.github.com/repos/baxterandthehackers/new-repository/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterandthehackers/new-repository/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterandthehackers/new-repository/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterandthehackers/new-repository/issues/comments/{number}", + "contents_url": "https://api.github.com/repos/baxterandthehackers/new-repository/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterandthehackers/new-repository/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterandthehackers/new-repository/merges", + "archive_url": "https://api.github.com/repos/baxterandthehackers/new-repository/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterandthehackers/new-repository/downloads", + "issues_url": "https://api.github.com/repos/baxterandthehackers/new-repository/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterandthehackers/new-repository/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterandthehackers/new-repository/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterandthehackers/new-repository/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterandthehackers/new-repository/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterandthehackers/new-repository/releases{/id}", + "created_at": "2014-12-03T16:39:25Z", + "updated_at": "2014-12-03T16:39:25Z", + "pushed_at": "2014-12-03T16:39:25Z", + "git_url": "git://github.com/baxterandthehackers/new-repository.git", + "ssh_url": "git@github.com:baxterandthehackers/new-repository.git", + "clone_url": "https://github.com/baxterandthehackers/new-repository.git", + "svn_url": "https://github.com/baxterandthehackers/new-repository", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 0, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master" + }, + "organization": { + "login": "baxterandthehackers", + "id": 7649605, + "url": "https://api.github.com/orgs/baxterandthehackers", + "repos_url": "https://api.github.com/orgs/baxterandthehackers/repos", + "events_url": "https://api.github.com/orgs/baxterandthehackers/events", + "members_url": "https://api.github.com/orgs/baxterandthehackers/members{/member}", + "public_members_url": "https://api.github.com/orgs/baxterandthehackers/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=2" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=2", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func (_ Mock) ReleaseEventJSON() string { + return `{ + "action": "published", + "release": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/releases/1261438", + "assets_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases/1261438/assets", + "upload_url": "https://uploads.github.com/repos/baxterthehacker/public-repo/releases/1261438/assets{?name}", + "html_url": "https://github.com/baxterthehacker/public-repo/releases/tag/0.0.1", + "id": 1261438, + "tag_name": "0.0.1", + "target_commitish": "master", + "name": null, + "draft": false, + "author": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "prerelease": false, + "created_at": "2015-05-05T23:40:12Z", + "published_at": "2015-05-05T23:40:38Z", + "assets": [ + + ], + "tarball_url": "https://api.github.com/repos/baxterthehacker/public-repo/tarball/0.0.1", + "zipball_url": "https://api.github.com/repos/baxterthehacker/public-repo/zipball/0.0.1", + "body": null + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:38Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func (_ Mock) StatusEventJSON() string { + return `{ + "id": 214015194, + "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", + "name": "baxterthehacker/public-repo", + "target_url": null, + "context": "default", + "description": null, + "state": "success", + "commit": { + "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", + "commit": { + "author": { + "name": "baxterthehacker", + "email": "baxterthehacker@users.noreply.github.com", + "date": "2015-05-05T23:40:12Z" + }, + "committer": { + "name": "baxterthehacker", + "email": "baxterthehacker@users.noreply.github.com", + "date": "2015-05-05T23:40:12Z" + }, + "message": "Initial commit", + "tree": { + "sha": "02b49ad0ba4f1acd9f06531b21e16a4ac5d341d0", + "url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees/02b49ad0ba4f1acd9f06531b21e16a4ac5d341d0" + }, + "url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits/9049f1265b7d61be4a8904a9a27120d2064dab3b", + "comment_count": 1 + }, + "url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/9049f1265b7d61be4a8904a9a27120d2064dab3b", + "html_url": "https://github.com/baxterthehacker/public-repo/commit/9049f1265b7d61be4a8904a9a27120d2064dab3b", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/9049f1265b7d61be4a8904a9a27120d2064dab3b/comments", + "author": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "committer": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "parents": [ + + ] + }, + "branches": [ + { + "name": "master", + "commit": { + "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", + "url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/9049f1265b7d61be4a8904a9a27120d2064dab3b" + } + }, + { + "name": "changes", + "commit": { + "sha": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c" + } + }, + { + "name": "gh-pages", + "commit": { + "sha": "b11bb7545ac14abafc6191a0481b0d961e7793c6", + "url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/b11bb7545ac14abafc6191a0481b0d961e7793c6" + } + } + ], + "created_at": "2015-05-05T23:40:39Z", + "updated_at": "2015-05-05T23:40:39Z", + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:39Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func (_ Mock) TeamAddEventJSON() string { + return `{ + "team": { + "name": "github", + "id": 836012, + "slug": "github", + "description": "", + "permission": "pull", + "url": "https://api.github.com/teams/836012", + "members_url": "https://api.github.com/teams/836012/members{/member}", + "repositories_url": "https://api.github.com/teams/836012/repos" + }, + "repository": { + "id": 35129393, + "name": "public-repo", + "full_name": "baxterandthehackers/public-repo", + "owner": { + "login": "baxterandthehackers", + "id": 7649605, + "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterandthehackers", + "html_url": "https://github.com/baxterandthehackers", + "followers_url": "https://api.github.com/users/baxterandthehackers/followers", + "following_url": "https://api.github.com/users/baxterandthehackers/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterandthehackers/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterandthehackers/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterandthehackers/subscriptions", + "organizations_url": "https://api.github.com/users/baxterandthehackers/orgs", + "repos_url": "https://api.github.com/users/baxterandthehackers/repos", + "events_url": "https://api.github.com/users/baxterandthehackers/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterandthehackers/received_events", + "type": "Organization", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterandthehackers/public-repo", + "description": "", + "fork": true, + "url": "https://api.github.com/repos/baxterandthehackers/public-repo", + "forks_url": "https://api.github.com/repos/baxterandthehackers/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterandthehackers/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterandthehackers/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterandthehackers/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterandthehackers/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterandthehackers/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterandthehackers/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterandthehackers/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterandthehackers/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterandthehackers/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterandthehackers/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterandthehackers/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterandthehackers/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterandthehackers/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterandthehackers/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterandthehackers/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterandthehackers/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterandthehackers/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterandthehackers/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterandthehackers/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterandthehackers/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterandthehackers/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterandthehackers/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterandthehackers/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterandthehackers/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterandthehackers/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterandthehackers/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterandthehackers/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterandthehackers/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterandthehackers/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:30Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterandthehackers/public-repo.git", + "ssh_url": "git@github.com:baxterandthehackers/public-repo.git", + "clone_url": "https://github.com/baxterandthehackers/public-repo.git", + "svn_url": "https://github.com/baxterandthehackers/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 0, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master" + }, + "organization": { + "login": "baxterandthehackers", + "id": 7649605, + "url": "https://api.github.com/orgs/baxterandthehackers", + "repos_url": "https://api.github.com/orgs/baxterandthehackers/repos", + "events_url": "https://api.github.com/orgs/baxterandthehackers/events", + "members_url": "https://api.github.com/orgs/baxterandthehackers/members{/member}", + "public_members_url": "https://api.github.com/orgs/baxterandthehackers/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=3", + "description": null + }, + "sender": { + "login": "baxterandthehackers", + "id": 7649605, + "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterandthehackers", + "html_url": "https://github.com/baxterandthehackers", + "followers_url": "https://api.github.com/users/baxterandthehackers/followers", + "following_url": "https://api.github.com/users/baxterandthehackers/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterandthehackers/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterandthehackers/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterandthehackers/subscriptions", + "organizations_url": "https://api.github.com/users/baxterandthehackers/orgs", + "repos_url": "https://api.github.com/users/baxterandthehackers/repos", + "events_url": "https://api.github.com/users/baxterandthehackers/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterandthehackers/received_events", + "type": "Organization", + "site_admin": false + } +}` +} + +func (_ Mock) WatchEventJSON() string { + return `{ + "action": "started", + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} diff --git a/plugins/inputs/ghwebhooks/models/models.go b/plugins/inputs/ghwebhooks/models/models.go index b310bb94d..3e512c9fe 100644 --- a/plugins/inputs/ghwebhooks/models/models.go +++ b/plugins/inputs/ghwebhooks/models/models.go @@ -2,16 +2,17 @@ package models import ( "fmt" + "log" "time" - log "github.com/Sirupsen/logrus" "github.com/influxdata/influxdb/client/v2" ) -const Measurement = "ghWebhooks" +const meas = "ghWebhooks" type Event interface { NewPoint() *client.Point + JSON() string } type Repository struct { @@ -106,11 +107,9 @@ func (s CommitCommentEvent) NewPoint() *client.Point { "commit": s.Comment.Commit, "comment": s.Comment.Body, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -138,11 +137,9 @@ func (s CreateEvent) NewPoint() *client.Point { "ref": s.Ref, "refType": s.RefType, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -170,11 +167,9 @@ func (s DeleteEvent) NewPoint() *client.Point { "ref": s.Ref, "refType": s.RefType, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -203,11 +198,9 @@ func (s DeploymentEvent) NewPoint() *client.Point { "environment": s.Deployment.Environment, "description": s.Deployment.Description, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -239,11 +232,9 @@ func (s DeploymentStatusEvent) NewPoint() *client.Point { "depState": s.DeploymentStatus.State, "depDescription": s.DeploymentStatus.Description, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -269,11 +260,9 @@ func (s ForkEvent) NewPoint() *client.Point { "issues": s.Repository.Issues, "fork": s.Forkee.Repository, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -299,11 +288,9 @@ func (s GollumEvent) NewPoint() *client.Point { "forks": s.Repository.Forks, "issues": s.Repository.Issues, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -333,11 +320,9 @@ func (s IssueCommentEvent) NewPoint() *client.Point { "comments": s.Issue.Comments, "body": s.Comment.Body, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -367,11 +352,9 @@ func (s IssuesEvent) NewPoint() *client.Point { "title": s.Issue.Title, "comments": s.Issue.Comments, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -398,11 +381,9 @@ func (s MemberEvent) NewPoint() *client.Point { "newMember": s.Member.User, "newMemberStatus": s.Member.Admin, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -426,11 +407,9 @@ func (s MembershipEvent) NewPoint() *client.Point { "newMember": s.Member.User, "newMemberStatus": s.Member.Admin, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -454,11 +433,9 @@ func (s PageBuildEvent) NewPoint() *client.Point { "forks": s.Repository.Forks, "issues": s.Repository.Issues, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -482,11 +459,9 @@ func (s PublicEvent) NewPoint() *client.Point { "forks": s.Repository.Forks, "issues": s.Repository.Issues, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -521,11 +496,9 @@ func (s PullRequestEvent) NewPoint() *client.Point { "deletions": s.PullRequest.Deletions, "changedFiles": s.PullRequest.ChangedFiles, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -561,11 +534,9 @@ func (s PullRequestReviewCommentEvent) NewPoint() *client.Point { "commentFile": s.Comment.File, "comment": s.Comment.Comment, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -595,11 +566,9 @@ func (s PushEvent) NewPoint() *client.Point { "Before": s.Before, "After": s.After, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -625,11 +594,9 @@ func (s ReleaseEvent) NewPoint() *client.Point { "issues": s.Repository.Issues, "tagName": s.Release.TagName, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -653,11 +620,9 @@ func (s RepositoryEvent) NewPoint() *client.Point { "forks": s.Repository.Forks, "issues": s.Repository.Issues, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -685,11 +650,9 @@ func (s StatusEvent) NewPoint() *client.Point { "commit": s.Commit, "state": s.State, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -715,11 +678,9 @@ func (s TeamAddEvent) NewPoint() *client.Point { "issues": s.Repository.Issues, "teamName": s.Team.Name, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } @@ -743,11 +704,9 @@ func (s WatchEvent) NewPoint() *client.Point { "forks": s.Repository.Forks, "issues": s.Repository.Issues, } - time := time.Now() - p, err := client.NewPoint(Measurement, t, f, time) + p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { - i := log.Fields{"event": event, "error": err} - log.WithFields(i).Fatal("Error creating new point...") + log.Fatalf("Failed to create %v event", event) } return p } From dbf1383a38740ee7839d545b4584db10d223b5fa Mon Sep 17 00:00:00 2001 From: Jack Zampolin Date: Fri, 22 Jan 2016 16:45:31 -0800 Subject: [PATCH 05/10] Change github.com/influxdata to github.com/influxdata --- CHANGELOG.md | 316 +++++++++--------- CONTRIBUTING.md | 10 +- Godeps | 2 +- README.md | 6 +- accumulator.go | 4 +- agent.go | 8 +- agent_test.go | 6 +- build.py | 2 +- cmd/telegraf/telegraf.go | 8 +- internal/config/config.go | 8 +- internal/config/config_test.go | 8 +- plugins/inputs/aerospike/aerospike.go | 2 +- plugins/inputs/aerospike/aerospike_test.go | 2 +- plugins/inputs/all/all.go | 74 ++-- plugins/inputs/apache/apache.go | 2 +- plugins/inputs/apache/apache_test.go | 2 +- plugins/inputs/bcache/bcache.go | 2 +- plugins/inputs/bcache/bcache_test.go | 2 +- plugins/inputs/disque/disque.go | 2 +- plugins/inputs/disque/disque_test.go | 2 +- plugins/inputs/elasticsearch/elasticsearch.go | 4 +- .../elasticsearch/elasticsearch_test.go | 2 +- plugins/inputs/exec/exec.go | 4 +- plugins/inputs/exec/exec_test.go | 2 +- plugins/inputs/ghwebhooks/ghwebhooks.go | 4 +- plugins/inputs/ghwebhooks/ghwebhooks_test.go | 2 +- plugins/inputs/ghwebhooks/models/models.go | 2 +- plugins/inputs/haproxy/haproxy.go | 2 +- plugins/inputs/haproxy/haproxy_test.go | 2 +- plugins/inputs/httpjson/httpjson.go | 4 +- plugins/inputs/httpjson/httpjson_test.go | 2 +- plugins/inputs/influxdb/influxdb.go | 2 +- plugins/inputs/influxdb/influxdb_test.go | 4 +- plugins/inputs/jolokia/jolokia.go | 2 +- plugins/inputs/jolokia/jolokia_test.go | 2 +- .../inputs/kafka_consumer/kafka_consumer.go | 4 +- .../kafka_consumer_integration_test.go | 2 +- .../kafka_consumer/kafka_consumer_test.go | 4 +- plugins/inputs/leofs/leofs.go | 2 +- plugins/inputs/leofs/leofs_test.go | 2 +- plugins/inputs/lustre2/lustre2.go | 4 +- plugins/inputs/lustre2/lustre2_test.go | 2 +- plugins/inputs/mailchimp/mailchimp.go | 2 +- plugins/inputs/mailchimp/mailchimp_test.go | 2 +- plugins/inputs/memcached/memcached.go | 2 +- plugins/inputs/memcached/memcached_test.go | 2 +- plugins/inputs/mongodb/mongodb.go | 2 +- plugins/inputs/mongodb/mongodb_data.go | 2 +- plugins/inputs/mongodb/mongodb_data_test.go | 2 +- plugins/inputs/mongodb/mongodb_server.go | 2 +- plugins/inputs/mongodb/mongodb_server_test.go | 2 +- plugins/inputs/mysql/mysql.go | 2 +- plugins/inputs/mysql/mysql_test.go | 2 +- plugins/inputs/nginx/nginx.go | 2 +- plugins/inputs/nginx/nginx_test.go | 2 +- plugins/inputs/nsq/nsq.go | 2 +- plugins/inputs/nsq/nsq_test.go | 2 +- plugins/inputs/passenger/passenger.go | 2 +- plugins/inputs/passenger/passenger_test.go | 2 +- plugins/inputs/phpfpm/phpfpm.go | 2 +- plugins/inputs/phpfpm/phpfpm_test.go | 2 +- plugins/inputs/ping/ping.go | 2 +- plugins/inputs/ping/ping_test.go | 2 +- plugins/inputs/postgresql/postgresql.go | 2 +- plugins/inputs/postgresql/postgresql_test.go | 2 +- plugins/inputs/procstat/procstat.go | 2 +- plugins/inputs/procstat/procstat_test.go | 2 +- plugins/inputs/procstat/spec_processor.go | 2 +- plugins/inputs/prometheus/prometheus.go | 2 +- plugins/inputs/prometheus/prometheus_test.go | 2 +- plugins/inputs/puppetagent/puppetagent.go | 2 +- .../inputs/puppetagent/puppetagent_test.go | 2 +- plugins/inputs/rabbitmq/rabbitmq.go | 2 +- plugins/inputs/rabbitmq/rabbitmq_test.go | 2 +- plugins/inputs/redis/redis.go | 2 +- plugins/inputs/redis/redis_test.go | 2 +- plugins/inputs/rethinkdb/rethinkdb.go | 2 +- plugins/inputs/rethinkdb/rethinkdb_data.go | 2 +- .../inputs/rethinkdb/rethinkdb_data_test.go | 2 +- plugins/inputs/rethinkdb/rethinkdb_server.go | 2 +- .../inputs/rethinkdb/rethinkdb_server_test.go | 2 +- plugins/inputs/sensors/sensors.go | 2 +- plugins/inputs/statsd/README.md | 2 +- plugins/inputs/statsd/statsd.go | 4 +- plugins/inputs/statsd/statsd_test.go | 2 +- plugins/inputs/system/cpu.go | 2 +- plugins/inputs/system/cpu_test.go | 2 +- plugins/inputs/system/disk.go | 2 +- plugins/inputs/system/disk_test.go | 2 +- plugins/inputs/system/docker.go | 2 +- plugins/inputs/system/docker_test.go | 2 +- plugins/inputs/system/memory.go | 2 +- plugins/inputs/system/memory_test.go | 2 +- plugins/inputs/system/net.go | 2 +- plugins/inputs/system/net_test.go | 2 +- plugins/inputs/system/netstat.go | 2 +- plugins/inputs/system/ps.go | 4 +- plugins/inputs/system/system.go | 2 +- plugins/inputs/trig/trig.go | 2 +- plugins/inputs/trig/trig_test.go | 2 +- plugins/inputs/twemproxy/twemproxy.go | 2 +- plugins/inputs/twemproxy/twemproxy_test.go | 2 +- plugins/inputs/zfs/zfs.go | 4 +- plugins/inputs/zfs/zfs_test.go | 2 +- plugins/inputs/zookeeper/zookeeper.go | 2 +- plugins/inputs/zookeeper/zookeeper_test.go | 2 +- plugins/outputs/all/all.go | 26 +- plugins/outputs/amon/amon.go | 6 +- plugins/outputs/amon/amon_test.go | 4 +- plugins/outputs/amqp/amqp.go | 4 +- plugins/outputs/amqp/amqp_test.go | 2 +- plugins/outputs/datadog/datadog.go | 6 +- plugins/outputs/datadog/datadog_test.go | 4 +- plugins/outputs/graphite/graphite.go | 4 +- plugins/outputs/graphite/graphite_test.go | 2 +- plugins/outputs/influxdb/influxdb.go | 6 +- plugins/outputs/influxdb/influxdb_test.go | 2 +- plugins/outputs/kafka/kafka.go | 4 +- plugins/outputs/kafka/kafka_test.go | 2 +- plugins/outputs/kinesis/kinesis.go | 4 +- plugins/outputs/kinesis/kinesis_test.go | 2 +- plugins/outputs/librato/librato.go | 6 +- plugins/outputs/librato/librato_test.go | 4 +- plugins/outputs/mqtt/mqtt.go | 6 +- plugins/outputs/mqtt/mqtt_test.go | 2 +- plugins/outputs/nsq/nsq.go | 4 +- plugins/outputs/nsq/nsq_test.go | 2 +- plugins/outputs/opentsdb/opentsdb.go | 4 +- plugins/outputs/opentsdb/opentsdb_test.go | 2 +- .../prometheus_client/prometheus_client.go | 4 +- .../prometheus_client_test.go | 6 +- plugins/outputs/registry.go | 2 +- plugins/outputs/riemann/riemann.go | 4 +- plugins/outputs/riemann/riemann_test.go | 2 +- scripts/Vagrantfile | 4 +- scripts/circle-test.sh | 6 +- scripts/telegraf.service | 2 +- testutil/testutil.go | 2 +- 138 files changed, 401 insertions(+), 401 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e86c74ada..7fa56a00a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,25 +1,25 @@ ## v0.10.1 [unreleased] ### Features -- [#509](https://github.com/influxdata/telegraf/pull/509): Flatten JSON arrays with indices. Thanks @psilva261! -- [#512](https://github.com/influxdata/telegraf/pull/512): Python 3 build script, add lsof dep to package. Thanks @Ormod! -- [#475](https://github.com/influxdata/telegraf/pull/475): Add response time to httpjson plugin. Thanks @titilambert! -- [#519](https://github.com/influxdata/telegraf/pull/519): Added a sensors input based on lm-sensors. Thanks @md14454! -- [#467](https://github.com/influxdata/telegraf/issues/467): Add option to disable statsd measurement name conversion. -- [#534](https://github.com/influxdata/telegraf/pull/534): NSQ input plugin. Thanks @allingeek! -- [#494](https://github.com/influxdata/telegraf/pull/494): Graphite output plugin. Thanks @titilambert! +- [#509](https://github.com/influxdb/telegraf/pull/509): Flatten JSON arrays with indices. Thanks @psilva261! +- [#512](https://github.com/influxdb/telegraf/pull/512): Python 3 build script, add lsof dep to package. Thanks @Ormod! +- [#475](https://github.com/influxdb/telegraf/pull/475): Add response time to httpjson plugin. Thanks @titilambert! +- [#519](https://github.com/influxdb/telegraf/pull/519): Added a sensors input based on lm-sensors. Thanks @md14454! +- [#467](https://github.com/influxdb/telegraf/issues/467): Add option to disable statsd measurement name conversion. +- [#534](https://github.com/influxdb/telegraf/pull/534): NSQ input plugin. Thanks @allingeek! +- [#494](https://github.com/influxdb/telegraf/pull/494): Graphite output plugin. Thanks @titilambert! - AMQP SSL support. Thanks @ekini! -- [#539](https://github.com/influxdata/telegraf/pull/539): Reload config on SIGHUP. Thanks @titilambert! -- [#522](https://github.com/influxdata/telegraf/pull/522): Phusion passenger input plugin. Thanks @kureikain! -- [#541](https://github.com/influxdata/telegraf/pull/541): Kafka output TLS cert support. Thanks @Ormod! -- [#551](https://github.com/influxdata/telegraf/pull/551): Statsd UDP read packet size now defaults to 1500 bytes, and is configurable. -- [#552](https://github.com/influxdata/telegraf/pull/552): Support for collection interval jittering. +- [#539](https://github.com/influxdb/telegraf/pull/539): Reload config on SIGHUP. Thanks @titilambert! +- [#522](https://github.com/influxdb/telegraf/pull/522): Phusion passenger input plugin. Thanks @kureikain! +- [#541](https://github.com/influxdb/telegraf/pull/541): Kafka output TLS cert support. Thanks @Ormod! +- [#551](https://github.com/influxdb/telegraf/pull/551): Statsd UDP read packet size now defaults to 1500 bytes, and is configurable. +- [#552](https://github.com/influxdb/telegraf/pull/552): Support for collection interval jittering. ### Bugfixes -- [#506](https://github.com/influxdata/telegraf/pull/506): Ping input doesn't return response time metric when timeout. Thanks @titilambert! -- [#508](https://github.com/influxdata/telegraf/pull/508): Fix prometheus cardinality issue with the `net` plugin -- [#499](https://github.com/influxdata/telegraf/issues/499) & [#502](https://github.com/influxdata/telegraf/issues/502): php fpm unix socket and other fixes, thanks @kureikain! -- [#543](https://github.com/influxdata/telegraf/issues/543): Statsd Packet size sometimes truncated. +- [#506](https://github.com/influxdb/telegraf/pull/506): Ping input doesn't return response time metric when timeout. Thanks @titilambert! +- [#508](https://github.com/influxdb/telegraf/pull/508): Fix prometheus cardinality issue with the `net` plugin +- [#499](https://github.com/influxdb/telegraf/issues/499) & [#502](https://github.com/influxdb/telegraf/issues/502): php fpm unix socket and other fixes, thanks @kureikain! +- [#543](https://github.com/influxdb/telegraf/issues/543): Statsd Packet size sometimes truncated. ## v0.10.0 [2016-01-12] @@ -62,29 +62,29 @@ configurations overwritten by the upgrade. There is a backup stored at ## v0.2.5 [unreleased] ### Features -- [#427](https://github.com/influxdata/telegraf/pull/427): zfs plugin: pool stats added. Thanks @allenpetersen! -- [#428](https://github.com/influxdata/telegraf/pull/428): Amazon Kinesis output. Thanks @jimmystewpot! -- [#449](https://github.com/influxdata/telegraf/pull/449): influxdb plugin, thanks @mark-rushakoff +- [#427](https://github.com/influxdb/telegraf/pull/427): zfs plugin: pool stats added. Thanks @allenpetersen! +- [#428](https://github.com/influxdb/telegraf/pull/428): Amazon Kinesis output. Thanks @jimmystewpot! +- [#449](https://github.com/influxdb/telegraf/pull/449): influxdb plugin, thanks @mark-rushakoff ### Bugfixes -- [#430](https://github.com/influxdata/telegraf/issues/430): Network statistics removed in elasticsearch 2.1. Thanks @jipperinbham! -- [#452](https://github.com/influxdata/telegraf/issues/452): Elasticsearch open file handles error. Thanks @jipperinbham! +- [#430](https://github.com/influxdb/telegraf/issues/430): Network statistics removed in elasticsearch 2.1. Thanks @jipperinbham! +- [#452](https://github.com/influxdb/telegraf/issues/452): Elasticsearch open file handles error. Thanks @jipperinbham! ## v0.2.4 [2015-12-08] ### Features -- [#412](https://github.com/influxdata/telegraf/pull/412): Additional memcached stats. Thanks @mgresser! -- [#410](https://github.com/influxdata/telegraf/pull/410): Additional redis metrics. Thanks @vlaadbrain! -- [#414](https://github.com/influxdata/telegraf/issues/414): Jolokia plugin auth parameters -- [#415](https://github.com/influxdata/telegraf/issues/415): memcached plugin: support unix sockets -- [#418](https://github.com/influxdata/telegraf/pull/418): memcached plugin additional unit tests. -- [#408](https://github.com/influxdata/telegraf/pull/408): MailChimp plugin. -- [#382](https://github.com/influxdata/telegraf/pull/382): Add system wide network protocol stats to `net` plugin. -- [#401](https://github.com/influxdata/telegraf/pull/401): Support pass/drop/tagpass/tagdrop for outputs. Thanks @oldmantaiter! +- [#412](https://github.com/influxdb/telegraf/pull/412): Additional memcached stats. Thanks @mgresser! +- [#410](https://github.com/influxdb/telegraf/pull/410): Additional redis metrics. Thanks @vlaadbrain! +- [#414](https://github.com/influxdb/telegraf/issues/414): Jolokia plugin auth parameters +- [#415](https://github.com/influxdb/telegraf/issues/415): memcached plugin: support unix sockets +- [#418](https://github.com/influxdb/telegraf/pull/418): memcached plugin additional unit tests. +- [#408](https://github.com/influxdb/telegraf/pull/408): MailChimp plugin. +- [#382](https://github.com/influxdb/telegraf/pull/382): Add system wide network protocol stats to `net` plugin. +- [#401](https://github.com/influxdb/telegraf/pull/401): Support pass/drop/tagpass/tagdrop for outputs. Thanks @oldmantaiter! ### Bugfixes -- [#405](https://github.com/influxdata/telegraf/issues/405): Prometheus output cardinality issue -- [#388](https://github.com/influxdata/telegraf/issues/388): Fix collection hangup when cpu times decrement. +- [#405](https://github.com/influxdb/telegraf/issues/405): Prometheus output cardinality issue +- [#388](https://github.com/influxdb/telegraf/issues/388): Fix collection hangup when cpu times decrement. ## v0.2.3 [2015-11-30] @@ -113,15 +113,15 @@ same type can be specified, like this: - Aerospike plugin: tag changed from `host` -> `aerospike_host` ### Features -- [#379](https://github.com/influxdata/telegraf/pull/379): Riemann output, thanks @allenj! -- [#375](https://github.com/influxdata/telegraf/pull/375): kafka_consumer service plugin. -- [#392](https://github.com/influxdata/telegraf/pull/392): Procstat plugin can now accept pgrep -f pattern, thanks @ecarreras! -- [#383](https://github.com/influxdata/telegraf/pull/383): Specify plugins as a list. -- [#354](https://github.com/influxdata/telegraf/pull/354): Add ability to specify multiple metrics in one statsd line. Thanks @MerlinDMC! +- [#379](https://github.com/influxdb/telegraf/pull/379): Riemann output, thanks @allenj! +- [#375](https://github.com/influxdb/telegraf/pull/375): kafka_consumer service plugin. +- [#392](https://github.com/influxdb/telegraf/pull/392): Procstat plugin can now accept pgrep -f pattern, thanks @ecarreras! +- [#383](https://github.com/influxdb/telegraf/pull/383): Specify plugins as a list. +- [#354](https://github.com/influxdb/telegraf/pull/354): Add ability to specify multiple metrics in one statsd line. Thanks @MerlinDMC! ### Bugfixes -- [#371](https://github.com/influxdata/telegraf/issues/371): Kafka consumer plugin not functioning. -- [#389](https://github.com/influxdata/telegraf/issues/389): NaN value panic +- [#371](https://github.com/influxdb/telegraf/issues/371): Kafka consumer plugin not functioning. +- [#389](https://github.com/influxdb/telegraf/issues/389): NaN value panic ## v0.2.2 [2015-11-18] @@ -130,7 +130,7 @@ same type can be specified, like this: lists of servers/URLs. 0.2.2 is being released solely to fix that bug ### Bugfixes -- [#377](https://github.com/influxdata/telegraf/pull/377): Fix for duplicate slices in inputs. +- [#377](https://github.com/influxdb/telegraf/pull/377): Fix for duplicate slices in inputs. ## v0.2.1 [2015-11-16] @@ -147,22 +147,22 @@ changed to just run docker commands in the Makefile. See `make docker-run` and same type. ### Features -- [#325](https://github.com/influxdata/telegraf/pull/325): NSQ output. Thanks @jrxFive! -- [#318](https://github.com/influxdata/telegraf/pull/318): Prometheus output. Thanks @oldmantaiter! -- [#338](https://github.com/influxdata/telegraf/pull/338): Restart Telegraf on package upgrade. Thanks @linsomniac! -- [#337](https://github.com/influxdata/telegraf/pull/337): Jolokia plugin, thanks @saiello! -- [#350](https://github.com/influxdata/telegraf/pull/350): Amon output. -- [#365](https://github.com/influxdata/telegraf/pull/365): Twemproxy plugin by @codeb2cc -- [#317](https://github.com/influxdata/telegraf/issues/317): ZFS plugin, thanks @cornerot! -- [#364](https://github.com/influxdata/telegraf/pull/364): Support InfluxDB UDP output. -- [#370](https://github.com/influxdata/telegraf/pull/370): Support specifying multiple outputs, as lists. -- [#372](https://github.com/influxdata/telegraf/pull/372): Remove gosigar and update go-dockerclient for FreeBSD support. Thanks @MerlinDMC! +- [#325](https://github.com/influxdb/telegraf/pull/325): NSQ output. Thanks @jrxFive! +- [#318](https://github.com/influxdb/telegraf/pull/318): Prometheus output. Thanks @oldmantaiter! +- [#338](https://github.com/influxdb/telegraf/pull/338): Restart Telegraf on package upgrade. Thanks @linsomniac! +- [#337](https://github.com/influxdb/telegraf/pull/337): Jolokia plugin, thanks @saiello! +- [#350](https://github.com/influxdb/telegraf/pull/350): Amon output. +- [#365](https://github.com/influxdb/telegraf/pull/365): Twemproxy plugin by @codeb2cc +- [#317](https://github.com/influxdb/telegraf/issues/317): ZFS plugin, thanks @cornerot! +- [#364](https://github.com/influxdb/telegraf/pull/364): Support InfluxDB UDP output. +- [#370](https://github.com/influxdb/telegraf/pull/370): Support specifying multiple outputs, as lists. +- [#372](https://github.com/influxdb/telegraf/pull/372): Remove gosigar and update go-dockerclient for FreeBSD support. Thanks @MerlinDMC! ### Bugfixes -- [#331](https://github.com/influxdata/telegraf/pull/331): Dont overwrite host tag in redis plugin. -- [#336](https://github.com/influxdata/telegraf/pull/336): Mongodb plugin should take 2 measurements. -- [#351](https://github.com/influxdata/telegraf/issues/317): Fix continual "CREATE DATABASE" in writes -- [#360](https://github.com/influxdata/telegraf/pull/360): Apply prefix before ShouldPass check. Thanks @sotfo! +- [#331](https://github.com/influxdb/telegraf/pull/331): Dont overwrite host tag in redis plugin. +- [#336](https://github.com/influxdb/telegraf/pull/336): Mongodb plugin should take 2 measurements. +- [#351](https://github.com/influxdb/telegraf/issues/317): Fix continual "CREATE DATABASE" in writes +- [#360](https://github.com/influxdb/telegraf/pull/360): Apply prefix before ShouldPass check. Thanks @sotfo! ## v0.2.0 [2015-10-27] @@ -183,38 +183,38 @@ be controlled via the `round_interval` and `flush_jitter` config options. - Telegraf will now retry metric flushes twice ### Features -- [#205](https://github.com/influxdata/telegraf/issues/205): Include per-db redis keyspace info -- [#226](https://github.com/influxdata/telegraf/pull/226): Add timestamps to points in Kafka/AMQP outputs. Thanks @ekini -- [#90](https://github.com/influxdata/telegraf/issues/90): Add Docker labels to tags in docker plugin -- [#223](https://github.com/influxdata/telegraf/pull/223): Add port tag to nginx plugin. Thanks @neezgee! -- [#227](https://github.com/influxdata/telegraf/pull/227): Add command intervals to exec plugin. Thanks @jpalay! -- [#241](https://github.com/influxdata/telegraf/pull/241): MQTT Output. Thanks @shirou! +- [#205](https://github.com/influxdb/telegraf/issues/205): Include per-db redis keyspace info +- [#226](https://github.com/influxdb/telegraf/pull/226): Add timestamps to points in Kafka/AMQP outputs. Thanks @ekini +- [#90](https://github.com/influxdb/telegraf/issues/90): Add Docker labels to tags in docker plugin +- [#223](https://github.com/influxdb/telegraf/pull/223): Add port tag to nginx plugin. Thanks @neezgee! +- [#227](https://github.com/influxdb/telegraf/pull/227): Add command intervals to exec plugin. Thanks @jpalay! +- [#241](https://github.com/influxdb/telegraf/pull/241): MQTT Output. Thanks @shirou! - Memory plugin: cached and buffered measurements re-added - Logging: additional logging for each collection interval, track the number of metrics collected and from how many inputs. -- [#240](https://github.com/influxdata/telegraf/pull/240): procstat plugin, thanks @ranjib! -- [#244](https://github.com/influxdata/telegraf/pull/244): netstat plugin, thanks @shirou! -- [#262](https://github.com/influxdata/telegraf/pull/262): zookeeper plugin, thanks @jrxFive! -- [#237](https://github.com/influxdata/telegraf/pull/237): statsd service plugin, thanks @sparrc -- [#273](https://github.com/influxdata/telegraf/pull/273): puppet agent plugin, thats @jrxFive! -- [#280](https://github.com/influxdata/telegraf/issues/280): Use InfluxDB client v2. -- [#281](https://github.com/influxdata/telegraf/issues/281): Eliminate need to deep copy Batch Points. -- [#286](https://github.com/influxdata/telegraf/issues/286): bcache plugin, thanks @cornerot! -- [#287](https://github.com/influxdata/telegraf/issues/287): Batch AMQP output, thanks @ekini! -- [#301](https://github.com/influxdata/telegraf/issues/301): Collect on even intervals -- [#298](https://github.com/influxdata/telegraf/pull/298): Support retrying output writes -- [#300](https://github.com/influxdata/telegraf/issues/300): aerospike plugin. Thanks @oldmantaiter! -- [#322](https://github.com/influxdata/telegraf/issues/322): Librato output. Thanks @jipperinbham! +- [#240](https://github.com/influxdb/telegraf/pull/240): procstat plugin, thanks @ranjib! +- [#244](https://github.com/influxdb/telegraf/pull/244): netstat plugin, thanks @shirou! +- [#262](https://github.com/influxdb/telegraf/pull/262): zookeeper plugin, thanks @jrxFive! +- [#237](https://github.com/influxdb/telegraf/pull/237): statsd service plugin, thanks @sparrc +- [#273](https://github.com/influxdb/telegraf/pull/273): puppet agent plugin, thats @jrxFive! +- [#280](https://github.com/influxdb/telegraf/issues/280): Use InfluxDB client v2. +- [#281](https://github.com/influxdb/telegraf/issues/281): Eliminate need to deep copy Batch Points. +- [#286](https://github.com/influxdb/telegraf/issues/286): bcache plugin, thanks @cornerot! +- [#287](https://github.com/influxdb/telegraf/issues/287): Batch AMQP output, thanks @ekini! +- [#301](https://github.com/influxdb/telegraf/issues/301): Collect on even intervals +- [#298](https://github.com/influxdb/telegraf/pull/298): Support retrying output writes +- [#300](https://github.com/influxdb/telegraf/issues/300): aerospike plugin. Thanks @oldmantaiter! +- [#322](https://github.com/influxdb/telegraf/issues/322): Librato output. Thanks @jipperinbham! ### Bugfixes -- [#228](https://github.com/influxdata/telegraf/pull/228): New version of package will replace old one. Thanks @ekini! -- [#232](https://github.com/influxdata/telegraf/pull/232): Fix bashism run during deb package installation. Thanks @yankcrime! -- [#261](https://github.com/influxdata/telegraf/issues/260): RabbitMQ panics if wrong credentials given. Thanks @ekini! -- [#245](https://github.com/influxdata/telegraf/issues/245): Document Exec plugin example. Thanks @ekini! -- [#264](https://github.com/influxdata/telegraf/issues/264): logrotate config file fixes. Thanks @linsomniac! -- [#290](https://github.com/influxdata/telegraf/issues/290): Fix some plugins sending their values as strings. -- [#289](https://github.com/influxdata/telegraf/issues/289): Fix accumulator panic on nil tags. -- [#302](https://github.com/influxdata/telegraf/issues/302): Fix `[tags]` getting applied, thanks @gotyaoi! +- [#228](https://github.com/influxdb/telegraf/pull/228): New version of package will replace old one. Thanks @ekini! +- [#232](https://github.com/influxdb/telegraf/pull/232): Fix bashism run during deb package installation. Thanks @yankcrime! +- [#261](https://github.com/influxdb/telegraf/issues/260): RabbitMQ panics if wrong credentials given. Thanks @ekini! +- [#245](https://github.com/influxdb/telegraf/issues/245): Document Exec plugin example. Thanks @ekini! +- [#264](https://github.com/influxdb/telegraf/issues/264): logrotate config file fixes. Thanks @linsomniac! +- [#290](https://github.com/influxdb/telegraf/issues/290): Fix some plugins sending their values as strings. +- [#289](https://github.com/influxdb/telegraf/issues/289): Fix accumulator panic on nil tags. +- [#302](https://github.com/influxdb/telegraf/issues/302): Fix `[tags]` getting applied, thanks @gotyaoi! ## v0.1.9 [2015-09-22] @@ -240,27 +240,27 @@ have been renamed for consistency. Some measurements have also been removed from re-added in a "verbose" mode if there is demand for it. ### Features -- [#143](https://github.com/influxdata/telegraf/issues/143): InfluxDB clustering support -- [#181](https://github.com/influxdata/telegraf/issues/181): Makefile GOBIN support. Thanks @Vye! -- [#203](https://github.com/influxdata/telegraf/pull/200): AMQP output. Thanks @ekini! -- [#182](https://github.com/influxdata/telegraf/pull/182): OpenTSDB output. Thanks @rplessl! -- [#187](https://github.com/influxdata/telegraf/pull/187): Retry output sink connections on startup. -- [#220](https://github.com/influxdata/telegraf/pull/220): Add port tag to apache plugin. Thanks @neezgee! -- [#217](https://github.com/influxdata/telegraf/pull/217): Add filtering for output sinks +- [#143](https://github.com/influxdb/telegraf/issues/143): InfluxDB clustering support +- [#181](https://github.com/influxdb/telegraf/issues/181): Makefile GOBIN support. Thanks @Vye! +- [#203](https://github.com/influxdb/telegraf/pull/200): AMQP output. Thanks @ekini! +- [#182](https://github.com/influxdb/telegraf/pull/182): OpenTSDB output. Thanks @rplessl! +- [#187](https://github.com/influxdb/telegraf/pull/187): Retry output sink connections on startup. +- [#220](https://github.com/influxdb/telegraf/pull/220): Add port tag to apache plugin. Thanks @neezgee! +- [#217](https://github.com/influxdb/telegraf/pull/217): Add filtering for output sinks and filtering when specifying a config file. ### Bugfixes -- [#170](https://github.com/influxdata/telegraf/issues/170): Systemd support -- [#175](https://github.com/influxdata/telegraf/issues/175): Set write precision before gathering metrics -- [#178](https://github.com/influxdata/telegraf/issues/178): redis plugin, multiple server thread hang bug +- [#170](https://github.com/influxdb/telegraf/issues/170): Systemd support +- [#175](https://github.com/influxdb/telegraf/issues/175): Set write precision before gathering metrics +- [#178](https://github.com/influxdb/telegraf/issues/178): redis plugin, multiple server thread hang bug - Fix net plugin on darwin -- [#84](https://github.com/influxdata/telegraf/issues/84): Fix docker plugin on CentOS. Thanks @neezgee! -- [#189](https://github.com/influxdata/telegraf/pull/189): Fix mem_used_perc. Thanks @mced! -- [#192](https://github.com/influxdata/telegraf/issues/192): Increase compatibility of postgresql plugin. Now supports versions 8.1+ -- [#203](https://github.com/influxdata/telegraf/issues/203): EL5 rpm support. Thanks @ekini! -- [#206](https://github.com/influxdata/telegraf/issues/206): CPU steal/guest values wrong on linux. -- [#212](https://github.com/influxdata/telegraf/issues/212): Add hashbang to postinstall script. Thanks @ekini! -- [#212](https://github.com/influxdata/telegraf/issues/212): Fix makefile warning. Thanks @ekini! +- [#84](https://github.com/influxdb/telegraf/issues/84): Fix docker plugin on CentOS. Thanks @neezgee! +- [#189](https://github.com/influxdb/telegraf/pull/189): Fix mem_used_perc. Thanks @mced! +- [#192](https://github.com/influxdb/telegraf/issues/192): Increase compatibility of postgresql plugin. Now supports versions 8.1+ +- [#203](https://github.com/influxdb/telegraf/issues/203): EL5 rpm support. Thanks @ekini! +- [#206](https://github.com/influxdb/telegraf/issues/206): CPU steal/guest values wrong on linux. +- [#212](https://github.com/influxdb/telegraf/issues/212): Add hashbang to postinstall script. Thanks @ekini! +- [#212](https://github.com/influxdb/telegraf/issues/212): Fix makefile warning. Thanks @ekini! ## v0.1.8 [2015-09-04] @@ -269,106 +269,106 @@ and filtering when specifying a config file. - Now using Go 1.5 to build telegraf ### Features -- [#150](https://github.com/influxdata/telegraf/pull/150): Add Host Uptime metric to system plugin -- [#158](https://github.com/influxdata/telegraf/pull/158): Apache Plugin. Thanks @KPACHbIuLLIAnO4 -- [#159](https://github.com/influxdata/telegraf/pull/159): Use second precision for InfluxDB writes -- [#165](https://github.com/influxdata/telegraf/pull/165): Add additional metrics to mysql plugin. Thanks @nickscript0 -- [#162](https://github.com/influxdata/telegraf/pull/162): Write UTC by default, provide option -- [#166](https://github.com/influxdata/telegraf/pull/166): Upload binaries to S3 -- [#169](https://github.com/influxdata/telegraf/pull/169): Ping plugin +- [#150](https://github.com/influxdb/telegraf/pull/150): Add Host Uptime metric to system plugin +- [#158](https://github.com/influxdb/telegraf/pull/158): Apache Plugin. Thanks @KPACHbIuLLIAnO4 +- [#159](https://github.com/influxdb/telegraf/pull/159): Use second precision for InfluxDB writes +- [#165](https://github.com/influxdb/telegraf/pull/165): Add additional metrics to mysql plugin. Thanks @nickscript0 +- [#162](https://github.com/influxdb/telegraf/pull/162): Write UTC by default, provide option +- [#166](https://github.com/influxdb/telegraf/pull/166): Upload binaries to S3 +- [#169](https://github.com/influxdb/telegraf/pull/169): Ping plugin ### Bugfixes ## v0.1.7 [2015-08-28] ### Features -- [#38](https://github.com/influxdata/telegraf/pull/38): Kafka output producer. -- [#133](https://github.com/influxdata/telegraf/pull/133): Add plugin.Gather error logging. Thanks @nickscript0! -- [#136](https://github.com/influxdata/telegraf/issues/136): Add a -usage flag for printing usage of a single plugin. -- [#137](https://github.com/influxdata/telegraf/issues/137): Memcached: fix when a value contains a space -- [#138](https://github.com/influxdata/telegraf/issues/138): MySQL server address tag. -- [#142](https://github.com/influxdata/telegraf/pull/142): Add Description and SampleConfig funcs to output interface +- [#38](https://github.com/influxdb/telegraf/pull/38): Kafka output producer. +- [#133](https://github.com/influxdb/telegraf/pull/133): Add plugin.Gather error logging. Thanks @nickscript0! +- [#136](https://github.com/influxdb/telegraf/issues/136): Add a -usage flag for printing usage of a single plugin. +- [#137](https://github.com/influxdb/telegraf/issues/137): Memcached: fix when a value contains a space +- [#138](https://github.com/influxdb/telegraf/issues/138): MySQL server address tag. +- [#142](https://github.com/influxdb/telegraf/pull/142): Add Description and SampleConfig funcs to output interface - Indent the toml config file for readability ### Bugfixes -- [#128](https://github.com/influxdata/telegraf/issues/128): system_load measurement missing. -- [#129](https://github.com/influxdata/telegraf/issues/129): Latest pkg url fix. -- [#131](https://github.com/influxdata/telegraf/issues/131): Fix memory reporting on linux & darwin. Thanks @subhachandrachandra! -- [#140](https://github.com/influxdata/telegraf/issues/140): Memory plugin prec->perc typo fix. Thanks @brunoqc! +- [#128](https://github.com/influxdb/telegraf/issues/128): system_load measurement missing. +- [#129](https://github.com/influxdb/telegraf/issues/129): Latest pkg url fix. +- [#131](https://github.com/influxdb/telegraf/issues/131): Fix memory reporting on linux & darwin. Thanks @subhachandrachandra! +- [#140](https://github.com/influxdb/telegraf/issues/140): Memory plugin prec->perc typo fix. Thanks @brunoqc! ## v0.1.6 [2015-08-20] ### Features -- [#112](https://github.com/influxdata/telegraf/pull/112): Datadog output. Thanks @jipperinbham! -- [#116](https://github.com/influxdata/telegraf/pull/116): Use godep to vendor all dependencies -- [#120](https://github.com/influxdata/telegraf/pull/120): Httpjson plugin. Thanks @jpalay & @alvaromorales! +- [#112](https://github.com/influxdb/telegraf/pull/112): Datadog output. Thanks @jipperinbham! +- [#116](https://github.com/influxdb/telegraf/pull/116): Use godep to vendor all dependencies +- [#120](https://github.com/influxdb/telegraf/pull/120): Httpjson plugin. Thanks @jpalay & @alvaromorales! ### Bugfixes -- [#113](https://github.com/influxdata/telegraf/issues/113): Update README with Telegraf/InfluxDB compatibility -- [#118](https://github.com/influxdata/telegraf/pull/118): Fix for disk usage stats in Windows. Thanks @srfraser! -- [#122](https://github.com/influxdata/telegraf/issues/122): Fix for DiskUsage segv fault. Thanks @srfraser! -- [#126](https://github.com/influxdata/telegraf/issues/126): Nginx plugin not catching net.SplitHostPort error +- [#113](https://github.com/influxdb/telegraf/issues/113): Update README with Telegraf/InfluxDB compatibility +- [#118](https://github.com/influxdb/telegraf/pull/118): Fix for disk usage stats in Windows. Thanks @srfraser! +- [#122](https://github.com/influxdb/telegraf/issues/122): Fix for DiskUsage segv fault. Thanks @srfraser! +- [#126](https://github.com/influxdb/telegraf/issues/126): Nginx plugin not catching net.SplitHostPort error ## v0.1.5 [2015-08-13] ### Features -- [#54](https://github.com/influxdata/telegraf/pull/54): MongoDB plugin. Thanks @jipperinbham! -- [#55](https://github.com/influxdata/telegraf/pull/55): Elasticsearch plugin. Thanks @brocaar! -- [#71](https://github.com/influxdata/telegraf/pull/71): HAProxy plugin. Thanks @kureikain! -- [#72](https://github.com/influxdata/telegraf/pull/72): Adding TokuDB metrics to MySQL. Thanks vadimtk! -- [#73](https://github.com/influxdata/telegraf/pull/73): RabbitMQ plugin. Thanks @ianunruh! -- [#77](https://github.com/influxdata/telegraf/issues/77): Automatically create database. -- [#79](https://github.com/influxdata/telegraf/pull/56): Nginx plugin. Thanks @codeb2cc! -- [#86](https://github.com/influxdata/telegraf/pull/86): Lustre2 plugin. Thanks srfraser! -- [#91](https://github.com/influxdata/telegraf/pull/91): Unit testing -- [#92](https://github.com/influxdata/telegraf/pull/92): Exec plugin. Thanks @alvaromorales! -- [#98](https://github.com/influxdata/telegraf/pull/98): LeoFS plugin. Thanks @mocchira! -- [#103](https://github.com/influxdata/telegraf/pull/103): Filter by metric tags. Thanks @srfraser! -- [#106](https://github.com/influxdata/telegraf/pull/106): Options to filter plugins on startup. Thanks @zepouet! -- [#107](https://github.com/influxdata/telegraf/pull/107): Multiple outputs beyong influxdb. Thanks @jipperinbham! -- [#108](https://github.com/influxdata/telegraf/issues/108): Support setting per-CPU and total-CPU gathering. -- [#111](https://github.com/influxdata/telegraf/pull/111): Report CPU Usage in cpu plugin. Thanks @jpalay! +- [#54](https://github.com/influxdb/telegraf/pull/54): MongoDB plugin. Thanks @jipperinbham! +- [#55](https://github.com/influxdb/telegraf/pull/55): Elasticsearch plugin. Thanks @brocaar! +- [#71](https://github.com/influxdb/telegraf/pull/71): HAProxy plugin. Thanks @kureikain! +- [#72](https://github.com/influxdb/telegraf/pull/72): Adding TokuDB metrics to MySQL. Thanks vadimtk! +- [#73](https://github.com/influxdb/telegraf/pull/73): RabbitMQ plugin. Thanks @ianunruh! +- [#77](https://github.com/influxdb/telegraf/issues/77): Automatically create database. +- [#79](https://github.com/influxdb/telegraf/pull/56): Nginx plugin. Thanks @codeb2cc! +- [#86](https://github.com/influxdb/telegraf/pull/86): Lustre2 plugin. Thanks srfraser! +- [#91](https://github.com/influxdb/telegraf/pull/91): Unit testing +- [#92](https://github.com/influxdb/telegraf/pull/92): Exec plugin. Thanks @alvaromorales! +- [#98](https://github.com/influxdb/telegraf/pull/98): LeoFS plugin. Thanks @mocchira! +- [#103](https://github.com/influxdb/telegraf/pull/103): Filter by metric tags. Thanks @srfraser! +- [#106](https://github.com/influxdb/telegraf/pull/106): Options to filter plugins on startup. Thanks @zepouet! +- [#107](https://github.com/influxdb/telegraf/pull/107): Multiple outputs beyong influxdb. Thanks @jipperinbham! +- [#108](https://github.com/influxdb/telegraf/issues/108): Support setting per-CPU and total-CPU gathering. +- [#111](https://github.com/influxdb/telegraf/pull/111): Report CPU Usage in cpu plugin. Thanks @jpalay! ### Bugfixes -- [#85](https://github.com/influxdata/telegraf/pull/85): Fix GetLocalHost testutil function for mac users -- [#89](https://github.com/influxdata/telegraf/pull/89): go fmt fixes -- [#94](https://github.com/influxdata/telegraf/pull/94): Fix for issue #93, explicitly call sarama.v1 -> sarama -- [#101](https://github.com/influxdata/telegraf/issues/101): switch back from master branch if building locally -- [#99](https://github.com/influxdata/telegraf/issues/99): update integer output to new InfluxDB line protocol format +- [#85](https://github.com/influxdb/telegraf/pull/85): Fix GetLocalHost testutil function for mac users +- [#89](https://github.com/influxdb/telegraf/pull/89): go fmt fixes +- [#94](https://github.com/influxdb/telegraf/pull/94): Fix for issue #93, explicitly call sarama.v1 -> sarama +- [#101](https://github.com/influxdb/telegraf/issues/101): switch back from master branch if building locally +- [#99](https://github.com/influxdb/telegraf/issues/99): update integer output to new InfluxDB line protocol format ## v0.1.4 [2015-07-09] ### Features -- [#56](https://github.com/influxdata/telegraf/pull/56): Update README for Kafka plugin. Thanks @EmilS! +- [#56](https://github.com/influxdb/telegraf/pull/56): Update README for Kafka plugin. Thanks @EmilS! ### Bugfixes -- [#50](https://github.com/influxdata/telegraf/pull/50): Fix init.sh script to use telegraf directory. Thanks @jseriff! -- [#52](https://github.com/influxdata/telegraf/pull/52): Update CHANGELOG to reference updated directory. Thanks @benfb! +- [#50](https://github.com/influxdb/telegraf/pull/50): Fix init.sh script to use telegraf directory. Thanks @jseriff! +- [#52](https://github.com/influxdb/telegraf/pull/52): Update CHANGELOG to reference updated directory. Thanks @benfb! ## v0.1.3 [2015-07-05] ### Features -- [#35](https://github.com/influxdata/telegraf/pull/35): Add Kafka plugin. Thanks @EmilS! -- [#47](https://github.com/influxdata/telegraf/pull/47): Add RethinkDB plugin. Thanks @jipperinbham! +- [#35](https://github.com/influxdb/telegraf/pull/35): Add Kafka plugin. Thanks @EmilS! +- [#47](https://github.com/influxdb/telegraf/pull/47): Add RethinkDB plugin. Thanks @jipperinbham! ### Bugfixes -- [#45](https://github.com/influxdata/telegraf/pull/45): Skip disk tags that don't have a value. Thanks @jhofeditz! -- [#43](https://github.com/influxdata/telegraf/pull/43): Fix bug in MySQL plugin. Thanks @marcosnils! +- [#45](https://github.com/influxdb/telegraf/pull/45): Skip disk tags that don't have a value. Thanks @jhofeditz! +- [#43](https://github.com/influxdb/telegraf/pull/43): Fix bug in MySQL plugin. Thanks @marcosnils! ## v0.1.2 [2015-07-01] ### Features -- [#12](https://github.com/influxdata/telegraf/pull/12): Add Linux/ARM to the list of built binaries. Thanks @voxxit! -- [#14](https://github.com/influxdata/telegraf/pull/14): Clarify the S3 buckets that Telegraf is pushed to. -- [#16](https://github.com/influxdata/telegraf/pull/16): Convert Redis to use URI, support Redis AUTH. Thanks @jipperinbham! -- [#21](https://github.com/influxdata/telegraf/pull/21): Add memcached plugin. Thanks @Yukki! +- [#12](https://github.com/influxdb/telegraf/pull/12): Add Linux/ARM to the list of built binaries. Thanks @voxxit! +- [#14](https://github.com/influxdb/telegraf/pull/14): Clarify the S3 buckets that Telegraf is pushed to. +- [#16](https://github.com/influxdb/telegraf/pull/16): Convert Redis to use URI, support Redis AUTH. Thanks @jipperinbham! +- [#21](https://github.com/influxdb/telegraf/pull/21): Add memcached plugin. Thanks @Yukki! ### Bugfixes -- [#13](https://github.com/influxdata/telegraf/pull/13): Fix the packaging script. -- [#19](https://github.com/influxdata/telegraf/pull/19): Add host name to metric tags. Thanks @sherifzain! -- [#20](https://github.com/influxdata/telegraf/pull/20): Fix race condition with accumulator mutex. Thanks @nkatsaros! -- [#23](https://github.com/influxdata/telegraf/pull/23): Change name of folder for packages. Thanks @colinrymer! -- [#32](https://github.com/influxdata/telegraf/pull/32): Fix spelling of memoory -> memory. Thanks @tylernisonoff! +- [#13](https://github.com/influxdb/telegraf/pull/13): Fix the packaging script. +- [#19](https://github.com/influxdb/telegraf/pull/19): Add host name to metric tags. Thanks @sherifzain! +- [#20](https://github.com/influxdb/telegraf/pull/20): Fix race condition with accumulator mutex. Thanks @nkatsaros! +- [#23](https://github.com/influxdb/telegraf/pull/23): Change name of folder for packages. Thanks @colinrymer! +- [#32](https://github.com/influxdb/telegraf/pull/32): Fix spelling of memoory -> memory. Thanks @tylernisonoff! ## v0.1.1 [2015-06-19] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dfe6a77f4..a47ad2f17 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ and submit new inputs. * Input Plugins should call `inputs.Add` in their `init` function to register themselves. See below for a quick example. * Input Plugins must be added to the -`github.com/influxdata/telegraf/plugins/inputs/all/all.go` file. +`github.com/influxdb/telegraf/plugins/inputs/all/all.go` file. * The `SampleConfig` function should return valid toml that describes how the plugin can be configured. This is include in `telegraf -sample-config`. * The `Description` function should say in one line what this plugin does. @@ -75,7 +75,7 @@ package simple // simple.go -import "github.com/influxdata/telegraf/plugins/inputs" +import "github.com/influxdb/telegraf/plugins/inputs" type Simple struct { Ok bool @@ -147,7 +147,7 @@ similar constructs. * Outputs should call `outputs.Add` in their `init` function to register themselves. See below for a quick example. * To be available within Telegraf itself, plugins must add themselves to the -`github.com/influxdata/telegraf/plugins/outputs/all/all.go` file. +`github.com/influxdb/telegraf/plugins/outputs/all/all.go` file. * The `SampleConfig` function should return valid toml that describes how the output can be configured. This is include in `telegraf -sample-config`. * The `Description` function should say in one line what this output does. @@ -171,7 +171,7 @@ package simpleoutput // simpleoutput.go -import "github.com/influxdata/telegraf/plugins/outputs" +import "github.com/influxdb/telegraf/plugins/outputs" type Simple struct { Ok bool @@ -252,7 +252,7 @@ which would take some time to replicate. To overcome this situation we've decided to use docker containers to provide a fast and reproducible environment to test those services which require it. For other situations -(i.e: https://github.com/influxdata/telegraf/blob/master/plugins/redis/redis_test.go) +(i.e: https://github.com/influxdb/telegraf/blob/master/plugins/redis/redis_test.go) a simple mock will suffice. To execute Telegraf tests follow these simple steps: diff --git a/Godeps b/Godeps index c62d6feda..f719539f5 100644 --- a/Godeps +++ b/Godeps @@ -22,7 +22,7 @@ github.com/hailocab/go-hostpool 50839ee41f32bfca8d03a183031aa634b2dc1c64 github.com/hashicorp/go-msgpack fa3f63826f7c23912c15263591e65d54d080b458 github.com/hashicorp/raft b95f335efee1992886864389183ebda0c0a5d0f6 github.com/hashicorp/raft-boltdb d1e82c1ec3f15ee991f7cc7ffd5b67ff6f5bbaee -github.com/influxdata/influxdb 0e0f85a0c1fd1788ae4f9145531b02c539cfa5b5 +github.com/influxdb/influxdb 0e0f85a0c1fd1788ae4f9145531b02c539cfa5b5 github.com/jmespath/go-jmespath c01cf91b011868172fdcd9f41838e80c9d716264 github.com/klauspost/crc32 999f3125931f6557b991b2f8472172bdfa578d38 github.com/lib/pq 8ad2b298cadd691a77015666a5372eae5dbfac8f diff --git a/README.md b/README.md index 5a997d363..ab31c35e9 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Telegraf is an agent written in Go for collecting metrics from the system it's running on, or from other services, and writing them into InfluxDB or other -[outputs](https://github.com/influxdata/telegraf#supported-output-plugins). +[outputs](https://github.com/influxdb/telegraf#supported-output-plugins). Design goals are to have a minimal memory footprint with a plugin system so that developers in the community can easily add support for collecting metrics @@ -77,8 +77,8 @@ if you don't have it already. You also must build with golang version 1.5+. 1. [Install Go](https://golang.org/doc/install) 2. [Setup your GOPATH](https://golang.org/doc/code.html#GOPATH) -3. Run `go get github.com/influxdata/telegraf` -4. Run `cd $GOPATH/src/github.com/influxdata/telegraf` +3. Run `go get github.com/influxdb/telegraf` +4. Run `cd $GOPATH/src/github.com/influxdb/telegraf` 5. Run `make` ### How to use it: diff --git a/accumulator.go b/accumulator.go index c628907d7..429f3a42c 100644 --- a/accumulator.go +++ b/accumulator.go @@ -7,9 +7,9 @@ import ( "sync" "time" - "github.com/influxdata/telegraf/internal/config" + "github.com/influxdb/telegraf/internal/config" - "github.com/influxdata/influxdb/client/v2" + "github.com/influxdb/influxdb/client/v2" ) type Accumulator interface { diff --git a/agent.go b/agent.go index 772c1c27e..25b157c54 100644 --- a/agent.go +++ b/agent.go @@ -10,11 +10,11 @@ import ( "sync" "time" - "github.com/influxdata/telegraf/internal/config" - "github.com/influxdata/telegraf/plugins/inputs" - "github.com/influxdata/telegraf/plugins/outputs" + "github.com/influxdb/telegraf/internal/config" + "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/outputs" - "github.com/influxdata/influxdb/client/v2" + "github.com/influxdb/influxdb/client/v2" ) // Agent runs telegraf and collects data based on the given config diff --git a/agent_test.go b/agent_test.go index 3420e665a..1cb020c7b 100644 --- a/agent_test.go +++ b/agent_test.go @@ -5,12 +5,12 @@ import ( "testing" "time" - "github.com/influxdata/telegraf/internal/config" + "github.com/influxdb/telegraf/internal/config" // needing to load the plugins - _ "github.com/influxdata/telegraf/plugins/inputs/all" + _ "github.com/influxdb/telegraf/plugins/inputs/all" // needing to load the outputs - _ "github.com/influxdata/telegraf/plugins/outputs/all" + _ "github.com/influxdb/telegraf/plugins/outputs/all" ) func TestAgent_LoadPlugin(t *testing.T) { diff --git a/build.py b/build.py index a5892f26a..565a6904d 100755 --- a/build.py +++ b/build.py @@ -39,7 +39,7 @@ PREINST_SCRIPT = "scripts/pre-install.sh" # META-PACKAGE VARIABLES PACKAGE_LICENSE = "MIT" -PACKAGE_URL = "https://github.com/influxdata/telegraf" +PACKAGE_URL = "https://github.com/influxdb/telegraf" MAINTAINER = "support@influxdb.com" VENDOR = "InfluxData" DESCRIPTION = "Plugin-driven server agent for reporting metrics into InfluxDB." diff --git a/cmd/telegraf/telegraf.go b/cmd/telegraf/telegraf.go index 72fb9fdcf..554569012 100644 --- a/cmd/telegraf/telegraf.go +++ b/cmd/telegraf/telegraf.go @@ -9,10 +9,10 @@ import ( "strings" "syscall" - "github.com/influxdata/telegraf" - "github.com/influxdata/telegraf/internal/config" - _ "github.com/influxdata/telegraf/plugins/inputs/all" - _ "github.com/influxdata/telegraf/plugins/outputs/all" + "github.com/influxdb/telegraf" + "github.com/influxdb/telegraf/internal/config" + _ "github.com/influxdb/telegraf/plugins/inputs/all" + _ "github.com/influxdb/telegraf/plugins/outputs/all" ) var fDebug = flag.Bool("debug", false, diff --git a/internal/config/config.go b/internal/config/config.go index 3b5e4ff17..e4d7fbc9d 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -10,14 +10,14 @@ import ( "strings" "time" - "github.com/influxdata/telegraf/internal" - "github.com/influxdata/telegraf/plugins/inputs" - "github.com/influxdata/telegraf/plugins/outputs" + "github.com/influxdb/telegraf/internal" + "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/outputs" "github.com/naoina/toml" "github.com/naoina/toml/ast" - "github.com/influxdata/influxdb/client/v2" + "github.com/influxdb/influxdb/client/v2" ) // Config specifies the URL/user/password for the database that telegraf diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 40af30c1e..c8ed79bdf 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -4,10 +4,10 @@ import ( "testing" "time" - "github.com/influxdata/telegraf/plugins/inputs" - "github.com/influxdata/telegraf/plugins/inputs/exec" - "github.com/influxdata/telegraf/plugins/inputs/memcached" - "github.com/influxdata/telegraf/plugins/inputs/procstat" + "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs/exec" + "github.com/influxdb/telegraf/plugins/inputs/memcached" + "github.com/influxdb/telegraf/plugins/inputs/procstat" "github.com/stretchr/testify/assert" ) diff --git a/plugins/inputs/aerospike/aerospike.go b/plugins/inputs/aerospike/aerospike.go index aa015a4c0..5f847ebfa 100644 --- a/plugins/inputs/aerospike/aerospike.go +++ b/plugins/inputs/aerospike/aerospike.go @@ -4,7 +4,7 @@ import ( "bytes" "encoding/binary" "fmt" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" "net" "strconv" "strings" diff --git a/plugins/inputs/aerospike/aerospike_test.go b/plugins/inputs/aerospike/aerospike_test.go index 74b70eb1d..3f4d909a2 100644 --- a/plugins/inputs/aerospike/aerospike_test.go +++ b/plugins/inputs/aerospike/aerospike_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/all/all.go b/plugins/inputs/all/all.go index f2643aef8..fc0cbe0eb 100644 --- a/plugins/inputs/all/all.go +++ b/plugins/inputs/all/all.go @@ -1,41 +1,41 @@ package all import ( - _ "github.com/influxdata/telegraf/plugins/inputs/aerospike" - _ "github.com/influxdata/telegraf/plugins/inputs/apache" - _ "github.com/influxdata/telegraf/plugins/inputs/bcache" - _ "github.com/influxdata/telegraf/plugins/inputs/disque" - _ "github.com/influxdata/telegraf/plugins/inputs/elasticsearch" - _ "github.com/influxdata/telegraf/plugins/inputs/exec" - _ "github.com/influxdata/telegraf/plugins/inputs/ghwebhooks" - _ "github.com/influxdata/telegraf/plugins/inputs/haproxy" - _ "github.com/influxdata/telegraf/plugins/inputs/httpjson" - _ "github.com/influxdata/telegraf/plugins/inputs/influxdb" - _ "github.com/influxdata/telegraf/plugins/inputs/jolokia" - _ "github.com/influxdata/telegraf/plugins/inputs/kafka_consumer" - _ "github.com/influxdata/telegraf/plugins/inputs/leofs" - _ "github.com/influxdata/telegraf/plugins/inputs/lustre2" - _ "github.com/influxdata/telegraf/plugins/inputs/mailchimp" - _ "github.com/influxdata/telegraf/plugins/inputs/memcached" - _ "github.com/influxdata/telegraf/plugins/inputs/mongodb" - _ "github.com/influxdata/telegraf/plugins/inputs/mysql" - _ "github.com/influxdata/telegraf/plugins/inputs/nginx" - _ "github.com/influxdata/telegraf/plugins/inputs/nsq" - _ "github.com/influxdata/telegraf/plugins/inputs/passenger" - _ "github.com/influxdata/telegraf/plugins/inputs/phpfpm" - _ "github.com/influxdata/telegraf/plugins/inputs/ping" - _ "github.com/influxdata/telegraf/plugins/inputs/postgresql" - _ "github.com/influxdata/telegraf/plugins/inputs/procstat" - _ "github.com/influxdata/telegraf/plugins/inputs/prometheus" - _ "github.com/influxdata/telegraf/plugins/inputs/puppetagent" - _ "github.com/influxdata/telegraf/plugins/inputs/rabbitmq" - _ "github.com/influxdata/telegraf/plugins/inputs/redis" - _ "github.com/influxdata/telegraf/plugins/inputs/rethinkdb" - _ "github.com/influxdata/telegraf/plugins/inputs/sensors" - _ "github.com/influxdata/telegraf/plugins/inputs/statsd" - _ "github.com/influxdata/telegraf/plugins/inputs/system" - _ "github.com/influxdata/telegraf/plugins/inputs/trig" - _ "github.com/influxdata/telegraf/plugins/inputs/twemproxy" - _ "github.com/influxdata/telegraf/plugins/inputs/zfs" - _ "github.com/influxdata/telegraf/plugins/inputs/zookeeper" + _ "github.com/influxdb/telegraf/plugins/inputs/aerospike" + _ "github.com/influxdb/telegraf/plugins/inputs/apache" + _ "github.com/influxdb/telegraf/plugins/inputs/bcache" + _ "github.com/influxdb/telegraf/plugins/inputs/disque" + _ "github.com/influxdb/telegraf/plugins/inputs/elasticsearch" + _ "github.com/influxdb/telegraf/plugins/inputs/exec" + _ "github.com/influxdb/telegraf/plugins/inputs/ghwebhooks" + _ "github.com/influxdb/telegraf/plugins/inputs/haproxy" + _ "github.com/influxdb/telegraf/plugins/inputs/httpjson" + _ "github.com/influxdb/telegraf/plugins/inputs/influxdb" + _ "github.com/influxdb/telegraf/plugins/inputs/jolokia" + _ "github.com/influxdb/telegraf/plugins/inputs/kafka_consumer" + _ "github.com/influxdb/telegraf/plugins/inputs/leofs" + _ "github.com/influxdb/telegraf/plugins/inputs/lustre2" + _ "github.com/influxdb/telegraf/plugins/inputs/mailchimp" + _ "github.com/influxdb/telegraf/plugins/inputs/memcached" + _ "github.com/influxdb/telegraf/plugins/inputs/mongodb" + _ "github.com/influxdb/telegraf/plugins/inputs/mysql" + _ "github.com/influxdb/telegraf/plugins/inputs/nginx" + _ "github.com/influxdb/telegraf/plugins/inputs/nsq" + _ "github.com/influxdb/telegraf/plugins/inputs/passenger" + _ "github.com/influxdb/telegraf/plugins/inputs/phpfpm" + _ "github.com/influxdb/telegraf/plugins/inputs/ping" + _ "github.com/influxdb/telegraf/plugins/inputs/postgresql" + _ "github.com/influxdb/telegraf/plugins/inputs/procstat" + _ "github.com/influxdb/telegraf/plugins/inputs/prometheus" + _ "github.com/influxdb/telegraf/plugins/inputs/puppetagent" + _ "github.com/influxdb/telegraf/plugins/inputs/rabbitmq" + _ "github.com/influxdb/telegraf/plugins/inputs/redis" + _ "github.com/influxdb/telegraf/plugins/inputs/rethinkdb" + _ "github.com/influxdb/telegraf/plugins/inputs/sensors" + _ "github.com/influxdb/telegraf/plugins/inputs/statsd" + _ "github.com/influxdb/telegraf/plugins/inputs/system" + _ "github.com/influxdb/telegraf/plugins/inputs/trig" + _ "github.com/influxdb/telegraf/plugins/inputs/twemproxy" + _ "github.com/influxdb/telegraf/plugins/inputs/zfs" + _ "github.com/influxdb/telegraf/plugins/inputs/zookeeper" ) diff --git a/plugins/inputs/apache/apache.go b/plugins/inputs/apache/apache.go index 317a635d3..f48bac336 100644 --- a/plugins/inputs/apache/apache.go +++ b/plugins/inputs/apache/apache.go @@ -11,7 +11,7 @@ import ( "sync" "time" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type Apache struct { diff --git a/plugins/inputs/apache/apache_test.go b/plugins/inputs/apache/apache_test.go index 8eed61ca6..16c319974 100644 --- a/plugins/inputs/apache/apache_test.go +++ b/plugins/inputs/apache/apache_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/bcache/bcache.go b/plugins/inputs/bcache/bcache.go index b6d6eb130..146849eef 100644 --- a/plugins/inputs/bcache/bcache.go +++ b/plugins/inputs/bcache/bcache.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type Bcache struct { diff --git a/plugins/inputs/bcache/bcache_test.go b/plugins/inputs/bcache/bcache_test.go index bd191528f..0f34d016b 100644 --- a/plugins/inputs/bcache/bcache_test.go +++ b/plugins/inputs/bcache/bcache_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/disque/disque.go b/plugins/inputs/disque/disque.go index 364e78fbc..334fdd554 100644 --- a/plugins/inputs/disque/disque.go +++ b/plugins/inputs/disque/disque.go @@ -10,7 +10,7 @@ import ( "strings" "sync" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type Disque struct { diff --git a/plugins/inputs/disque/disque_test.go b/plugins/inputs/disque/disque_test.go index f060e9568..91c7dc979 100644 --- a/plugins/inputs/disque/disque_test.go +++ b/plugins/inputs/disque/disque_test.go @@ -6,7 +6,7 @@ import ( "net" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/elasticsearch/elasticsearch.go b/plugins/inputs/elasticsearch/elasticsearch.go index 9b59537c0..f8185a053 100644 --- a/plugins/inputs/elasticsearch/elasticsearch.go +++ b/plugins/inputs/elasticsearch/elasticsearch.go @@ -6,8 +6,8 @@ import ( "net/http" "time" - "github.com/influxdata/telegraf/internal" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/internal" + "github.com/influxdb/telegraf/plugins/inputs" ) const statsPath = "/_nodes/stats" diff --git a/plugins/inputs/elasticsearch/elasticsearch_test.go b/plugins/inputs/elasticsearch/elasticsearch_test.go index f94d3f9ac..62c3cb8fd 100644 --- a/plugins/inputs/elasticsearch/elasticsearch_test.go +++ b/plugins/inputs/elasticsearch/elasticsearch_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/exec/exec.go b/plugins/inputs/exec/exec.go index 603ba1464..b3c1001f8 100644 --- a/plugins/inputs/exec/exec.go +++ b/plugins/inputs/exec/exec.go @@ -8,8 +8,8 @@ import ( "github.com/gonuts/go-shellquote" - "github.com/influxdata/telegraf/internal" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/internal" + "github.com/influxdb/telegraf/plugins/inputs" ) const sampleConfig = ` diff --git a/plugins/inputs/exec/exec_test.go b/plugins/inputs/exec/exec_test.go index 8bf47c1d0..64fd69fce 100644 --- a/plugins/inputs/exec/exec_test.go +++ b/plugins/inputs/exec/exec_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/ghwebhooks/ghwebhooks.go b/plugins/inputs/ghwebhooks/ghwebhooks.go index 3ff3842ef..836a6ee40 100644 --- a/plugins/inputs/ghwebhooks/ghwebhooks.go +++ b/plugins/inputs/ghwebhooks/ghwebhooks.go @@ -9,8 +9,8 @@ import ( "sync" "github.com/gorilla/mux" - mod "github.com/influxdata/support-tools/ghWebhooks/models" - "github.com/influxdata/telegraf/plugins/inputs" + mod "github.com/influxdb/support-tools/ghWebhooks/models" + "github.com/influxdb/telegraf/plugins/inputs" ) func init() { diff --git a/plugins/inputs/ghwebhooks/ghwebhooks_test.go b/plugins/inputs/ghwebhooks/ghwebhooks_test.go index 028715aeb..ea26f95b1 100644 --- a/plugins/inputs/ghwebhooks/ghwebhooks_test.go +++ b/plugins/inputs/ghwebhooks/ghwebhooks_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - mod "github.com/influxdata/telegraf/plugins/inputs/ghwebhooks/models" + mod "github.com/influxdb/telegraf/plugins/inputs/ghwebhooks/models" ) func TestCommitCommentEvent(t *testing.T) { diff --git a/plugins/inputs/ghwebhooks/models/models.go b/plugins/inputs/ghwebhooks/models/models.go index 3e512c9fe..5781c1917 100644 --- a/plugins/inputs/ghwebhooks/models/models.go +++ b/plugins/inputs/ghwebhooks/models/models.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/influxdata/influxdb/client/v2" + "github.com/influxdb/influxdb/client/v2" ) const meas = "ghWebhooks" diff --git a/plugins/inputs/haproxy/haproxy.go b/plugins/inputs/haproxy/haproxy.go index c2e334424..23b92fc26 100644 --- a/plugins/inputs/haproxy/haproxy.go +++ b/plugins/inputs/haproxy/haproxy.go @@ -3,7 +3,7 @@ package haproxy import ( "encoding/csv" "fmt" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" "io" "net/http" "net/url" diff --git a/plugins/inputs/haproxy/haproxy_test.go b/plugins/inputs/haproxy/haproxy_test.go index 7b86f2b50..e514bc7ad 100644 --- a/plugins/inputs/haproxy/haproxy_test.go +++ b/plugins/inputs/haproxy/haproxy_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "net/http" diff --git a/plugins/inputs/httpjson/httpjson.go b/plugins/inputs/httpjson/httpjson.go index b90a02e5b..5763fd6fa 100644 --- a/plugins/inputs/httpjson/httpjson.go +++ b/plugins/inputs/httpjson/httpjson.go @@ -11,8 +11,8 @@ import ( "sync" "time" - "github.com/influxdata/telegraf/internal" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/internal" + "github.com/influxdb/telegraf/plugins/inputs" ) type HttpJson struct { diff --git a/plugins/inputs/httpjson/httpjson_test.go b/plugins/inputs/httpjson/httpjson_test.go index 0ea5e9e42..3f14290ff 100644 --- a/plugins/inputs/httpjson/httpjson_test.go +++ b/plugins/inputs/httpjson/httpjson_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/influxdb/influxdb.go b/plugins/inputs/influxdb/influxdb.go index e65c8afd2..cf5742e1d 100644 --- a/plugins/inputs/influxdb/influxdb.go +++ b/plugins/inputs/influxdb/influxdb.go @@ -8,7 +8,7 @@ import ( "strings" "sync" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type InfluxDB struct { diff --git a/plugins/inputs/influxdb/influxdb_test.go b/plugins/inputs/influxdb/influxdb_test.go index e7b43e7bc..0e02cc6bd 100644 --- a/plugins/inputs/influxdb/influxdb_test.go +++ b/plugins/inputs/influxdb/influxdb_test.go @@ -5,8 +5,8 @@ import ( "net/http/httptest" "testing" - "github.com/influxdata/telegraf/plugins/inputs/influxdb" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/plugins/inputs/influxdb" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/jolokia/jolokia.go b/plugins/inputs/jolokia/jolokia.go index 7579ecb4a..36811bd27 100644 --- a/plugins/inputs/jolokia/jolokia.go +++ b/plugins/inputs/jolokia/jolokia.go @@ -8,7 +8,7 @@ import ( "net/http" "net/url" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type Server struct { diff --git a/plugins/inputs/jolokia/jolokia_test.go b/plugins/inputs/jolokia/jolokia_test.go index 63b47ebff..d29b8a810 100644 --- a/plugins/inputs/jolokia/jolokia_test.go +++ b/plugins/inputs/jolokia/jolokia_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" _ "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/kafka_consumer/kafka_consumer.go b/plugins/inputs/kafka_consumer/kafka_consumer.go index a0f1d3d11..f3558e2e5 100644 --- a/plugins/inputs/kafka_consumer/kafka_consumer.go +++ b/plugins/inputs/kafka_consumer/kafka_consumer.go @@ -5,8 +5,8 @@ import ( "strings" "sync" - "github.com/influxdata/influxdb/models" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/influxdb/models" + "github.com/influxdb/telegraf/plugins/inputs" "github.com/Shopify/sarama" "github.com/wvanbergen/kafka/consumergroup" diff --git a/plugins/inputs/kafka_consumer/kafka_consumer_integration_test.go b/plugins/inputs/kafka_consumer/kafka_consumer_integration_test.go index 0611467ff..9f554d9ab 100644 --- a/plugins/inputs/kafka_consumer/kafka_consumer_integration_test.go +++ b/plugins/inputs/kafka_consumer/kafka_consumer_integration_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/Shopify/sarama" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/kafka_consumer/kafka_consumer_test.go b/plugins/inputs/kafka_consumer/kafka_consumer_test.go index 560e130c0..dcd38f6c4 100644 --- a/plugins/inputs/kafka_consumer/kafka_consumer_test.go +++ b/plugins/inputs/kafka_consumer/kafka_consumer_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/influxdata/influxdb/models" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/influxdb/models" + "github.com/influxdb/telegraf/testutil" "github.com/Shopify/sarama" "github.com/stretchr/testify/assert" diff --git a/plugins/inputs/leofs/leofs.go b/plugins/inputs/leofs/leofs.go index f4dd314b7..c65db5f37 100644 --- a/plugins/inputs/leofs/leofs.go +++ b/plugins/inputs/leofs/leofs.go @@ -3,7 +3,7 @@ package leofs import ( "bufio" "fmt" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" "net/url" "os/exec" "strconv" diff --git a/plugins/inputs/leofs/leofs_test.go b/plugins/inputs/leofs/leofs_test.go index 292cd15d0..48a82a18a 100644 --- a/plugins/inputs/leofs/leofs_test.go +++ b/plugins/inputs/leofs/leofs_test.go @@ -1,7 +1,7 @@ package leofs import ( - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "io/ioutil" diff --git a/plugins/inputs/lustre2/lustre2.go b/plugins/inputs/lustre2/lustre2.go index d6266de73..90222af79 100644 --- a/plugins/inputs/lustre2/lustre2.go +++ b/plugins/inputs/lustre2/lustre2.go @@ -13,8 +13,8 @@ import ( "strconv" "strings" - "github.com/influxdata/telegraf/internal" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/internal" + "github.com/influxdb/telegraf/plugins/inputs" ) // Lustre proc files can change between versions, so we want to future-proof diff --git a/plugins/inputs/lustre2/lustre2_test.go b/plugins/inputs/lustre2/lustre2_test.go index 9e560df2c..cea98fa1e 100644 --- a/plugins/inputs/lustre2/lustre2_test.go +++ b/plugins/inputs/lustre2/lustre2_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/mailchimp/mailchimp.go b/plugins/inputs/mailchimp/mailchimp.go index 284ac61e1..4b148a95c 100644 --- a/plugins/inputs/mailchimp/mailchimp.go +++ b/plugins/inputs/mailchimp/mailchimp.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type MailChimp struct { diff --git a/plugins/inputs/mailchimp/mailchimp_test.go b/plugins/inputs/mailchimp/mailchimp_test.go index 0c4dab56d..5e5394581 100644 --- a/plugins/inputs/mailchimp/mailchimp_test.go +++ b/plugins/inputs/mailchimp/mailchimp_test.go @@ -7,7 +7,7 @@ import ( "net/url" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/memcached/memcached.go b/plugins/inputs/memcached/memcached.go index 078f05aa3..1d9ee9547 100644 --- a/plugins/inputs/memcached/memcached.go +++ b/plugins/inputs/memcached/memcached.go @@ -8,7 +8,7 @@ import ( "strconv" "time" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) // Memcached is a memcached plugin diff --git a/plugins/inputs/memcached/memcached_test.go b/plugins/inputs/memcached/memcached_test.go index 210adffdb..6e2f8452a 100644 --- a/plugins/inputs/memcached/memcached_test.go +++ b/plugins/inputs/memcached/memcached_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/mongodb/mongodb.go b/plugins/inputs/mongodb/mongodb.go index ce73c3a14..4cb3ffee5 100644 --- a/plugins/inputs/mongodb/mongodb.go +++ b/plugins/inputs/mongodb/mongodb.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" "gopkg.in/mgo.v2" ) diff --git a/plugins/inputs/mongodb/mongodb_data.go b/plugins/inputs/mongodb/mongodb_data.go index c0c68c330..15f8c479b 100644 --- a/plugins/inputs/mongodb/mongodb_data.go +++ b/plugins/inputs/mongodb/mongodb_data.go @@ -5,7 +5,7 @@ import ( "reflect" "strconv" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type MongodbData struct { diff --git a/plugins/inputs/mongodb/mongodb_data_test.go b/plugins/inputs/mongodb/mongodb_data_test.go index 3166ab018..5d24a7a09 100644 --- a/plugins/inputs/mongodb/mongodb_data_test.go +++ b/plugins/inputs/mongodb/mongodb_data_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" ) diff --git a/plugins/inputs/mongodb/mongodb_server.go b/plugins/inputs/mongodb/mongodb_server.go index 87552f906..795cf97d7 100644 --- a/plugins/inputs/mongodb/mongodb_server.go +++ b/plugins/inputs/mongodb/mongodb_server.go @@ -4,7 +4,7 @@ import ( "net/url" "time" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" ) diff --git a/plugins/inputs/mongodb/mongodb_server_test.go b/plugins/inputs/mongodb/mongodb_server_test.go index 52869724c..ec536bbef 100644 --- a/plugins/inputs/mongodb/mongodb_server_test.go +++ b/plugins/inputs/mongodb/mongodb_server_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/mysql/mysql.go b/plugins/inputs/mysql/mysql.go index 7434a282a..f9126b5ea 100644 --- a/plugins/inputs/mysql/mysql.go +++ b/plugins/inputs/mysql/mysql.go @@ -6,7 +6,7 @@ import ( "strings" _ "github.com/go-sql-driver/mysql" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type Mysql struct { diff --git a/plugins/inputs/mysql/mysql_test.go b/plugins/inputs/mysql/mysql_test.go index 855e8ba52..2362002bc 100644 --- a/plugins/inputs/mysql/mysql_test.go +++ b/plugins/inputs/mysql/mysql_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/nginx/nginx.go b/plugins/inputs/nginx/nginx.go index 6ea665b7e..18e3244f7 100644 --- a/plugins/inputs/nginx/nginx.go +++ b/plugins/inputs/nginx/nginx.go @@ -11,7 +11,7 @@ import ( "sync" "time" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type Nginx struct { diff --git a/plugins/inputs/nginx/nginx_test.go b/plugins/inputs/nginx/nginx_test.go index 895e3e583..9d694bc26 100644 --- a/plugins/inputs/nginx/nginx_test.go +++ b/plugins/inputs/nginx/nginx_test.go @@ -8,7 +8,7 @@ import ( "net/url" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/nsq/nsq.go b/plugins/inputs/nsq/nsq.go index 9b680a0db..48a709a37 100644 --- a/plugins/inputs/nsq/nsq.go +++ b/plugins/inputs/nsq/nsq.go @@ -31,7 +31,7 @@ import ( "sync" "time" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) // Might add Lookupd endpoints for cluster discovery diff --git a/plugins/inputs/nsq/nsq_test.go b/plugins/inputs/nsq/nsq_test.go index 23fd19a42..fc34a710b 100644 --- a/plugins/inputs/nsq/nsq_test.go +++ b/plugins/inputs/nsq/nsq_test.go @@ -7,7 +7,7 @@ import ( "net/url" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/passenger/passenger.go b/plugins/inputs/passenger/passenger.go index c5b049b7c..2d98f8c58 100644 --- a/plugins/inputs/passenger/passenger.go +++ b/plugins/inputs/passenger/passenger.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" "golang.org/x/net/html/charset" ) diff --git a/plugins/inputs/passenger/passenger_test.go b/plugins/inputs/passenger/passenger_test.go index 6124a968e..3440c5337 100644 --- a/plugins/inputs/passenger/passenger_test.go +++ b/plugins/inputs/passenger/passenger_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/phpfpm/phpfpm.go b/plugins/inputs/phpfpm/phpfpm.go index 0166f7bea..5600334b2 100644 --- a/plugins/inputs/phpfpm/phpfpm.go +++ b/plugins/inputs/phpfpm/phpfpm.go @@ -12,7 +12,7 @@ import ( "strings" "sync" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) const ( diff --git a/plugins/inputs/phpfpm/phpfpm_test.go b/plugins/inputs/phpfpm/phpfpm_test.go index c965e5a13..58db0cf8b 100644 --- a/plugins/inputs/phpfpm/phpfpm_test.go +++ b/plugins/inputs/phpfpm/phpfpm_test.go @@ -10,7 +10,7 @@ import ( "net/http/httptest" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/ping/ping.go b/plugins/inputs/ping/ping.go index aa1d5bf36..ff7cebb99 100644 --- a/plugins/inputs/ping/ping.go +++ b/plugins/inputs/ping/ping.go @@ -7,7 +7,7 @@ import ( "strings" "sync" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) // HostPinger is a function that runs the "ping" function using a list of diff --git a/plugins/inputs/ping/ping_test.go b/plugins/inputs/ping/ping_test.go index be603a49c..b98a08be8 100644 --- a/plugins/inputs/ping/ping_test.go +++ b/plugins/inputs/ping/ping_test.go @@ -6,7 +6,7 @@ import ( "sort" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" ) diff --git a/plugins/inputs/postgresql/postgresql.go b/plugins/inputs/postgresql/postgresql.go index 3398f5ac0..c356cea77 100644 --- a/plugins/inputs/postgresql/postgresql.go +++ b/plugins/inputs/postgresql/postgresql.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" _ "github.com/lib/pq" ) diff --git a/plugins/inputs/postgresql/postgresql_test.go b/plugins/inputs/postgresql/postgresql_test.go index 8baae39a6..0f4ff5579 100644 --- a/plugins/inputs/postgresql/postgresql_test.go +++ b/plugins/inputs/postgresql/postgresql_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/procstat/procstat.go b/plugins/inputs/procstat/procstat.go index 99d7573fc..5e596d6d8 100644 --- a/plugins/inputs/procstat/procstat.go +++ b/plugins/inputs/procstat/procstat.go @@ -10,7 +10,7 @@ import ( "github.com/shirou/gopsutil/process" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type Procstat struct { diff --git a/plugins/inputs/procstat/procstat_test.go b/plugins/inputs/procstat/procstat_test.go index e5f081372..6ec6834ca 100644 --- a/plugins/inputs/procstat/procstat_test.go +++ b/plugins/inputs/procstat/procstat_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" ) func TestGather(t *testing.T) { diff --git a/plugins/inputs/procstat/spec_processor.go b/plugins/inputs/procstat/spec_processor.go index 052c57a75..9c7e53826 100644 --- a/plugins/inputs/procstat/spec_processor.go +++ b/plugins/inputs/procstat/spec_processor.go @@ -6,7 +6,7 @@ import ( "github.com/shirou/gopsutil/process" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type SpecProcessor struct { diff --git a/plugins/inputs/prometheus/prometheus.go b/plugins/inputs/prometheus/prometheus.go index e6374b8d6..758788b8d 100644 --- a/plugins/inputs/prometheus/prometheus.go +++ b/plugins/inputs/prometheus/prometheus.go @@ -3,7 +3,7 @@ package prometheus import ( "errors" "fmt" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" "github.com/prometheus/common/expfmt" "github.com/prometheus/common/model" "io" diff --git a/plugins/inputs/prometheus/prometheus_test.go b/plugins/inputs/prometheus/prometheus_test.go index 2009cbb11..901fe2da2 100644 --- a/plugins/inputs/prometheus/prometheus_test.go +++ b/plugins/inputs/prometheus/prometheus_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/puppetagent/puppetagent.go b/plugins/inputs/puppetagent/puppetagent.go index eee9186b3..d0bedae9e 100644 --- a/plugins/inputs/puppetagent/puppetagent.go +++ b/plugins/inputs/puppetagent/puppetagent.go @@ -8,7 +8,7 @@ import ( "reflect" "strings" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) // PuppetAgent is a PuppetAgent plugin diff --git a/plugins/inputs/puppetagent/puppetagent_test.go b/plugins/inputs/puppetagent/puppetagent_test.go index d1470bc27..1d854ab46 100644 --- a/plugins/inputs/puppetagent/puppetagent_test.go +++ b/plugins/inputs/puppetagent/puppetagent_test.go @@ -1,7 +1,7 @@ package puppetagent import ( - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "testing" ) diff --git a/plugins/inputs/rabbitmq/rabbitmq.go b/plugins/inputs/rabbitmq/rabbitmq.go index c062b3164..fc95af494 100644 --- a/plugins/inputs/rabbitmq/rabbitmq.go +++ b/plugins/inputs/rabbitmq/rabbitmq.go @@ -7,7 +7,7 @@ import ( "strconv" "time" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) const DefaultUsername = "guest" diff --git a/plugins/inputs/rabbitmq/rabbitmq_test.go b/plugins/inputs/rabbitmq/rabbitmq_test.go index 4bdc980db..12b7aee70 100644 --- a/plugins/inputs/rabbitmq/rabbitmq_test.go +++ b/plugins/inputs/rabbitmq/rabbitmq_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/redis/redis.go b/plugins/inputs/redis/redis.go index 735aa2052..c9e98e886 100644 --- a/plugins/inputs/redis/redis.go +++ b/plugins/inputs/redis/redis.go @@ -10,7 +10,7 @@ import ( "strings" "sync" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type Redis struct { diff --git a/plugins/inputs/redis/redis_test.go b/plugins/inputs/redis/redis_test.go index 612595cdb..ec0cf998c 100644 --- a/plugins/inputs/redis/redis_test.go +++ b/plugins/inputs/redis/redis_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/rethinkdb/rethinkdb.go b/plugins/inputs/rethinkdb/rethinkdb.go index 1f28dab25..17873f1ce 100644 --- a/plugins/inputs/rethinkdb/rethinkdb.go +++ b/plugins/inputs/rethinkdb/rethinkdb.go @@ -5,7 +5,7 @@ import ( "net/url" "sync" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" "gopkg.in/dancannon/gorethink.v1" ) diff --git a/plugins/inputs/rethinkdb/rethinkdb_data.go b/plugins/inputs/rethinkdb/rethinkdb_data.go index 8093fa5ba..3ea429d82 100644 --- a/plugins/inputs/rethinkdb/rethinkdb_data.go +++ b/plugins/inputs/rethinkdb/rethinkdb_data.go @@ -4,7 +4,7 @@ import ( "reflect" "time" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type serverStatus struct { diff --git a/plugins/inputs/rethinkdb/rethinkdb_data_test.go b/plugins/inputs/rethinkdb/rethinkdb_data_test.go index 6159016c0..3441370a3 100644 --- a/plugins/inputs/rethinkdb/rethinkdb_data_test.go +++ b/plugins/inputs/rethinkdb/rethinkdb_data_test.go @@ -3,7 +3,7 @@ package rethinkdb import ( "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" ) diff --git a/plugins/inputs/rethinkdb/rethinkdb_server.go b/plugins/inputs/rethinkdb/rethinkdb_server.go index 6ca7a3af1..4af916a4d 100644 --- a/plugins/inputs/rethinkdb/rethinkdb_server.go +++ b/plugins/inputs/rethinkdb/rethinkdb_server.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" "gopkg.in/dancannon/gorethink.v1" ) diff --git a/plugins/inputs/rethinkdb/rethinkdb_server_test.go b/plugins/inputs/rethinkdb/rethinkdb_server_test.go index c4b644222..21ab0dbbd 100644 --- a/plugins/inputs/rethinkdb/rethinkdb_server_test.go +++ b/plugins/inputs/rethinkdb/rethinkdb_server_test.go @@ -5,7 +5,7 @@ package rethinkdb import ( "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/sensors/sensors.go b/plugins/inputs/sensors/sensors.go index 81001abd8..18e26278d 100644 --- a/plugins/inputs/sensors/sensors.go +++ b/plugins/inputs/sensors/sensors.go @@ -7,7 +7,7 @@ import ( "github.com/md14454/gosensors" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type Sensors struct { diff --git a/plugins/inputs/statsd/README.md b/plugins/inputs/statsd/README.md index 49b8ff842..76255f3b0 100644 --- a/plugins/inputs/statsd/README.md +++ b/plugins/inputs/statsd/README.md @@ -157,4 +157,4 @@ mem.cached.localhost:256|g ``` There are many more options available, -[More details can be found here](https://github.com/influxdata/influxdb/tree/master/services/graphite#templates) +[More details can be found here](https://github.com/influxdb/influxdb/tree/master/services/graphite#templates) diff --git a/plugins/inputs/statsd/statsd.go b/plugins/inputs/statsd/statsd.go index 1fac4aba0..d9f597bcf 100644 --- a/plugins/inputs/statsd/statsd.go +++ b/plugins/inputs/statsd/statsd.go @@ -10,9 +10,9 @@ import ( "strings" "sync" - "github.com/influxdata/influxdb/services/graphite" + "github.com/influxdb/influxdb/services/graphite" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) const UDP_PACKET_SIZE int = 1500 diff --git a/plugins/inputs/statsd/statsd_test.go b/plugins/inputs/statsd/statsd_test.go index 6fc1f6933..a8aae2e9e 100644 --- a/plugins/inputs/statsd/statsd_test.go +++ b/plugins/inputs/statsd/statsd_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" ) // Invalid lines should return an error diff --git a/plugins/inputs/system/cpu.go b/plugins/inputs/system/cpu.go index 95c854b2c..298df20bb 100644 --- a/plugins/inputs/system/cpu.go +++ b/plugins/inputs/system/cpu.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" "github.com/shirou/gopsutil/cpu" ) diff --git a/plugins/inputs/system/cpu_test.go b/plugins/inputs/system/cpu_test.go index 77d90e2a5..c85734adc 100644 --- a/plugins/inputs/system/cpu_test.go +++ b/plugins/inputs/system/cpu_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/shirou/gopsutil/cpu" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/plugins/inputs/system/disk.go b/plugins/inputs/system/disk.go index 6a792e7dd..5d1553dd4 100644 --- a/plugins/inputs/system/disk.go +++ b/plugins/inputs/system/disk.go @@ -3,7 +3,7 @@ package system import ( "fmt" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type DiskStats struct { diff --git a/plugins/inputs/system/disk_test.go b/plugins/inputs/system/disk_test.go index f59c0b7d6..6ea110fef 100644 --- a/plugins/inputs/system/disk_test.go +++ b/plugins/inputs/system/disk_test.go @@ -3,7 +3,7 @@ package system import ( "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/shirou/gopsutil/disk" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/plugins/inputs/system/docker.go b/plugins/inputs/system/docker.go index 4f60c771e..3a77fad5f 100644 --- a/plugins/inputs/system/docker.go +++ b/plugins/inputs/system/docker.go @@ -5,7 +5,7 @@ package system import ( "fmt" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type DockerStats struct { diff --git a/plugins/inputs/system/docker_test.go b/plugins/inputs/system/docker_test.go index 6f680d8be..9ed06dd3e 100644 --- a/plugins/inputs/system/docker_test.go +++ b/plugins/inputs/system/docker_test.go @@ -5,7 +5,7 @@ package system import ( "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/shirou/gopsutil/cpu" "github.com/shirou/gopsutil/docker" diff --git a/plugins/inputs/system/memory.go b/plugins/inputs/system/memory.go index 32a2f2b09..f58a8cd92 100644 --- a/plugins/inputs/system/memory.go +++ b/plugins/inputs/system/memory.go @@ -3,7 +3,7 @@ package system import ( "fmt" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type MemStats struct { diff --git a/plugins/inputs/system/memory_test.go b/plugins/inputs/system/memory_test.go index 0a85bc869..bf461e2e2 100644 --- a/plugins/inputs/system/memory_test.go +++ b/plugins/inputs/system/memory_test.go @@ -3,7 +3,7 @@ package system import ( "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/shirou/gopsutil/mem" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/system/net.go b/plugins/inputs/system/net.go index 7f71f5200..42f0d5854 100644 --- a/plugins/inputs/system/net.go +++ b/plugins/inputs/system/net.go @@ -5,7 +5,7 @@ import ( "net" "strings" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type NetIOStats struct { diff --git a/plugins/inputs/system/net_test.go b/plugins/inputs/system/net_test.go index 3297acf07..3ec2cb990 100644 --- a/plugins/inputs/system/net_test.go +++ b/plugins/inputs/system/net_test.go @@ -4,7 +4,7 @@ import ( "syscall" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/shirou/gopsutil/net" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/system/netstat.go b/plugins/inputs/system/netstat.go index 0fe704ee0..71f2a0da6 100644 --- a/plugins/inputs/system/netstat.go +++ b/plugins/inputs/system/netstat.go @@ -4,7 +4,7 @@ import ( "fmt" "syscall" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type NetStats struct { diff --git a/plugins/inputs/system/ps.go b/plugins/inputs/system/ps.go index 0bdb7eb94..966747718 100644 --- a/plugins/inputs/system/ps.go +++ b/plugins/inputs/system/ps.go @@ -5,8 +5,8 @@ import ( "os" "strings" - "github.com/influxdata/telegraf/internal" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/internal" + "github.com/influxdb/telegraf/plugins/inputs" dc "github.com/fsouza/go-dockerclient" "github.com/shirou/gopsutil/cpu" diff --git a/plugins/inputs/system/system.go b/plugins/inputs/system/system.go index 4a0a76d48..813ab84f5 100644 --- a/plugins/inputs/system/system.go +++ b/plugins/inputs/system/system.go @@ -8,7 +8,7 @@ import ( "github.com/shirou/gopsutil/host" "github.com/shirou/gopsutil/load" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type SystemStats struct{} diff --git a/plugins/inputs/trig/trig.go b/plugins/inputs/trig/trig.go index 604f9734a..13c44e247 100644 --- a/plugins/inputs/trig/trig.go +++ b/plugins/inputs/trig/trig.go @@ -3,7 +3,7 @@ package trig import ( "math" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type Trig struct { diff --git a/plugins/inputs/trig/trig_test.go b/plugins/inputs/trig/trig_test.go index 1471edbea..82605b0a5 100644 --- a/plugins/inputs/trig/trig_test.go +++ b/plugins/inputs/trig/trig_test.go @@ -4,7 +4,7 @@ import ( "math" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" ) func TestTrig(t *testing.T) { diff --git a/plugins/inputs/twemproxy/twemproxy.go b/plugins/inputs/twemproxy/twemproxy.go index 6dcce8058..95c9d0ba0 100644 --- a/plugins/inputs/twemproxy/twemproxy.go +++ b/plugins/inputs/twemproxy/twemproxy.go @@ -7,7 +7,7 @@ import ( "net" "time" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) type Twemproxy struct { diff --git a/plugins/inputs/twemproxy/twemproxy_test.go b/plugins/inputs/twemproxy/twemproxy_test.go index dd79048e0..60209d1a1 100644 --- a/plugins/inputs/twemproxy/twemproxy_test.go +++ b/plugins/inputs/twemproxy/twemproxy_test.go @@ -5,7 +5,7 @@ import ( "net" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/zfs/zfs.go b/plugins/inputs/zfs/zfs.go index 13f2d9806..109b261f8 100644 --- a/plugins/inputs/zfs/zfs.go +++ b/plugins/inputs/zfs/zfs.go @@ -6,8 +6,8 @@ import ( "strconv" "strings" - "github.com/influxdata/telegraf/internal" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/internal" + "github.com/influxdb/telegraf/plugins/inputs" ) type Zfs struct { diff --git a/plugins/inputs/zfs/zfs_test.go b/plugins/inputs/zfs/zfs_test.go index e40d91c02..9530084d0 100644 --- a/plugins/inputs/zfs/zfs_test.go +++ b/plugins/inputs/zfs/zfs_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/inputs/zookeeper/zookeeper.go b/plugins/inputs/zookeeper/zookeeper.go index c2940f5e3..93a07840d 100644 --- a/plugins/inputs/zookeeper/zookeeper.go +++ b/plugins/inputs/zookeeper/zookeeper.go @@ -10,7 +10,7 @@ import ( "strings" "time" - "github.com/influxdata/telegraf/plugins/inputs" + "github.com/influxdb/telegraf/plugins/inputs" ) // Zookeeper is a zookeeper plugin diff --git a/plugins/inputs/zookeeper/zookeeper_test.go b/plugins/inputs/zookeeper/zookeeper_test.go index bc02ffb9d..354382ecc 100644 --- a/plugins/inputs/zookeeper/zookeeper_test.go +++ b/plugins/inputs/zookeeper/zookeeper_test.go @@ -3,7 +3,7 @@ package zookeeper import ( "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/outputs/all/all.go b/plugins/outputs/all/all.go index e05d53acc..7eedb592a 100644 --- a/plugins/outputs/all/all.go +++ b/plugins/outputs/all/all.go @@ -1,17 +1,17 @@ package all import ( - _ "github.com/influxdata/telegraf/plugins/outputs/amon" - _ "github.com/influxdata/telegraf/plugins/outputs/amqp" - _ "github.com/influxdata/telegraf/plugins/outputs/datadog" - _ "github.com/influxdata/telegraf/plugins/outputs/graphite" - _ "github.com/influxdata/telegraf/plugins/outputs/influxdb" - _ "github.com/influxdata/telegraf/plugins/outputs/kafka" - _ "github.com/influxdata/telegraf/plugins/outputs/kinesis" - _ "github.com/influxdata/telegraf/plugins/outputs/librato" - _ "github.com/influxdata/telegraf/plugins/outputs/mqtt" - _ "github.com/influxdata/telegraf/plugins/outputs/nsq" - _ "github.com/influxdata/telegraf/plugins/outputs/opentsdb" - _ "github.com/influxdata/telegraf/plugins/outputs/prometheus_client" - _ "github.com/influxdata/telegraf/plugins/outputs/riemann" + _ "github.com/influxdb/telegraf/plugins/outputs/amon" + _ "github.com/influxdb/telegraf/plugins/outputs/amqp" + _ "github.com/influxdb/telegraf/plugins/outputs/datadog" + _ "github.com/influxdb/telegraf/plugins/outputs/graphite" + _ "github.com/influxdb/telegraf/plugins/outputs/influxdb" + _ "github.com/influxdb/telegraf/plugins/outputs/kafka" + _ "github.com/influxdb/telegraf/plugins/outputs/kinesis" + _ "github.com/influxdb/telegraf/plugins/outputs/librato" + _ "github.com/influxdb/telegraf/plugins/outputs/mqtt" + _ "github.com/influxdb/telegraf/plugins/outputs/nsq" + _ "github.com/influxdb/telegraf/plugins/outputs/opentsdb" + _ "github.com/influxdb/telegraf/plugins/outputs/prometheus_client" + _ "github.com/influxdb/telegraf/plugins/outputs/riemann" ) diff --git a/plugins/outputs/amon/amon.go b/plugins/outputs/amon/amon.go index e9f2c9f30..d8fceb035 100644 --- a/plugins/outputs/amon/amon.go +++ b/plugins/outputs/amon/amon.go @@ -8,9 +8,9 @@ import ( "net/http" "strings" - "github.com/influxdata/influxdb/client/v2" - "github.com/influxdata/telegraf/internal" - "github.com/influxdata/telegraf/plugins/outputs" + "github.com/influxdb/influxdb/client/v2" + "github.com/influxdb/telegraf/internal" + "github.com/influxdb/telegraf/plugins/outputs" ) type Amon struct { diff --git a/plugins/outputs/amon/amon_test.go b/plugins/outputs/amon/amon_test.go index b725bab9e..cfe4e9f23 100644 --- a/plugins/outputs/amon/amon_test.go +++ b/plugins/outputs/amon/amon_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" - "github.com/influxdata/influxdb/client/v2" + "github.com/influxdb/influxdb/client/v2" ) func TestBuildPoint(t *testing.T) { diff --git a/plugins/outputs/amqp/amqp.go b/plugins/outputs/amqp/amqp.go index bdbf47b86..e1d6302a1 100644 --- a/plugins/outputs/amqp/amqp.go +++ b/plugins/outputs/amqp/amqp.go @@ -10,8 +10,8 @@ import ( "sync" "time" - "github.com/influxdata/influxdb/client/v2" - "github.com/influxdata/telegraf/plugins/outputs" + "github.com/influxdb/influxdb/client/v2" + "github.com/influxdb/telegraf/plugins/outputs" "github.com/streadway/amqp" ) diff --git a/plugins/outputs/amqp/amqp_test.go b/plugins/outputs/amqp/amqp_test.go index a65634cab..4c6a9a8d3 100644 --- a/plugins/outputs/amqp/amqp_test.go +++ b/plugins/outputs/amqp/amqp_test.go @@ -3,7 +3,7 @@ package amqp import ( "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/outputs/datadog/datadog.go b/plugins/outputs/datadog/datadog.go index 7d6539789..4231b1f28 100644 --- a/plugins/outputs/datadog/datadog.go +++ b/plugins/outputs/datadog/datadog.go @@ -10,9 +10,9 @@ import ( "sort" "strings" - "github.com/influxdata/influxdb/client/v2" - "github.com/influxdata/telegraf/internal" - "github.com/influxdata/telegraf/plugins/outputs" + "github.com/influxdb/influxdb/client/v2" + "github.com/influxdb/telegraf/internal" + "github.com/influxdb/telegraf/plugins/outputs" ) type Datadog struct { diff --git a/plugins/outputs/datadog/datadog_test.go b/plugins/outputs/datadog/datadog_test.go index 968a8e9c8..fe0b7c1fe 100644 --- a/plugins/outputs/datadog/datadog_test.go +++ b/plugins/outputs/datadog/datadog_test.go @@ -9,9 +9,9 @@ import ( "testing" "time" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" - "github.com/influxdata/influxdb/client/v2" + "github.com/influxdb/influxdb/client/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/outputs/graphite/graphite.go b/plugins/outputs/graphite/graphite.go index f9781041f..dd2af8eb1 100644 --- a/plugins/outputs/graphite/graphite.go +++ b/plugins/outputs/graphite/graphite.go @@ -3,8 +3,8 @@ package graphite import ( "errors" "fmt" - "github.com/influxdata/influxdb/client/v2" - "github.com/influxdata/telegraf/plugins/outputs" + "github.com/influxdb/influxdb/client/v2" + "github.com/influxdb/telegraf/plugins/outputs" "log" "math/rand" "net" diff --git a/plugins/outputs/graphite/graphite_test.go b/plugins/outputs/graphite/graphite_test.go index be4cc2472..e9000c3c7 100644 --- a/plugins/outputs/graphite/graphite_test.go +++ b/plugins/outputs/graphite/graphite_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/influxdata/influxdb/client/v2" + "github.com/influxdb/influxdb/client/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/plugins/outputs/influxdb/influxdb.go b/plugins/outputs/influxdb/influxdb.go index f45f020b6..f6b79b009 100644 --- a/plugins/outputs/influxdb/influxdb.go +++ b/plugins/outputs/influxdb/influxdb.go @@ -9,9 +9,9 @@ import ( "strings" "time" - "github.com/influxdata/influxdb/client/v2" - "github.com/influxdata/telegraf/internal" - "github.com/influxdata/telegraf/plugins/outputs" + "github.com/influxdb/influxdb/client/v2" + "github.com/influxdb/telegraf/internal" + "github.com/influxdb/telegraf/plugins/outputs" ) type InfluxDB struct { diff --git a/plugins/outputs/influxdb/influxdb_test.go b/plugins/outputs/influxdb/influxdb_test.go index 5da0c056f..cf1d7d9b3 100644 --- a/plugins/outputs/influxdb/influxdb_test.go +++ b/plugins/outputs/influxdb/influxdb_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/outputs/kafka/kafka.go b/plugins/outputs/kafka/kafka.go index b16347c92..55ef35fb4 100644 --- a/plugins/outputs/kafka/kafka.go +++ b/plugins/outputs/kafka/kafka.go @@ -6,8 +6,8 @@ import ( "errors" "fmt" "github.com/Shopify/sarama" - "github.com/influxdata/influxdb/client/v2" - "github.com/influxdata/telegraf/plugins/outputs" + "github.com/influxdb/influxdb/client/v2" + "github.com/influxdb/telegraf/plugins/outputs" "io/ioutil" ) diff --git a/plugins/outputs/kafka/kafka_test.go b/plugins/outputs/kafka/kafka_test.go index 2af343778..2c1734857 100644 --- a/plugins/outputs/kafka/kafka_test.go +++ b/plugins/outputs/kafka/kafka_test.go @@ -3,7 +3,7 @@ package kafka import ( "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/outputs/kinesis/kinesis.go b/plugins/outputs/kinesis/kinesis.go index f04f1c7c6..11e26fdf9 100644 --- a/plugins/outputs/kinesis/kinesis.go +++ b/plugins/outputs/kinesis/kinesis.go @@ -15,8 +15,8 @@ import ( "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kinesis" - "github.com/influxdata/influxdb/client/v2" - "github.com/influxdata/telegraf/plugins/outputs" + "github.com/influxdb/influxdb/client/v2" + "github.com/influxdb/telegraf/plugins/outputs" ) type KinesisOutput struct { diff --git a/plugins/outputs/kinesis/kinesis_test.go b/plugins/outputs/kinesis/kinesis_test.go index 76eb6ebca..4c667c860 100644 --- a/plugins/outputs/kinesis/kinesis_test.go +++ b/plugins/outputs/kinesis/kinesis_test.go @@ -1,7 +1,7 @@ package kinesis import ( - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" "testing" ) diff --git a/plugins/outputs/librato/librato.go b/plugins/outputs/librato/librato.go index 6afcb4542..75aecb756 100644 --- a/plugins/outputs/librato/librato.go +++ b/plugins/outputs/librato/librato.go @@ -7,9 +7,9 @@ import ( "log" "net/http" - "github.com/influxdata/influxdb/client/v2" - "github.com/influxdata/telegraf/internal" - "github.com/influxdata/telegraf/plugins/outputs" + "github.com/influxdb/influxdb/client/v2" + "github.com/influxdb/telegraf/internal" + "github.com/influxdb/telegraf/plugins/outputs" ) type Librato struct { diff --git a/plugins/outputs/librato/librato_test.go b/plugins/outputs/librato/librato_test.go index 25418baa5..129352027 100644 --- a/plugins/outputs/librato/librato_test.go +++ b/plugins/outputs/librato/librato_test.go @@ -9,9 +9,9 @@ import ( "testing" "time" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" - "github.com/influxdata/influxdb/client/v2" + "github.com/influxdb/influxdb/client/v2" "github.com/stretchr/testify/require" ) diff --git a/plugins/outputs/mqtt/mqtt.go b/plugins/outputs/mqtt/mqtt.go index 7c47cf741..a70b2e575 100644 --- a/plugins/outputs/mqtt/mqtt.go +++ b/plugins/outputs/mqtt/mqtt.go @@ -10,9 +10,9 @@ import ( "sync" paho "git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.golang.git" - "github.com/influxdata/influxdb/client/v2" - "github.com/influxdata/telegraf/internal" - "github.com/influxdata/telegraf/plugins/outputs" + "github.com/influxdb/influxdb/client/v2" + "github.com/influxdb/telegraf/internal" + "github.com/influxdb/telegraf/plugins/outputs" ) const MaxClientIdLen = 8 diff --git a/plugins/outputs/mqtt/mqtt_test.go b/plugins/outputs/mqtt/mqtt_test.go index f25f4497f..0922b83ed 100644 --- a/plugins/outputs/mqtt/mqtt_test.go +++ b/plugins/outputs/mqtt/mqtt_test.go @@ -3,7 +3,7 @@ package mqtt import ( "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/outputs/nsq/nsq.go b/plugins/outputs/nsq/nsq.go index 79818ec5c..db58670a2 100644 --- a/plugins/outputs/nsq/nsq.go +++ b/plugins/outputs/nsq/nsq.go @@ -2,8 +2,8 @@ package nsq import ( "fmt" - "github.com/influxdata/influxdb/client/v2" - "github.com/influxdata/telegraf/plugins/outputs" + "github.com/influxdb/influxdb/client/v2" + "github.com/influxdb/telegraf/plugins/outputs" "github.com/nsqio/go-nsq" ) diff --git a/plugins/outputs/nsq/nsq_test.go b/plugins/outputs/nsq/nsq_test.go index b2d703a70..4448383f4 100644 --- a/plugins/outputs/nsq/nsq_test.go +++ b/plugins/outputs/nsq/nsq_test.go @@ -3,7 +3,7 @@ package nsq import ( "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/outputs/opentsdb/opentsdb.go b/plugins/outputs/opentsdb/opentsdb.go index 6e9f3e26a..236385d71 100644 --- a/plugins/outputs/opentsdb/opentsdb.go +++ b/plugins/outputs/opentsdb/opentsdb.go @@ -8,8 +8,8 @@ import ( "strings" "time" - "github.com/influxdata/influxdb/client/v2" - "github.com/influxdata/telegraf/plugins/outputs" + "github.com/influxdb/influxdb/client/v2" + "github.com/influxdb/telegraf/plugins/outputs" ) type OpenTSDB struct { diff --git a/plugins/outputs/opentsdb/opentsdb_test.go b/plugins/outputs/opentsdb/opentsdb_test.go index 92df3fb52..f75bd7205 100644 --- a/plugins/outputs/opentsdb/opentsdb_test.go +++ b/plugins/outputs/opentsdb/opentsdb_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/plugins/outputs/prometheus_client/prometheus_client.go b/plugins/outputs/prometheus_client/prometheus_client.go index 4e429722a..1fbf9056a 100644 --- a/plugins/outputs/prometheus_client/prometheus_client.go +++ b/plugins/outputs/prometheus_client/prometheus_client.go @@ -5,8 +5,8 @@ import ( "log" "net/http" - "github.com/influxdata/influxdb/client/v2" - "github.com/influxdata/telegraf/plugins/outputs" + "github.com/influxdb/influxdb/client/v2" + "github.com/influxdb/telegraf/plugins/outputs" "github.com/prometheus/client_golang/prometheus" ) diff --git a/plugins/outputs/prometheus_client/prometheus_client_test.go b/plugins/outputs/prometheus_client/prometheus_client_test.go index 73163ee1d..dc353486c 100644 --- a/plugins/outputs/prometheus_client/prometheus_client_test.go +++ b/plugins/outputs/prometheus_client/prometheus_client_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/influxdata/influxdb/client/v2" - "github.com/influxdata/telegraf/plugins/inputs/prometheus" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/influxdb/client/v2" + "github.com/influxdb/telegraf/plugins/inputs/prometheus" + "github.com/influxdb/telegraf/testutil" ) var pTesting *PrometheusClient diff --git a/plugins/outputs/registry.go b/plugins/outputs/registry.go index d4c6ba1e5..d7ea30492 100644 --- a/plugins/outputs/registry.go +++ b/plugins/outputs/registry.go @@ -1,7 +1,7 @@ package outputs import ( - "github.com/influxdata/influxdb/client/v2" + "github.com/influxdb/influxdb/client/v2" ) type Output interface { diff --git a/plugins/outputs/riemann/riemann.go b/plugins/outputs/riemann/riemann.go index c1b22ec46..afbde0051 100644 --- a/plugins/outputs/riemann/riemann.go +++ b/plugins/outputs/riemann/riemann.go @@ -6,8 +6,8 @@ import ( "os" "github.com/amir/raidman" - "github.com/influxdata/influxdb/client/v2" - "github.com/influxdata/telegraf/plugins/outputs" + "github.com/influxdb/influxdb/client/v2" + "github.com/influxdb/telegraf/plugins/outputs" ) type Riemann struct { diff --git a/plugins/outputs/riemann/riemann_test.go b/plugins/outputs/riemann/riemann_test.go index 8b3f27ac0..31e9478b1 100644 --- a/plugins/outputs/riemann/riemann_test.go +++ b/plugins/outputs/riemann/riemann_test.go @@ -3,7 +3,7 @@ package riemann import ( "testing" - "github.com/influxdata/telegraf/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/require" ) diff --git a/scripts/Vagrantfile b/scripts/Vagrantfile index a04450d6d..3c0199bdb 100644 --- a/scripts/Vagrantfile +++ b/scripts/Vagrantfile @@ -7,7 +7,7 @@ VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "ubuntu/trusty64" - config.vm.synced_folder "..", "/home/vagrant/go/src/github.com/influxdata/telegraf", + config.vm.synced_folder "..", "/home/vagrant/go/src/github.com/influxdb/telegraf", type: "rsync", rsync__args: ["--verbose", "--archive", "--delete", "-z", "--safe-links"], rsync__exclude: ["./telegraf", ".vagrant/"] @@ -26,7 +26,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| gvm use go1.4.2 --default echo "export PATH=$PATH:$GOPATH/bin" >> "$HOME/.bashrc" echo 'export GOPATH=/home/vagrant/go' >> "$HOME/.bashrc" - cd "$HOME/go/src/github.com/influxdata/telegraf" &&\ + cd "$HOME/go/src/github.com/influxdb/telegraf" &&\ rm -rf Godeps/_workspace/pkg &&\ GOPATH="$HOME/go" make SHELL diff --git a/scripts/circle-test.sh b/scripts/circle-test.sh index bbad51506..96319bf72 100755 --- a/scripts/circle-test.sh +++ b/scripts/circle-test.sh @@ -34,7 +34,7 @@ export GOPATH=$BUILD_DIR # Turning off GOGC speeds up build times export GOGC=off export PATH=$GOPATH/bin:$PATH -exit_if_fail mkdir -p $GOPATH/src/github.com/influxdata +exit_if_fail mkdir -p $GOPATH/src/github.com/influxdb # Dump some test config to the log. echo "Test configuration" @@ -44,8 +44,8 @@ echo "\$GOPATH: $GOPATH" echo "\$CIRCLE_BRANCH: $CIRCLE_BRANCH" # Move the checked-out source to a better location -exit_if_fail mv $HOME/telegraf $GOPATH/src/github.com/influxdata -exit_if_fail cd $GOPATH/src/github.com/influxdata/telegraf +exit_if_fail mv $HOME/telegraf $GOPATH/src/github.com/influxdb +exit_if_fail cd $GOPATH/src/github.com/influxdb/telegraf # Verify that go fmt has been run check_go_fmt diff --git a/scripts/telegraf.service b/scripts/telegraf.service index 6f4450402..d92f3072c 100644 --- a/scripts/telegraf.service +++ b/scripts/telegraf.service @@ -1,6 +1,6 @@ [Unit] Description=The plugin-driven server agent for reporting metrics into InfluxDB -Documentation=https://github.com/influxdata/telegraf +Documentation=https://github.com/influxdb/telegraf After=network.target [Service] diff --git a/testutil/testutil.go b/testutil/testutil.go index 436b57361..581220299 100644 --- a/testutil/testutil.go +++ b/testutil/testutil.go @@ -6,7 +6,7 @@ import ( "os" "time" - "github.com/influxdata/influxdb/client/v2" + "github.com/influxdb/influxdb/client/v2" ) var localhost = "localhost" From 5b15cd91636eb7f409314299936036ea48c34b5d Mon Sep 17 00:00:00 2001 From: Jack Zampolin Date: Fri, 22 Jan 2016 16:48:42 -0800 Subject: [PATCH 06/10] Change github.com/influxdata to github.com/influxdb where necessary --- CHANGELOG.md | 22 +++++++++++----------- README.md | 2 +- build.py | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fa56a00a..9319c775e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,23 +2,23 @@ ### Features - [#509](https://github.com/influxdb/telegraf/pull/509): Flatten JSON arrays with indices. Thanks @psilva261! -- [#512](https://github.com/influxdb/telegraf/pull/512): Python 3 build script, add lsof dep to package. Thanks @Ormod! -- [#475](https://github.com/influxdb/telegraf/pull/475): Add response time to httpjson plugin. Thanks @titilambert! -- [#519](https://github.com/influxdb/telegraf/pull/519): Added a sensors input based on lm-sensors. Thanks @md14454! -- [#467](https://github.com/influxdb/telegraf/issues/467): Add option to disable statsd measurement name conversion. -- [#534](https://github.com/influxdb/telegraf/pull/534): NSQ input plugin. Thanks @allingeek! -- [#494](https://github.com/influxdb/telegraf/pull/494): Graphite output plugin. Thanks @titilambert! +- [#512](https://github.com/influxdata/telegraf/pull/512): Python 3 build script, add lsof dep to package. Thanks @Ormod! +- [#475](https://github.com/influxdata/telegraf/pull/475): Add response time to httpjson plugin. Thanks @titilambert! +- [#519](https://github.com/influxdata/telegraf/pull/519): Added a sensors input based on lm-sensors. Thanks @md14454! +- [#467](https://github.com/influxdata/telegraf/issues/467): Add option to disable statsd measurement name conversion. +- [#534](https://github.com/influxdata/telegraf/pull/534): NSQ input plugin. Thanks @allingeek! +- [#494](https://github.com/influxdata/telegraf/pull/494): Graphite output plugin. Thanks @titilambert! - AMQP SSL support. Thanks @ekini! -- [#539](https://github.com/influxdb/telegraf/pull/539): Reload config on SIGHUP. Thanks @titilambert! -- [#522](https://github.com/influxdb/telegraf/pull/522): Phusion passenger input plugin. Thanks @kureikain! -- [#541](https://github.com/influxdb/telegraf/pull/541): Kafka output TLS cert support. Thanks @Ormod! +- [#539](https://github.com/influxdata/telegraf/pull/539): Reload config on SIGHUP. Thanks @titilambert! +- [#522](https://github.com/influxdata/telegraf/pull/522): Phusion passenger input plugin. Thanks @kureikain! +- [#541](https://github.com/influxdata/telegraf/pull/541): Kafka output TLS cert support. Thanks @Ormod! - [#551](https://github.com/influxdb/telegraf/pull/551): Statsd UDP read packet size now defaults to 1500 bytes, and is configurable. -- [#552](https://github.com/influxdb/telegraf/pull/552): Support for collection interval jittering. +- [#552](https://github.com/influxdata/telegraf/pull/552): Support for collection interval jittering. ### Bugfixes - [#506](https://github.com/influxdb/telegraf/pull/506): Ping input doesn't return response time metric when timeout. Thanks @titilambert! - [#508](https://github.com/influxdb/telegraf/pull/508): Fix prometheus cardinality issue with the `net` plugin -- [#499](https://github.com/influxdb/telegraf/issues/499) & [#502](https://github.com/influxdb/telegraf/issues/502): php fpm unix socket and other fixes, thanks @kureikain! +- [#499](https://github.com/influxdata/telegraf/issues/499) & [#502](https://github.com/influxdata/telegraf/issues/502): php fpm unix socket and other fixes, thanks @kureikain! - [#543](https://github.com/influxdb/telegraf/issues/543): Statsd Packet size sometimes truncated. ## v0.10.0 [2016-01-12] diff --git a/README.md b/README.md index ab31c35e9..80c739d03 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Telegraf is an agent written in Go for collecting metrics from the system it's running on, or from other services, and writing them into InfluxDB or other -[outputs](https://github.com/influxdb/telegraf#supported-output-plugins). +[outputs](https://github.com/influxdata/telegraf#supported-output-plugins). Design goals are to have a minimal memory footprint with a plugin system so that developers in the community can easily add support for collecting metrics diff --git a/build.py b/build.py index 565a6904d..a5892f26a 100755 --- a/build.py +++ b/build.py @@ -39,7 +39,7 @@ PREINST_SCRIPT = "scripts/pre-install.sh" # META-PACKAGE VARIABLES PACKAGE_LICENSE = "MIT" -PACKAGE_URL = "https://github.com/influxdb/telegraf" +PACKAGE_URL = "https://github.com/influxdata/telegraf" MAINTAINER = "support@influxdb.com" VENDOR = "InfluxData" DESCRIPTION = "Plugin-driven server agent for reporting metrics into InfluxDB." From 4e5dfa5d33b26cd85d210c129a1cf0bf8de9b328 Mon Sep 17 00:00:00 2001 From: Jack Zampolin Date: Mon, 25 Jan 2016 09:56:57 -0800 Subject: [PATCH 07/10] Address PR comments and merge conflicts --- Godeps | 5 +- plugins/inputs/all/all.go | 2 +- .../{ghwebhooks.go => github_webhooks.go} | 34 +- ...bhooks_test.go => github_webhooks_test.go} | 81 +- plugins/inputs/ghwebhooks/models/mock_json.go | 44 +- plugins/inputs/ghwebhooks/models/models.go | 3 +- plugins/inputs/github_webhooks/README.md | 0 .../inputs/github_webhooks/github_webhooks.go | 338 ++ .../github_webhooks/github_webhooks_test.go | 239 ++ .../github_webhooks/models/mock_json.go | 3559 +++++++++++++++++ .../inputs/github_webhooks/models/models.go | 711 ++++ 11 files changed, 4932 insertions(+), 84 deletions(-) rename plugins/inputs/ghwebhooks/{ghwebhooks.go => github_webhooks.go} (89%) rename plugins/inputs/ghwebhooks/{ghwebhooks_test.go => github_webhooks_test.go} (82%) create mode 100644 plugins/inputs/github_webhooks/README.md create mode 100644 plugins/inputs/github_webhooks/github_webhooks.go create mode 100644 plugins/inputs/github_webhooks/github_webhooks_test.go create mode 100644 plugins/inputs/github_webhooks/models/mock_json.go create mode 100644 plugins/inputs/github_webhooks/models/models.go diff --git a/Godeps b/Godeps index 9f46fd79b..6daa3709b 100644 --- a/Godeps +++ b/Godeps @@ -18,12 +18,15 @@ github.com/gogo/protobuf c57e439bad574c2e0877ff18d514badcfced004d github.com/golang/protobuf 2402d76f3d41f928c7902a765dfc872356dd3aad github.com/golang/snappy 723cc1e459b8eea2dea4583200fd60757d40097a github.com/gonuts/go-shellquote e842a11b24c6abfb3dd27af69a17f482e4b483c2 +github.com/gorilla/context 1c83b3eabd45b6d76072b66b746c20815fb2872d +github.com/gorilla/mux 26a6070f849969ba72b72256e9f14cf519751690 github.com/hailocab/go-hostpool 50839ee41f32bfca8d03a183031aa634b2dc1c64 github.com/hashicorp/go-msgpack fa3f63826f7c23912c15263591e65d54d080b458 github.com/hashicorp/raft b95f335efee1992886864389183ebda0c0a5d0f6 github.com/hashicorp/raft-boltdb d1e82c1ec3f15ee991f7cc7ffd5b67ff6f5bbaee github.com/influxdata/influxdb 0e0f85a0c1fd1788ae4f9145531b02c539cfa5b5 -github.com/influxdb/influxdb 0e0f85a0c1fd1788ae4f9145531b02c539cfa5b5 +github.com/influxdb/influxdb c1d6c14c47dfb4d60878a979fbdd8b526281d3d6 +github.com/influxdb/telegraf d3a5cca1bc18f315dacbd9941f1e4556fde86538 github.com/jmespath/go-jmespath c01cf91b011868172fdcd9f41838e80c9d716264 github.com/klauspost/crc32 999f3125931f6557b991b2f8472172bdfa578d38 github.com/lib/pq 8ad2b298cadd691a77015666a5372eae5dbfac8f diff --git a/plugins/inputs/all/all.go b/plugins/inputs/all/all.go index fb2d681a6..2addeb2af 100644 --- a/plugins/inputs/all/all.go +++ b/plugins/inputs/all/all.go @@ -8,6 +8,7 @@ import ( _ "github.com/influxdata/telegraf/plugins/inputs/docker" _ "github.com/influxdata/telegraf/plugins/inputs/elasticsearch" _ "github.com/influxdata/telegraf/plugins/inputs/exec" + _ "github.com/influxdata/telegraf/plugins/inputs/github_webhooks" _ "github.com/influxdata/telegraf/plugins/inputs/haproxy" _ "github.com/influxdata/telegraf/plugins/inputs/httpjson" _ "github.com/influxdata/telegraf/plugins/inputs/influxdb" @@ -38,5 +39,4 @@ import ( _ "github.com/influxdata/telegraf/plugins/inputs/twemproxy" _ "github.com/influxdata/telegraf/plugins/inputs/zfs" _ "github.com/influxdata/telegraf/plugins/inputs/zookeeper" - _ "github.com/influxdb/telegraf/plugins/inputs/ghwebhooks" ) diff --git a/plugins/inputs/ghwebhooks/ghwebhooks.go b/plugins/inputs/ghwebhooks/github_webhooks.go similarity index 89% rename from plugins/inputs/ghwebhooks/ghwebhooks.go rename to plugins/inputs/ghwebhooks/github_webhooks.go index 836a6ee40..177b04c75 100644 --- a/plugins/inputs/ghwebhooks/ghwebhooks.go +++ b/plugins/inputs/ghwebhooks/github_webhooks.go @@ -1,4 +1,4 @@ -package ghwebhooks +package github_webhooks import ( "encoding/json" @@ -9,15 +9,15 @@ import ( "sync" "github.com/gorilla/mux" - mod "github.com/influxdb/support-tools/ghWebhooks/models" - "github.com/influxdb/telegraf/plugins/inputs" + "github.com/influxdata/telegraf/plugins/inputs" + mod "github.com/influxdata/telegraf/plugins/inputs/ghWebhooks/models" ) func init() { - inputs.Add("ghwebhooks", func() inputs.Input { return &GHWebhooks{} }) + inputs.Add("github_webhooks", func() inputs.Input { return &GithubWebhooks{} }) } -type GHWebhooks struct { +type GithubWebhooks struct { ServiceAddress string MeasurementName string // Lock for the struct @@ -26,25 +26,25 @@ type GHWebhooks struct { events []mod.Event } -func NewGHWebhooks() *GHWebhooks { - return &GHWebhooks{} +func NewGithubWebhooks() *GithubWebhooks { + return &GithubWebhooks{} } -func (gh *GHWebhooks) SampleConfig() string { +func (gh *GithubWebhooks) SampleConfig() string { return ` # Address and port to host Webhook listener on service_address = ":1618" - # Measurement name - measurement_name = "ghwebhooks" + # Measurement name + measurement_name = "github_webhooks" ` } -func (gh *GHWebhooks) Description() string { +func (gh *GithubWebhooks) Description() string { return "A Github Webhook Event collector" } // Writes the points from <-gh.in to the Accumulator -func (gh *GHWebhooks) Gather(acc inputs.Accumulator) error { +func (gh *GithubWebhooks) Gather(acc inputs.Accumulator) error { gh.Lock() defer gh.Unlock() for _, event := range gh.events { @@ -55,7 +55,7 @@ func (gh *GHWebhooks) Gather(acc inputs.Accumulator) error { return nil } -func (gh *GHWebhooks) Listen() { +func (gh *GithubWebhooks) Listen() { r := mux.NewRouter() r.HandleFunc("/", gh.eventHandler).Methods("POST") err := http.ListenAndServe(fmt.Sprintf("%s", gh.ServiceAddress), r) @@ -64,18 +64,18 @@ func (gh *GHWebhooks) Listen() { } } -func (gh *GHWebhooks) Start() error { +func (gh *GithubWebhooks) Start() error { go gh.Listen() - log.Printf("Started the ghwebhooks service on %s\n", gh.ServiceAddress) + log.Printf("Started the github_webhooks service on %s\n", gh.ServiceAddress) return nil } -func (gh *GHWebhooks) Stop() { +func (gh *GithubWebhooks) Stop() { log.Println("Stopping the ghWebhooks service") } // Handles the / route -func (gh *GHWebhooks) eventHandler(w http.ResponseWriter, r *http.Request) { +func (gh *GithubWebhooks) eventHandler(w http.ResponseWriter, r *http.Request) { eventType := r.Header["X-Github-Event"][0] data, err := ioutil.ReadAll(r.Body) if err != nil { diff --git a/plugins/inputs/ghwebhooks/ghwebhooks_test.go b/plugins/inputs/ghwebhooks/github_webhooks_test.go similarity index 82% rename from plugins/inputs/ghwebhooks/ghwebhooks_test.go rename to plugins/inputs/ghwebhooks/github_webhooks_test.go index ea26f95b1..873e2d2f7 100644 --- a/plugins/inputs/ghwebhooks/ghwebhooks_test.go +++ b/plugins/inputs/ghwebhooks/github_webhooks_test.go @@ -1,4 +1,4 @@ -package ghwebhooks +package github_webhooks import ( "net/http" @@ -6,12 +6,12 @@ import ( "strings" "testing" - mod "github.com/influxdb/telegraf/plugins/inputs/ghwebhooks/models" + mod "github.com/influxdata/telegraf/plugins/inputs/ghwebhooks/models" ) func TestCommitCommentEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.CommitCommentEventJSON() + gh := NewGithubWebhooks() + jsonString := mod.CommitCommentEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "commit_comment") w := httptest.NewRecorder() @@ -22,8 +22,8 @@ func TestCommitCommentEvent(t *testing.T) { } func TestDeleteEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.DeleteEventJSON() + gh := NewGithubWebhooks() + jsonString := mod.DeleteEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "delete") w := httptest.NewRecorder() @@ -34,8 +34,8 @@ func TestDeleteEvent(t *testing.T) { } func TestDeploymentEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.DeploymentEventJSON() + gh := NewGithubWebhooks() + jsonString := mod.DeploymentEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "deployment") w := httptest.NewRecorder() @@ -46,8 +46,8 @@ func TestDeploymentEvent(t *testing.T) { } func TestDeploymentStatusEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.DeploymentStatusEventJSON() + gh := NewGithubWebhooks() + jsonString := mod.DeploymentStatusEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "deployment_status") w := httptest.NewRecorder() @@ -58,8 +58,8 @@ func TestDeploymentStatusEvent(t *testing.T) { } func TestForkEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.ForkEventJSON() + gh := NewGithubWebhooks() + jsonString := mod.ForkEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "fork") w := httptest.NewRecorder() @@ -70,8 +70,8 @@ func TestForkEvent(t *testing.T) { } func TestGollumEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.GollumEventJSON() + gh := NewGithubWebhooks() + jsonString := mod.GollumEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "gollum") w := httptest.NewRecorder() @@ -82,8 +82,8 @@ func TestGollumEvent(t *testing.T) { } func TestIssueCommentEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.IssueCommentEventJSON() + gh := NewGithubWebhooks() + jsonString := mod.IssueCommentEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "issue_comment") w := httptest.NewRecorder() @@ -94,8 +94,8 @@ func TestIssueCommentEvent(t *testing.T) { } func TestIssuesEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.IssuesEventJSON() + gh := NewGithubWebhooks() + jsonString := mod.IssuesEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "issues") w := httptest.NewRecorder() @@ -106,8 +106,8 @@ func TestIssuesEvent(t *testing.T) { } func TestMemberEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.MemberEventJSON() + gh := NewGithubWebhooks() + jsonString := mod.MemberEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "member") w := httptest.NewRecorder() @@ -118,8 +118,8 @@ func TestMemberEvent(t *testing.T) { } func TestMembershipEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.MembershipEventJSON() + gh := NewGithubWebhooks() + jsonString := mod.MembershipEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "membership") w := httptest.NewRecorder() @@ -130,8 +130,8 @@ func TestMembershipEvent(t *testing.T) { } func TestPageBuildEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.PageBuildEventJSON() + gh := NewGithubWebhooks() + jsonString := mod.PageBuildEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "page_build") w := httptest.NewRecorder() @@ -142,8 +142,8 @@ func TestPageBuildEvent(t *testing.T) { } func TestPublicEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.PublicEventJSON() + gh := NewGithubWebhooks() + jsonString := mod.PublicEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "public") w := httptest.NewRecorder() @@ -154,8 +154,8 @@ func TestPublicEvent(t *testing.T) { } func TestPullRequestReviewCommentEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.PullRequestReviewCommentEventJSON() + gh := NewGithubWebhooks() + jsonString := mod.PullRequestReviewCommentEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "pull_request_review_comment") w := httptest.NewRecorder() @@ -166,8 +166,8 @@ func TestPullRequestReviewCommentEvent(t *testing.T) { } func TestPushEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.PushEventJSON() + gh := NewGithubWebhooks() + jsonString := mod.PushEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "push") w := httptest.NewRecorder() @@ -178,8 +178,8 @@ func TestPushEvent(t *testing.T) { } func TestReleaseEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.ReleaseEventJSON() + gh := NewGithubWebhooks() + jsonString := mod.ReleaseEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "release") w := httptest.NewRecorder() @@ -190,8 +190,8 @@ func TestReleaseEvent(t *testing.T) { } func TestRepositoryEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.RepositoryEventJSON() + gh := NewGithubWebhooks() + jsonString := mod.RepositoryEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "repository") w := httptest.NewRecorder() @@ -202,8 +202,9 @@ func TestRepositoryEvent(t *testing.T) { } func TestStatusEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.StatusEventJSON() + gh := NewGithubWebhooks() + + jsonString := mod.StatusEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "status") w := httptest.NewRecorder() @@ -214,8 +215,8 @@ func TestStatusEvent(t *testing.T) { } func TestTeamAddEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.TeamAddEventJSON() + gh := NewGithubWebhooks() + jsonString := mod.TeamAddEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "team_add") w := httptest.NewRecorder() @@ -226,8 +227,8 @@ func TestTeamAddEvent(t *testing.T) { } func TestWatchEvent(t *testing.T) { - gh := NewGHWebhooks() - jsonString := mod.Mock{}.WatchEventJSON() + gh := NewGithubWebhooks() + jsonString := mod.WatchEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "watch") w := httptest.NewRecorder() diff --git a/plugins/inputs/ghwebhooks/models/mock_json.go b/plugins/inputs/ghwebhooks/models/mock_json.go index 4d2232e07..91c59cc22 100644 --- a/plugins/inputs/ghwebhooks/models/mock_json.go +++ b/plugins/inputs/ghwebhooks/models/mock_json.go @@ -1,8 +1,6 @@ package models -type Mock struct{} - -func (_ Mock) CommitCommentEventJSON() string { +func CommitCommentEventJSON() string { return `{ "action": "created", "comment": { @@ -145,7 +143,7 @@ func (_ Mock) CommitCommentEventJSON() string { }` } -func (_ Mock) CreateEventJSON() string { +func CreateEventJSON() string { return `{ "ref": "0.0.1", "ref_type": "tag", @@ -261,7 +259,7 @@ func (_ Mock) CreateEventJSON() string { }` } -func (_ Mock) DeleteEventJSON() string { +func DeleteEventJSON() string { return `{ "ref": "simple-tag", "ref_type": "tag", @@ -375,7 +373,7 @@ func (_ Mock) DeleteEventJSON() string { }` } -func (_ Mock) DeploymentEventJSON() string { +func DeploymentEventJSON() string { return `{ "deployment": { "url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692", @@ -520,7 +518,7 @@ func (_ Mock) DeploymentEventJSON() string { }` } -func (_ Mock) DeploymentStatusEventJSON() string { +func DeploymentStatusEventJSON() string { return `{ "deployment": { "url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692", @@ -696,7 +694,7 @@ func (_ Mock) DeploymentStatusEventJSON() string { ` } -func (_ Mock) ForkEventJSON() string { +func ForkEventJSON() string { return `{ "forkee": { "id": 35129393, @@ -895,7 +893,7 @@ func (_ Mock) ForkEventJSON() string { }` } -func (_ Mock) GollumEventJSON() string { +func GollumEventJSON() string { return `{ "pages": [ { @@ -1016,7 +1014,7 @@ func (_ Mock) GollumEventJSON() string { }` } -func (_ Mock) IssueCommentEventJSON() string { +func IssueCommentEventJSON() string { return `{ "action": "created", "issue": { @@ -1201,7 +1199,7 @@ func (_ Mock) IssueCommentEventJSON() string { }` } -func (_ Mock) IssuesEventJSON() string { +func IssuesEventJSON() string { return `{ "action": "opened", "issue": { @@ -1358,7 +1356,7 @@ func (_ Mock) IssuesEventJSON() string { }` } -func (_ Mock) MemberEventJSON() string { +func MemberEventJSON() string { return `{ "action": "added", "member": { @@ -1489,7 +1487,7 @@ func (_ Mock) MemberEventJSON() string { }` } -func (_ Mock) MembershipEventJSON() string { +func MembershipEventJSON() string { return `{ "action": "added", "scope": "team", @@ -1553,7 +1551,7 @@ func (_ Mock) MembershipEventJSON() string { }` } -func (_ Mock) PageBuildEventJSON() string { +func PageBuildEventJSON() string { return `{ "id": 15995382, "build": { @@ -1695,7 +1693,7 @@ func (_ Mock) PageBuildEventJSON() string { }` } -func (_ Mock) PublicEventJSON() string { +func PublicEventJSON() string { return `{ "repository": { "id": 35129377, @@ -1806,7 +1804,7 @@ func (_ Mock) PublicEventJSON() string { }` } -func (_ Mock) PullRequestReviewCommentEventJSON() string { +func PullRequestReviewCommentEventJSON() string { return `{ "action": "created", "comment": { @@ -2255,7 +2253,7 @@ func (_ Mock) PullRequestReviewCommentEventJSON() string { }` } -func (_ Mock) PullRequestEventJSON() string { +func PullRequestEventJSON() string { return `{ "action": "opened", "number": 1, @@ -2670,7 +2668,7 @@ func (_ Mock) PullRequestEventJSON() string { }` } -func (_ Mock) PushEventJSON() string { +func PushEventJSON() string { return `{ "ref": "refs/heads/changes", "before": "9049f1265b7d61be4a8904a9a27120d2064dab3b", @@ -2834,7 +2832,7 @@ func (_ Mock) PushEventJSON() string { }` } -func (_ Mock) RepositoryEventJSON() string { +func RepositoryEventJSON() string { return `{ "action": "created", "repository": { @@ -2956,7 +2954,7 @@ func (_ Mock) RepositoryEventJSON() string { }` } -func (_ Mock) ReleaseEventJSON() string { +func ReleaseEventJSON() string { return `{ "action": "published", "release": { @@ -3107,7 +3105,7 @@ func (_ Mock) ReleaseEventJSON() string { }` } -func (_ Mock) StatusEventJSON() string { +func StatusEventJSON() string { return `{ "id": 214015194, "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", @@ -3316,7 +3314,7 @@ func (_ Mock) StatusEventJSON() string { }` } -func (_ Mock) TeamAddEventJSON() string { +func TeamAddEventJSON() string { return `{ "team": { "name": "github", @@ -3448,7 +3446,7 @@ func (_ Mock) TeamAddEventJSON() string { }` } -func (_ Mock) WatchEventJSON() string { +func WatchEventJSON() string { return `{ "action": "started", "repository": { diff --git a/plugins/inputs/ghwebhooks/models/models.go b/plugins/inputs/ghwebhooks/models/models.go index 5781c1917..a499218f5 100644 --- a/plugins/inputs/ghwebhooks/models/models.go +++ b/plugins/inputs/ghwebhooks/models/models.go @@ -5,14 +5,13 @@ import ( "log" "time" - "github.com/influxdb/influxdb/client/v2" + "github.com/influxdata/influxdb/client/v2" ) const meas = "ghWebhooks" type Event interface { NewPoint() *client.Point - JSON() string } type Repository struct { diff --git a/plugins/inputs/github_webhooks/README.md b/plugins/inputs/github_webhooks/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/inputs/github_webhooks/github_webhooks.go b/plugins/inputs/github_webhooks/github_webhooks.go new file mode 100644 index 000000000..ba83bef4c --- /dev/null +++ b/plugins/inputs/github_webhooks/github_webhooks.go @@ -0,0 +1,338 @@ +package github_webhooks + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "log" + "net/http" + "sync" + + "github.com/gorilla/mux" + "github.com/influxdata/telegraf/plugins/inputs" + mod "github.com/influxdata/telegraf/plugins/inputs/github_webhooks/models" +) + +func init() { + inputs.Add("github_webhooks", func() inputs.Input { return &GithubWebhooks{} }) +} + +type GithubWebhooks struct { + ServiceAddress string + MeasurementName string + // Lock for the struct + sync.Mutex + // Events buffer to store events between Gather calls + events []mod.Event +} + +func NewGithubWebhooks() *GithubWebhooks { + return &GithubWebhooks{} +} + +func (gh *GithubWebhooks) SampleConfig() string { + return ` + # Address and port to host Webhook listener on + service_address = ":1618" + # Measurement name + measurement_name = "github_webhooks" +` +} + +func (gh *GithubWebhooks) Description() string { + return "A Github Webhook Event collector" +} + +// Writes the points from <-gh.in to the Accumulator +func (gh *GithubWebhooks) Gather(acc inputs.Accumulator) error { + gh.Lock() + defer gh.Unlock() + for _, event := range gh.events { + p := event.NewPoint() + acc.AddFields(gh.MeasurementName, p.Fields(), p.Tags(), p.Time()) + } + gh.events = make([]mod.Event, 0) + return nil +} + +func (gh *GithubWebhooks) Listen() { + r := mux.NewRouter() + r.HandleFunc("/", gh.eventHandler).Methods("POST") + err := http.ListenAndServe(fmt.Sprintf("%s", gh.ServiceAddress), r) + if err != nil { + log.Printf("Error starting server: %v", err) + } +} + +func (gh *GithubWebhooks) Start() error { + go gh.Listen() + log.Printf("Started the github_webhooks service on %s\n", gh.ServiceAddress) + return nil +} + +func (gh *GithubWebhooks) Stop() { + log.Println("Stopping the ghWebhooks service") +} + +// Handles the / route +func (gh *GithubWebhooks) eventHandler(w http.ResponseWriter, r *http.Request) { + eventType := r.Header["X-Github-Event"][0] + data, err := ioutil.ReadAll(r.Body) + if err != nil { + w.WriteHeader(http.StatusBadRequest) + } + e, err := NewEvent(data, eventType) + if err != nil { + w.WriteHeader(http.StatusBadRequest) + } + gh.Lock() + gh.events = append(gh.events, e) + gh.Unlock() + w.WriteHeader(http.StatusOK) +} + +func newCommitComment(data []byte) (mod.Event, error) { + commitCommentStruct := mod.CommitCommentEvent{} + err := json.Unmarshal(data, &commitCommentStruct) + if err != nil { + return nil, err + } + return commitCommentStruct, nil +} + +func newCreate(data []byte) (mod.Event, error) { + createStruct := mod.CreateEvent{} + err := json.Unmarshal(data, &createStruct) + if err != nil { + return nil, err + } + return createStruct, nil +} + +func newDelete(data []byte) (mod.Event, error) { + deleteStruct := mod.DeleteEvent{} + err := json.Unmarshal(data, &deleteStruct) + if err != nil { + return nil, err + } + return deleteStruct, nil +} + +func newDeployment(data []byte) (mod.Event, error) { + deploymentStruct := mod.DeploymentEvent{} + err := json.Unmarshal(data, &deploymentStruct) + if err != nil { + return nil, err + } + return deploymentStruct, nil +} + +func newDeploymentStatus(data []byte) (mod.Event, error) { + deploymentStatusStruct := mod.DeploymentStatusEvent{} + err := json.Unmarshal(data, &deploymentStatusStruct) + if err != nil { + return nil, err + } + return deploymentStatusStruct, nil +} + +func newFork(data []byte) (mod.Event, error) { + forkStruct := mod.ForkEvent{} + err := json.Unmarshal(data, &forkStruct) + if err != nil { + return nil, err + } + return forkStruct, nil +} + +func newGollum(data []byte) (mod.Event, error) { + gollumStruct := mod.GollumEvent{} + err := json.Unmarshal(data, &gollumStruct) + if err != nil { + return nil, err + } + return gollumStruct, nil +} + +func newIssueComment(data []byte) (mod.Event, error) { + issueCommentStruct := mod.IssueCommentEvent{} + err := json.Unmarshal(data, &issueCommentStruct) + if err != nil { + return nil, err + } + return issueCommentStruct, nil +} + +func newIssues(data []byte) (mod.Event, error) { + issuesStruct := mod.IssuesEvent{} + err := json.Unmarshal(data, &issuesStruct) + if err != nil { + return nil, err + } + return issuesStruct, nil +} + +func newMember(data []byte) (mod.Event, error) { + memberStruct := mod.MemberEvent{} + err := json.Unmarshal(data, &memberStruct) + if err != nil { + return nil, err + } + return memberStruct, nil +} + +func newMembership(data []byte) (mod.Event, error) { + membershipStruct := mod.MembershipEvent{} + err := json.Unmarshal(data, &membershipStruct) + if err != nil { + return nil, err + } + return membershipStruct, nil +} + +func newPageBuild(data []byte) (mod.Event, error) { + pageBuildEvent := mod.PageBuildEvent{} + err := json.Unmarshal(data, &pageBuildEvent) + if err != nil { + return nil, err + } + return pageBuildEvent, nil +} + +func newPublic(data []byte) (mod.Event, error) { + publicEvent := mod.PublicEvent{} + err := json.Unmarshal(data, &publicEvent) + if err != nil { + return nil, err + } + return publicEvent, nil +} + +func newPullRequest(data []byte) (mod.Event, error) { + pullRequestStruct := mod.PullRequestEvent{} + err := json.Unmarshal(data, &pullRequestStruct) + if err != nil { + return nil, err + } + return pullRequestStruct, nil +} + +func newPullRequestReviewComment(data []byte) (mod.Event, error) { + pullRequestReviewCommentStruct := mod.PullRequestReviewCommentEvent{} + err := json.Unmarshal(data, &pullRequestReviewCommentStruct) + if err != nil { + return nil, err + } + return pullRequestReviewCommentStruct, nil +} + +func newPush(data []byte) (mod.Event, error) { + pushStruct := mod.PushEvent{} + err := json.Unmarshal(data, &pushStruct) + if err != nil { + return nil, err + } + return pushStruct, nil +} + +func newRelease(data []byte) (mod.Event, error) { + releaseStruct := mod.ReleaseEvent{} + err := json.Unmarshal(data, &releaseStruct) + if err != nil { + return nil, err + } + return releaseStruct, nil +} + +func newRepository(data []byte) (mod.Event, error) { + repositoryStruct := mod.RepositoryEvent{} + err := json.Unmarshal(data, &repositoryStruct) + if err != nil { + return nil, err + } + return repositoryStruct, nil +} + +func newStatus(data []byte) (mod.Event, error) { + statusStruct := mod.StatusEvent{} + err := json.Unmarshal(data, &statusStruct) + if err != nil { + return nil, err + } + return statusStruct, nil +} + +func newTeamAdd(data []byte) (mod.Event, error) { + teamAddStruct := mod.TeamAddEvent{} + err := json.Unmarshal(data, &teamAddStruct) + if err != nil { + return nil, err + } + return teamAddStruct, nil +} + +func newWatch(data []byte) (mod.Event, error) { + watchStruct := mod.WatchEvent{} + err := json.Unmarshal(data, &watchStruct) + if err != nil { + return nil, err + } + return watchStruct, nil +} + +type newEventError struct { + s string +} + +func (e *newEventError) Error() string { + return e.s +} + +func NewEvent(r []byte, t string) (mod.Event, error) { + log.Printf("New %v event recieved", t) + switch t { + case "commit_comment": + return newCommitComment(r) + case "create": + return newCreate(r) + case "delete": + return newDelete(r) + case "deployment": + return newDeployment(r) + case "deployment_status": + return newDeploymentStatus(r) + case "fork": + return newFork(r) + case "gollum": + return newGollum(r) + case "issue_comment": + return newIssueComment(r) + case "issues": + return newIssues(r) + case "member": + return newMember(r) + case "membership": + return newMembership(r) + case "page_build": + return newPageBuild(r) + case "public": + return newPublic(r) + case "pull_request": + return newPullRequest(r) + case "pull_request_review_comment": + return newPullRequestReviewComment(r) + case "push": + return newPush(r) + case "release": + return newRelease(r) + case "repository": + return newRepository(r) + case "status": + return newStatus(r) + case "team_add": + return newTeamAdd(r) + case "watch": + return newWatch(r) + } + return nil, &newEventError{"Not a recgonized event type"} +} diff --git a/plugins/inputs/github_webhooks/github_webhooks_test.go b/plugins/inputs/github_webhooks/github_webhooks_test.go new file mode 100644 index 000000000..f2907cb90 --- /dev/null +++ b/plugins/inputs/github_webhooks/github_webhooks_test.go @@ -0,0 +1,239 @@ +package github_webhooks + +import ( + "net/http" + "net/http/httptest" + "strings" + "testing" + + mod "github.com/influxdata/telegraf/plugins/inputs/github_webhooks/models" +) + +func TestCommitCommentEvent(t *testing.T) { + gh := NewGithubWebhooks() + jsonString := mod.CommitCommentEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "commit_comment") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestDeleteEvent(t *testing.T) { + gh := NewGithubWebhooks() + jsonString := mod.DeleteEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "delete") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestDeploymentEvent(t *testing.T) { + gh := NewGithubWebhooks() + jsonString := mod.DeploymentEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "deployment") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestDeploymentStatusEvent(t *testing.T) { + gh := NewGithubWebhooks() + jsonString := mod.DeploymentStatusEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "deployment_status") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestForkEvent(t *testing.T) { + gh := NewGithubWebhooks() + jsonString := mod.ForkEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "fork") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestGollumEvent(t *testing.T) { + gh := NewGithubWebhooks() + jsonString := mod.GollumEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "gollum") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestIssueCommentEvent(t *testing.T) { + gh := NewGithubWebhooks() + jsonString := mod.IssueCommentEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "issue_comment") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestIssuesEvent(t *testing.T) { + gh := NewGithubWebhooks() + jsonString := mod.IssuesEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "issues") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestMemberEvent(t *testing.T) { + gh := NewGithubWebhooks() + jsonString := mod.MemberEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "member") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestMembershipEvent(t *testing.T) { + gh := NewGithubWebhooks() + jsonString := mod.MembershipEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "membership") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestPageBuildEvent(t *testing.T) { + gh := NewGithubWebhooks() + jsonString := mod.PageBuildEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "page_build") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestPublicEvent(t *testing.T) { + gh := NewGithubWebhooks() + jsonString := mod.PublicEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "public") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestPullRequestReviewCommentEvent(t *testing.T) { + gh := NewGithubWebhooks() + jsonString := mod.PullRequestReviewCommentEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "pull_request_review_comment") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestPushEvent(t *testing.T) { + gh := NewGithubWebhooks() + jsonString := mod.PushEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "push") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestReleaseEvent(t *testing.T) { + gh := NewGithubWebhooks() + jsonString := mod.ReleaseEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "release") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestRepositoryEvent(t *testing.T) { + gh := NewGithubWebhooks() + jsonString := mod.RepositoryEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "repository") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestStatusEvent(t *testing.T) { + gh := NewGithubWebhooks() + + jsonString := mod.StatusEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "status") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestTeamAddEvent(t *testing.T) { + gh := NewGithubWebhooks() + jsonString := mod.TeamAddEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "team_add") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} + +func TestWatchEvent(t *testing.T) { + gh := NewGithubWebhooks() + jsonString := mod.WatchEventJSON() + req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) + req.Header.Add("X-Github-Event", "watch") + w := httptest.NewRecorder() + gh.eventHandler(w, req) + if w.Code != http.StatusOK { + t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) + } +} diff --git a/plugins/inputs/github_webhooks/models/mock_json.go b/plugins/inputs/github_webhooks/models/mock_json.go new file mode 100644 index 000000000..91c59cc22 --- /dev/null +++ b/plugins/inputs/github_webhooks/models/mock_json.go @@ -0,0 +1,3559 @@ +package models + +func CommitCommentEventJSON() string { + return `{ + "action": "created", + "comment": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/comments/11056394", + "html_url": "https://github.com/baxterthehacker/public-repo/commit/9049f1265b7d61be4a8904a9a27120d2064dab3b#commitcomment-11056394", + "id": 11056394, + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "position": null, + "line": null, + "path": null, + "commit_id": "9049f1265b7d61be4a8904a9a27120d2064dab3b", + "created_at": "2015-05-05T23:40:29Z", + "updated_at": "2015-05-05T23:40:29Z", + "body": "This is a really good change! :+1:" + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func CreateEventJSON() string { + return `{ + "ref": "0.0.1", + "ref_type": "tag", + "master_branch": "master", + "description": "", + "pusher_type": "user", + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:38Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func DeleteEventJSON() string { + return `{ + "ref": "simple-tag", + "ref_type": "tag", + "pusher_type": "user", + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:40Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func DeploymentEventJSON() string { + return `{ + "deployment": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692", + "id": 710692, + "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", + "ref": "master", + "task": "deploy", + "payload": { + }, + "environment": "production", + "description": null, + "creator": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2015-05-05T23:40:38Z", + "updated_at": "2015-05-05T23:40:38Z", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692/statuses", + "repository_url": "https://api.github.com/repos/baxterthehacker/public-repo" + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:38Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func DeploymentStatusEventJSON() string { + return `{ + "deployment": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692", + "id": 710692, + "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", + "ref": "master", + "task": "deploy", + "payload": { + }, + "environment": "production", + "description": null, + "creator": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2015-05-05T23:40:38Z", + "updated_at": "2015-05-05T23:40:38Z", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692/statuses", + "repository_url": "https://api.github.com/repos/baxterthehacker/public-repo" + }, + "deployment_status": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692/statuses/1115122", + "id": 1115122, + "state": "success", + "creator": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "description": null, + "target_url": null, + "created_at": "2015-05-05T23:40:39Z", + "updated_at": "2015-05-05T23:40:39Z", + "deployment_url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692", + "repository_url": "https://api.github.com/repos/baxterthehacker/public-repo" + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:38Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +} +` +} + +func ForkEventJSON() string { + return `{ + "forkee": { + "id": 35129393, + "name": "public-repo", + "full_name": "baxterandthehackers/public-repo", + "owner": { + "login": "baxterandthehackers", + "id": 7649605, + "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterandthehackers", + "html_url": "https://github.com/baxterandthehackers", + "followers_url": "https://api.github.com/users/baxterandthehackers/followers", + "following_url": "https://api.github.com/users/baxterandthehackers/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterandthehackers/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterandthehackers/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterandthehackers/subscriptions", + "organizations_url": "https://api.github.com/users/baxterandthehackers/orgs", + "repos_url": "https://api.github.com/users/baxterandthehackers/repos", + "events_url": "https://api.github.com/users/baxterandthehackers/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterandthehackers/received_events", + "type": "Organization", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterandthehackers/public-repo", + "description": "", + "fork": true, + "url": "https://api.github.com/repos/baxterandthehackers/public-repo", + "forks_url": "https://api.github.com/repos/baxterandthehackers/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterandthehackers/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterandthehackers/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterandthehackers/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterandthehackers/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterandthehackers/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterandthehackers/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterandthehackers/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterandthehackers/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterandthehackers/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterandthehackers/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterandthehackers/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterandthehackers/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterandthehackers/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterandthehackers/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterandthehackers/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterandthehackers/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterandthehackers/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterandthehackers/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterandthehackers/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterandthehackers/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterandthehackers/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterandthehackers/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterandthehackers/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterandthehackers/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterandthehackers/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterandthehackers/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterandthehackers/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterandthehackers/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterandthehackers/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:30Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterandthehackers/public-repo.git", + "ssh_url": "git@github.com:baxterandthehackers/public-repo.git", + "clone_url": "https://github.com/baxterandthehackers/public-repo.git", + "svn_url": "https://github.com/baxterandthehackers/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 0, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "public": true + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 1, + "mirror_url": null, + "open_issues_count": 2, + "forks": 1, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterandthehackers", + "id": 7649605, + "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterandthehackers", + "html_url": "https://github.com/baxterandthehackers", + "followers_url": "https://api.github.com/users/baxterandthehackers/followers", + "following_url": "https://api.github.com/users/baxterandthehackers/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterandthehackers/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterandthehackers/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterandthehackers/subscriptions", + "organizations_url": "https://api.github.com/users/baxterandthehackers/orgs", + "repos_url": "https://api.github.com/users/baxterandthehackers/repos", + "events_url": "https://api.github.com/users/baxterandthehackers/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterandthehackers/received_events", + "type": "Organization", + "site_admin": false + } +}` +} + +func GollumEventJSON() string { + return `{ + "pages": [ + { + "page_name": "Home", + "title": "Home", + "summary": null, + "action": "created", + "sha": "91ea1bd42aa2ba166b86e8aefe049e9837214e67", + "html_url": "https://github.com/baxterthehacker/public-repo/wiki/Home" + } + ], + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:17Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 0, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "jasonrudolph", + "id": 2988, + "avatar_url": "https://avatars.githubusercontent.com/u/2988?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/jasonrudolph", + "html_url": "https://github.com/jasonrudolph", + "followers_url": "https://api.github.com/users/jasonrudolph/followers", + "following_url": "https://api.github.com/users/jasonrudolph/following{/other_user}", + "gists_url": "https://api.github.com/users/jasonrudolph/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jasonrudolph/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jasonrudolph/subscriptions", + "organizations_url": "https://api.github.com/users/jasonrudolph/orgs", + "repos_url": "https://api.github.com/users/jasonrudolph/repos", + "events_url": "https://api.github.com/users/jasonrudolph/events{/privacy}", + "received_events_url": "https://api.github.com/users/jasonrudolph/received_events", + "type": "User", + "site_admin": true + } +}` +} + +func IssueCommentEventJSON() string { + return `{ + "action": "created", + "issue": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2/labels{/name}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2/comments", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2/events", + "html_url": "https://github.com/baxterthehacker/public-repo/issues/2", + "id": 73464126, + "number": 2, + "title": "Spelling error in the README file", + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "labels": [ + { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/labels/bug", + "name": "bug", + "color": "fc2929" + } + ], + "state": "open", + "locked": false, + "assignee": null, + "milestone": null, + "comments": 1, + "created_at": "2015-05-05T23:40:28Z", + "updated_at": "2015-05-05T23:40:28Z", + "closed_at": null, + "body": "It looks like you accidently spelled 'commit' with two 't's." + }, + "comment": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments/99262140", + "html_url": "https://github.com/baxterthehacker/public-repo/issues/2#issuecomment-99262140", + "issue_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2", + "id": 99262140, + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2015-05-05T23:40:28Z", + "updated_at": "2015-05-05T23:40:28Z", + "body": "You are totally right! I'll get this fixed right away." + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func IssuesEventJSON() string { + return `{ + "action": "opened", + "issue": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2/labels{/name}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2/comments", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2/events", + "html_url": "https://github.com/baxterthehacker/public-repo/issues/2", + "id": 73464126, + "number": 2, + "title": "Spelling error in the README file", + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "labels": [ + { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/labels/bug", + "name": "bug", + "color": "fc2929" + } + ], + "state": "open", + "locked": false, + "assignee": null, + "milestone": null, + "comments": 0, + "created_at": "2015-05-05T23:40:28Z", + "updated_at": "2015-05-05T23:40:28Z", + "closed_at": null, + "body": "It looks like you accidently spelled 'commit' with two 't's." + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func MemberEventJSON() string { + return `{ + "action": "added", + "member": { + "login": "octocat", + "id": 583231, + "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/octocat", + "html_url": "https://github.com/octocat", + "followers_url": "https://api.github.com/users/octocat/followers", + "following_url": "https://api.github.com/users/octocat/following{/other_user}", + "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", + "organizations_url": "https://api.github.com/users/octocat/orgs", + "repos_url": "https://api.github.com/users/octocat/repos", + "events_url": "https://api.github.com/users/octocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/octocat/received_events", + "type": "User", + "site_admin": false + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:40Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func MembershipEventJSON() string { + return `{ + "action": "added", + "scope": "team", + "member": { + "login": "kdaigle", + "id": 2501, + "avatar_url": "https://avatars.githubusercontent.com/u/2501?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/kdaigle", + "html_url": "https://github.com/kdaigle", + "followers_url": "https://api.github.com/users/kdaigle/followers", + "following_url": "https://api.github.com/users/kdaigle/following{/other_user}", + "gists_url": "https://api.github.com/users/kdaigle/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kdaigle/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kdaigle/subscriptions", + "organizations_url": "https://api.github.com/users/kdaigle/orgs", + "repos_url": "https://api.github.com/users/kdaigle/repos", + "events_url": "https://api.github.com/users/kdaigle/events{/privacy}", + "received_events_url": "https://api.github.com/users/kdaigle/received_events", + "type": "User", + "site_admin": true + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=2", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "team": { + "name": "Contractors", + "id": 123456, + "slug": "contractors", + "permission": "admin", + "url": "https://api.github.com/teams/123456", + "members_url": "https://api.github.com/teams/123456/members{/member}", + "repositories_url": "https://api.github.com/teams/123456/repos" + }, + "organization": { + "login": "baxterandthehackers", + "id": 7649605, + "url": "https://api.github.com/orgs/baxterandthehackers", + "repos_url": "https://api.github.com/orgs/baxterandthehackers/repos", + "events_url": "https://api.github.com/orgs/baxterandthehackers/events", + "members_url": "https://api.github.com/orgs/baxterandthehackers/members{/member}", + "public_members_url": "https://api.github.com/orgs/baxterandthehackers/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=2" + } +}` +} + +func PageBuildEventJSON() string { + return `{ + "id": 15995382, + "build": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/pages/builds/15995382", + "status": "built", + "error": { + "message": null + }, + "pusher": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "commit": "053b99542c83021d6b202d1a1f5ecd5ef7084e55", + "duration": 3790, + "created_at": "2015-05-05T23:40:13Z", + "updated_at": "2015-05-05T23:40:17Z" + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:17Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 0, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func PublicEventJSON() string { + return `{ + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:41Z", + "pushed_at": "2015-05-05T23:40:40Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func PullRequestReviewCommentEventJSON() string { + return `{ + "action": "created", + "comment": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments/29724692", + "id": 29724692, + "diff_hunk": "@@ -1 +1 @@\n-# public-repo", + "path": "README.md", + "position": 1, + "original_position": 1, + "commit_id": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "original_commit_id": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "body": "Maybe you should use more emojji on this line.", + "created_at": "2015-05-05T23:40:27Z", + "updated_at": "2015-05-05T23:40:27Z", + "html_url": "https://github.com/baxterthehacker/public-repo/pull/1#discussion_r29724692", + "pull_request_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1", + "_links": { + "self": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments/29724692" + }, + "html": { + "href": "https://github.com/baxterthehacker/public-repo/pull/1#discussion_r29724692" + }, + "pull_request": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1" + } + } + }, + "pull_request": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1", + "id": 34778301, + "html_url": "https://github.com/baxterthehacker/public-repo/pull/1", + "diff_url": "https://github.com/baxterthehacker/public-repo/pull/1.diff", + "patch_url": "https://github.com/baxterthehacker/public-repo/pull/1.patch", + "issue_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1", + "number": 1, + "state": "open", + "locked": false, + "title": "Update the README with new information", + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "body": "This is a pretty simple change that we need to pull into master.", + "created_at": "2015-05-05T23:40:27Z", + "updated_at": "2015-05-05T23:40:27Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": "18721552ba489fb84e12958c1b5694b5475f7991", + "assignee": null, + "milestone": null, + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/commits", + "review_comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/comments", + "review_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1/comments", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "head": { + "label": "baxterthehacker:changes", + "ref": "changes", + "sha": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 1, + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "master" + } + }, + "base": { + "label": "baxterthehacker:master", + "ref": "master", + "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 1, + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "master" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1" + }, + "html": { + "href": "https://github.com/baxterthehacker/public-repo/pull/1" + }, + "issue": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1" + }, + "comments": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c" + } + } + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 1, + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func PullRequestEventJSON() string { + return `{ + "action": "opened", + "number": 1, + "pull_request": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1", + "id": 34778301, + "html_url": "https://github.com/baxterthehacker/public-repo/pull/1", + "diff_url": "https://github.com/baxterthehacker/public-repo/pull/1.diff", + "patch_url": "https://github.com/baxterthehacker/public-repo/pull/1.patch", + "issue_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1", + "number": 1, + "state": "open", + "locked": false, + "title": "Update the README with new information", + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "body": "This is a pretty simple change that we need to pull into master.", + "created_at": "2015-05-05T23:40:27Z", + "updated_at": "2015-05-05T23:40:27Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": null, + "assignee": null, + "milestone": null, + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/commits", + "review_comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/comments", + "review_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1/comments", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "head": { + "label": "baxterthehacker:changes", + "ref": "changes", + "sha": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:26Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 1, + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "master" + } + }, + "base": { + "label": "baxterthehacker:master", + "ref": "master", + "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", + "user": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:26Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 1, + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "master" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1" + }, + "html": { + "href": "https://github.com/baxterthehacker/public-repo/pull/1" + }, + "issue": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1" + }, + "comments": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c" + } + }, + "merged": false, + "mergeable": null, + "mergeable_state": "unknown", + "merged_by": null, + "comments": 0, + "review_comments": 0, + "commits": 1, + "additions": 1, + "deletions": 1, + "changed_files": 1 + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": "2015-05-05T23:40:26Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 1, + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func PushEventJSON() string { + return `{ + "ref": "refs/heads/changes", + "before": "9049f1265b7d61be4a8904a9a27120d2064dab3b", + "after": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "created": false, + "deleted": false, + "forced": false, + "base_ref": null, + "compare": "https://github.com/baxterthehacker/public-repo/compare/9049f1265b7d...0d1a26e67d8f", + "commits": [ + { + "id": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "distinct": true, + "message": "Update README.md", + "timestamp": "2015-05-05T19:40:15-04:00", + "url": "https://github.com/baxterthehacker/public-repo/commit/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "author": { + "name": "baxterthehacker", + "email": "baxterthehacker@users.noreply.github.com", + "username": "baxterthehacker" + }, + "committer": { + "name": "baxterthehacker", + "email": "baxterthehacker@users.noreply.github.com", + "username": "baxterthehacker" + }, + "added": [ + + ], + "removed": [ + + ], + "modified": [ + "README.md" + ] + } + ], + "head_commit": { + "id": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "distinct": true, + "message": "Update README.md", + "timestamp": "2015-05-05T19:40:15-04:00", + "url": "https://github.com/baxterthehacker/public-repo/commit/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "author": { + "name": "baxterthehacker", + "email": "baxterthehacker@users.noreply.github.com", + "username": "baxterthehacker" + }, + "committer": { + "name": "baxterthehacker", + "email": "baxterthehacker@users.noreply.github.com", + "username": "baxterthehacker" + }, + "added": [ + + ], + "removed": [ + + ], + "modified": [ + "README.md" + ] + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "name": "baxterthehacker", + "email": "baxterthehacker@users.noreply.github.com" + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://github.com/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": 1430869212, + "updated_at": "2015-05-05T23:40:12Z", + "pushed_at": 1430869217, + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 0, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "stargazers": 0, + "master_branch": "master" + }, + "pusher": { + "name": "baxterthehacker", + "email": "baxterthehacker@users.noreply.github.com" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func RepositoryEventJSON() string { + return `{ + "action": "created", + "repository": { + "id": 27496774, + "name": "new-repository", + "full_name": "baxterandthehackers/new-repository", + "owner": { + "login": "baxterandthehackers", + "id": 7649605, + "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterandthehackers", + "html_url": "https://github.com/baxterandthehackers", + "followers_url": "https://api.github.com/users/baxterandthehackers/followers", + "following_url": "https://api.github.com/users/baxterandthehackers/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterandthehackers/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterandthehackers/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterandthehackers/subscriptions", + "organizations_url": "https://api.github.com/users/baxterandthehackers/orgs", + "repos_url": "https://api.github.com/users/baxterandthehackers/repos", + "events_url": "https://api.github.com/users/baxterandthehackers/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterandthehackers/received_events", + "type": "Organization", + "site_admin": false + }, + "private": true, + "html_url": "https://github.com/baxterandthehackers/new-repository", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterandthehackers/new-repository", + "forks_url": "https://api.github.com/repos/baxterandthehackers/new-repository/forks", + "keys_url": "https://api.github.com/repos/baxterandthehackers/new-repository/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterandthehackers/new-repository/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterandthehackers/new-repository/teams", + "hooks_url": "https://api.github.com/repos/baxterandthehackers/new-repository/hooks", + "issue_events_url": "https://api.github.com/repos/baxterandthehackers/new-repository/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterandthehackers/new-repository/events", + "assignees_url": "https://api.github.com/repos/baxterandthehackers/new-repository/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterandthehackers/new-repository/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterandthehackers/new-repository/tags", + "blobs_url": "https://api.github.com/repos/baxterandthehackers/new-repository/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterandthehackers/new-repository/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterandthehackers/new-repository/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterandthehackers/new-repository/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterandthehackers/new-repository/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterandthehackers/new-repository/languages", + "stargazers_url": "https://api.github.com/repos/baxterandthehackers/new-repository/stargazers", + "contributors_url": "https://api.github.com/repos/baxterandthehackers/new-repository/contributors", + "subscribers_url": "https://api.github.com/repos/baxterandthehackers/new-repository/subscribers", + "subscription_url": "https://api.github.com/repos/baxterandthehackers/new-repository/subscription", + "commits_url": "https://api.github.com/repos/baxterandthehackers/new-repository/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterandthehackers/new-repository/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterandthehackers/new-repository/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterandthehackers/new-repository/issues/comments/{number}", + "contents_url": "https://api.github.com/repos/baxterandthehackers/new-repository/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterandthehackers/new-repository/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterandthehackers/new-repository/merges", + "archive_url": "https://api.github.com/repos/baxterandthehackers/new-repository/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterandthehackers/new-repository/downloads", + "issues_url": "https://api.github.com/repos/baxterandthehackers/new-repository/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterandthehackers/new-repository/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterandthehackers/new-repository/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterandthehackers/new-repository/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterandthehackers/new-repository/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterandthehackers/new-repository/releases{/id}", + "created_at": "2014-12-03T16:39:25Z", + "updated_at": "2014-12-03T16:39:25Z", + "pushed_at": "2014-12-03T16:39:25Z", + "git_url": "git://github.com/baxterandthehackers/new-repository.git", + "ssh_url": "git@github.com:baxterandthehackers/new-repository.git", + "clone_url": "https://github.com/baxterandthehackers/new-repository.git", + "svn_url": "https://github.com/baxterandthehackers/new-repository", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 0, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master" + }, + "organization": { + "login": "baxterandthehackers", + "id": 7649605, + "url": "https://api.github.com/orgs/baxterandthehackers", + "repos_url": "https://api.github.com/orgs/baxterandthehackers/repos", + "events_url": "https://api.github.com/orgs/baxterandthehackers/events", + "members_url": "https://api.github.com/orgs/baxterandthehackers/members{/member}", + "public_members_url": "https://api.github.com/orgs/baxterandthehackers/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=2" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=2", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func ReleaseEventJSON() string { + return `{ + "action": "published", + "release": { + "url": "https://api.github.com/repos/baxterthehacker/public-repo/releases/1261438", + "assets_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases/1261438/assets", + "upload_url": "https://uploads.github.com/repos/baxterthehacker/public-repo/releases/1261438/assets{?name}", + "html_url": "https://github.com/baxterthehacker/public-repo/releases/tag/0.0.1", + "id": 1261438, + "tag_name": "0.0.1", + "target_commitish": "master", + "name": null, + "draft": false, + "author": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "prerelease": false, + "created_at": "2015-05-05T23:40:12Z", + "published_at": "2015-05-05T23:40:38Z", + "assets": [ + + ], + "tarball_url": "https://api.github.com/repos/baxterthehacker/public-repo/tarball/0.0.1", + "zipball_url": "https://api.github.com/repos/baxterthehacker/public-repo/zipball/0.0.1", + "body": null + }, + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:38Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func StatusEventJSON() string { + return `{ + "id": 214015194, + "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", + "name": "baxterthehacker/public-repo", + "target_url": null, + "context": "default", + "description": null, + "state": "success", + "commit": { + "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", + "commit": { + "author": { + "name": "baxterthehacker", + "email": "baxterthehacker@users.noreply.github.com", + "date": "2015-05-05T23:40:12Z" + }, + "committer": { + "name": "baxterthehacker", + "email": "baxterthehacker@users.noreply.github.com", + "date": "2015-05-05T23:40:12Z" + }, + "message": "Initial commit", + "tree": { + "sha": "02b49ad0ba4f1acd9f06531b21e16a4ac5d341d0", + "url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees/02b49ad0ba4f1acd9f06531b21e16a4ac5d341d0" + }, + "url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits/9049f1265b7d61be4a8904a9a27120d2064dab3b", + "comment_count": 1 + }, + "url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/9049f1265b7d61be4a8904a9a27120d2064dab3b", + "html_url": "https://github.com/baxterthehacker/public-repo/commit/9049f1265b7d61be4a8904a9a27120d2064dab3b", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/9049f1265b7d61be4a8904a9a27120d2064dab3b/comments", + "author": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "committer": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "parents": [ + + ] + }, + "branches": [ + { + "name": "master", + "commit": { + "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", + "url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/9049f1265b7d61be4a8904a9a27120d2064dab3b" + } + }, + { + "name": "changes", + "commit": { + "sha": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", + "url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c" + } + }, + { + "name": "gh-pages", + "commit": { + "sha": "b11bb7545ac14abafc6191a0481b0d961e7793c6", + "url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/b11bb7545ac14abafc6191a0481b0d961e7793c6" + } + } + ], + "created_at": "2015-05-05T23:40:39Z", + "updated_at": "2015-05-05T23:40:39Z", + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:39Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} + +func TeamAddEventJSON() string { + return `{ + "team": { + "name": "github", + "id": 836012, + "slug": "github", + "description": "", + "permission": "pull", + "url": "https://api.github.com/teams/836012", + "members_url": "https://api.github.com/teams/836012/members{/member}", + "repositories_url": "https://api.github.com/teams/836012/repos" + }, + "repository": { + "id": 35129393, + "name": "public-repo", + "full_name": "baxterandthehackers/public-repo", + "owner": { + "login": "baxterandthehackers", + "id": 7649605, + "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterandthehackers", + "html_url": "https://github.com/baxterandthehackers", + "followers_url": "https://api.github.com/users/baxterandthehackers/followers", + "following_url": "https://api.github.com/users/baxterandthehackers/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterandthehackers/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterandthehackers/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterandthehackers/subscriptions", + "organizations_url": "https://api.github.com/users/baxterandthehackers/orgs", + "repos_url": "https://api.github.com/users/baxterandthehackers/repos", + "events_url": "https://api.github.com/users/baxterandthehackers/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterandthehackers/received_events", + "type": "Organization", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterandthehackers/public-repo", + "description": "", + "fork": true, + "url": "https://api.github.com/repos/baxterandthehackers/public-repo", + "forks_url": "https://api.github.com/repos/baxterandthehackers/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterandthehackers/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterandthehackers/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterandthehackers/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterandthehackers/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterandthehackers/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterandthehackers/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterandthehackers/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterandthehackers/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterandthehackers/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterandthehackers/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterandthehackers/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterandthehackers/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterandthehackers/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterandthehackers/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterandthehackers/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterandthehackers/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterandthehackers/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterandthehackers/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterandthehackers/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterandthehackers/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterandthehackers/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterandthehackers/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterandthehackers/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterandthehackers/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterandthehackers/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterandthehackers/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterandthehackers/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterandthehackers/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterandthehackers/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:30Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterandthehackers/public-repo.git", + "ssh_url": "git@github.com:baxterandthehackers/public-repo.git", + "clone_url": "https://github.com/baxterandthehackers/public-repo.git", + "svn_url": "https://github.com/baxterandthehackers/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 0, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master" + }, + "organization": { + "login": "baxterandthehackers", + "id": 7649605, + "url": "https://api.github.com/orgs/baxterandthehackers", + "repos_url": "https://api.github.com/orgs/baxterandthehackers/repos", + "events_url": "https://api.github.com/orgs/baxterandthehackers/events", + "members_url": "https://api.github.com/orgs/baxterandthehackers/members{/member}", + "public_members_url": "https://api.github.com/orgs/baxterandthehackers/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=3", + "description": null + }, + "sender": { + "login": "baxterandthehackers", + "id": 7649605, + "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterandthehackers", + "html_url": "https://github.com/baxterandthehackers", + "followers_url": "https://api.github.com/users/baxterandthehackers/followers", + "following_url": "https://api.github.com/users/baxterandthehackers/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterandthehackers/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterandthehackers/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterandthehackers/subscriptions", + "organizations_url": "https://api.github.com/users/baxterandthehackers/orgs", + "repos_url": "https://api.github.com/users/baxterandthehackers/repos", + "events_url": "https://api.github.com/users/baxterandthehackers/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterandthehackers/received_events", + "type": "Organization", + "site_admin": false + } +}` +} + +func WatchEventJSON() string { + return `{ + "action": "started", + "repository": { + "id": 35129377, + "name": "public-repo", + "full_name": "baxterthehacker/public-repo", + "owner": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/baxterthehacker/public-repo", + "description": "", + "fork": false, + "url": "https://api.github.com/repos/baxterthehacker/public-repo", + "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", + "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", + "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", + "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", + "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", + "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", + "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", + "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", + "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", + "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", + "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", + "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", + "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", + "created_at": "2015-05-05T23:40:12Z", + "updated_at": "2015-05-05T23:40:30Z", + "pushed_at": "2015-05-05T23:40:27Z", + "git_url": "git://github.com/baxterthehacker/public-repo.git", + "ssh_url": "git@github.com:baxterthehacker/public-repo.git", + "clone_url": "https://github.com/baxterthehacker/public-repo.git", + "svn_url": "https://github.com/baxterthehacker/public-repo", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 2, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "baxterthehacker", + "id": 6752317, + "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/baxterthehacker", + "html_url": "https://github.com/baxterthehacker", + "followers_url": "https://api.github.com/users/baxterthehacker/followers", + "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", + "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", + "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", + "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", + "repos_url": "https://api.github.com/users/baxterthehacker/repos", + "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", + "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", + "type": "User", + "site_admin": false + } +}` +} diff --git a/plugins/inputs/github_webhooks/models/models.go b/plugins/inputs/github_webhooks/models/models.go new file mode 100644 index 000000000..a499218f5 --- /dev/null +++ b/plugins/inputs/github_webhooks/models/models.go @@ -0,0 +1,711 @@ +package models + +import ( + "fmt" + "log" + "time" + + "github.com/influxdata/influxdb/client/v2" +) + +const meas = "ghWebhooks" + +type Event interface { + NewPoint() *client.Point +} + +type Repository struct { + Repository string `json:"full_name"` + Private bool `json:"private"` + Stars int `json:"stargazers_count"` + Forks int `json:"forks_count"` + Issues int `json:"open_issues_count"` +} + +type Sender struct { + User string `json:"login"` + Admin bool `json:"site_admin"` +} + +type CommitComment struct { + Commit string `json:"commit_id"` + Body string `json:"body"` +} + +type Deployment struct { + Commit string `json:"sha"` + Task string `json:"task"` + Environment string `json:"environment"` + Description string `json:"description"` +} + +type Page struct { + Name string `json:"page_name"` + Title string `json:"title"` + Action string `json:"action"` +} + +type Issue struct { + Number int `json:"number"` + Title string `json:"title"` + Comments int `json:"comments"` +} + +type IssueComment struct { + Body string `json:"body"` +} + +type Team struct { + Name string `json:"name"` +} + +type PullRequest struct { + Number int `json:"number"` + State string `json:"state"` + Title string `json:"title"` + Comments int `json:"comments"` + Commits int `json:"commits"` + Additions int `json:"additions"` + Deletions int `json:"deletions"` + ChangedFiles int `json:"changed_files"` +} + +type PullRequestReviewComment struct { + File string `json:"path"` + Comment string `json:"body"` +} + +type Release struct { + TagName string `json:"tag_name"` +} + +type DeploymentStatus struct { + State string `json:"state"` + Description string `json:"description"` +} + +type CommitCommentEvent struct { + Comment CommitComment `json:"comment"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s CommitCommentEvent) NewPoint() *client.Point { + event := "commit_comment" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "commit": s.Comment.Commit, + "comment": s.Comment.Body, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type CreateEvent struct { + Ref string `json:"ref"` + RefType string `json:"ref_type"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s CreateEvent) NewPoint() *client.Point { + event := "create" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "ref": s.Ref, + "refType": s.RefType, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type DeleteEvent struct { + Ref string `json:"ref"` + RefType string `json:"ref_type"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s DeleteEvent) NewPoint() *client.Point { + event := "delete" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "ref": s.Ref, + "refType": s.RefType, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type DeploymentEvent struct { + Deployment Deployment `json:"deployment"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s DeploymentEvent) NewPoint() *client.Point { + event := "deployment" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "commit": s.Deployment.Commit, + "task": s.Deployment.Task, + "environment": s.Deployment.Environment, + "description": s.Deployment.Description, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type DeploymentStatusEvent struct { + Deployment Deployment `json:"deployment"` + DeploymentStatus DeploymentStatus `json:"deployment_status"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s DeploymentStatusEvent) NewPoint() *client.Point { + event := "delete" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "commit": s.Deployment.Commit, + "task": s.Deployment.Task, + "environment": s.Deployment.Environment, + "description": s.Deployment.Description, + "depState": s.DeploymentStatus.State, + "depDescription": s.DeploymentStatus.Description, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type ForkEvent struct { + Forkee Repository `json:"forkee"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s ForkEvent) NewPoint() *client.Point { + event := "fork" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "fork": s.Forkee.Repository, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type GollumEvent struct { + Pages []Page `json:"pages"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +// REVIEW: Going to be lazy and not deal with the pages. +func (s GollumEvent) NewPoint() *client.Point { + event := "gollum" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type IssueCommentEvent struct { + Issue Issue `json:"issue"` + Comment IssueComment `json:"comment"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s IssueCommentEvent) NewPoint() *client.Point { + event := "issue_comment" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + "issue": fmt.Sprintf("%v", s.Issue.Number), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "title": s.Issue.Title, + "comments": s.Issue.Comments, + "body": s.Comment.Body, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type IssuesEvent struct { + Action string `json:"action"` + Issue Issue `json:"issue"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s IssuesEvent) NewPoint() *client.Point { + event := "issue" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + "issue": fmt.Sprintf("%v", s.Issue.Number), + "action": s.Action, + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "title": s.Issue.Title, + "comments": s.Issue.Comments, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type MemberEvent struct { + Member Sender `json:"member"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s MemberEvent) NewPoint() *client.Point { + event := "member" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "newMember": s.Member.User, + "newMemberStatus": s.Member.Admin, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type MembershipEvent struct { + Action string `json:"action"` + Member Sender `json:"member"` + Sender Sender `json:"sender"` + Team Team `json:"team"` +} + +func (s MembershipEvent) NewPoint() *client.Point { + event := "membership" + t := map[string]string{ + "event": event, + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + "action": s.Action, + } + f := map[string]interface{}{ + "newMember": s.Member.User, + "newMemberStatus": s.Member.Admin, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type PageBuildEvent struct { + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s PageBuildEvent) NewPoint() *client.Point { + event := "page_build" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type PublicEvent struct { + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s PublicEvent) NewPoint() *client.Point { + event := "public" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type PullRequestEvent struct { + Action string `json:"action"` + PullRequest PullRequest `json:"pull_request"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s PullRequestEvent) NewPoint() *client.Point { + event := "pull_request" + t := map[string]string{ + "event": event, + "action": s.Action, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + "prNumber": fmt.Sprintf("%v", s.PullRequest.Number), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "state": s.PullRequest.State, + "title": s.PullRequest.Title, + "comments": s.PullRequest.Comments, + "commits": s.PullRequest.Commits, + "additions": s.PullRequest.Additions, + "deletions": s.PullRequest.Deletions, + "changedFiles": s.PullRequest.ChangedFiles, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type PullRequestReviewCommentEvent struct { + Comment PullRequestReviewComment `json:"comment"` + PullRequest PullRequest `json:"pull_request"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s PullRequestReviewCommentEvent) NewPoint() *client.Point { + event := "pull_request_review_comment" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + "prNumber": fmt.Sprintf("%v", s.PullRequest.Number), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "state": s.PullRequest.State, + "title": s.PullRequest.Title, + "comments": s.PullRequest.Comments, + "commits": s.PullRequest.Commits, + "additions": s.PullRequest.Additions, + "deletions": s.PullRequest.Deletions, + "changedFiles": s.PullRequest.ChangedFiles, + "commentFile": s.Comment.File, + "comment": s.Comment.Comment, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type PushEvent struct { + Ref string `json:"ref"` + Before string `json:"before"` + After string `json:"after"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s PushEvent) NewPoint() *client.Point { + event := "push" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "Ref": s.Ref, + "Before": s.Before, + "After": s.After, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type ReleaseEvent struct { + Release Release `json:"release"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s ReleaseEvent) NewPoint() *client.Point { + event := "release" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "tagName": s.Release.TagName, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type RepositoryEvent struct { + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s RepositoryEvent) NewPoint() *client.Point { + event := "repository" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type StatusEvent struct { + Commit string `json:"sha"` + State string `json:"state"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s StatusEvent) NewPoint() *client.Point { + event := "status" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "commit": s.Commit, + "state": s.State, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type TeamAddEvent struct { + Team Team `json:"team"` + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s TeamAddEvent) NewPoint() *client.Point { + event := "team_add" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + "teamName": s.Team.Name, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} + +type WatchEvent struct { + Repository Repository `json:"repository"` + Sender Sender `json:"sender"` +} + +func (s WatchEvent) NewPoint() *client.Point { + event := "delete" + t := map[string]string{ + "event": event, + "repository": s.Repository.Repository, + "private": fmt.Sprintf("%v", s.Repository.Private), + "user": s.Sender.User, + "admin": fmt.Sprintf("%v", s.Sender.Admin), + } + f := map[string]interface{}{ + "stars": s.Repository.Stars, + "forks": s.Repository.Forks, + "issues": s.Repository.Issues, + } + p, err := client.NewPoint(meas, t, f, time.Now()) + if err != nil { + log.Fatalf("Failed to create %v event", event) + } + return p +} From 7878b22b09833659a67197e1adb7ef77f390d06f Mon Sep 17 00:00:00 2001 From: Jack Zampolin Date: Mon, 25 Jan 2016 11:42:03 -0800 Subject: [PATCH 08/10] Add README.md --- plugins/inputs/github_webhooks/README.md | 369 ++++++++++++++++++ .../inputs/github_webhooks/models/models.go | 6 +- 2 files changed, 372 insertions(+), 3 deletions(-) diff --git a/plugins/inputs/github_webhooks/README.md b/plugins/inputs/github_webhooks/README.md index e69de29bb..230e5366b 100644 --- a/plugins/inputs/github_webhooks/README.md +++ b/plugins/inputs/github_webhooks/README.md @@ -0,0 +1,369 @@ +# github_webhooks + +This is a Telegraf service plugin that listens for events kicked off by Github's Webhooks service and persists data from them into configured outputs. To set up the listener first generate the proper configuration: +```sh +$ telegraf -sample-config -input-filter github_webhooks -output-filter influxdb > config.conf.new +``` +Change the config file to point to the InfluxDB server you are using and adjust the settings to match your environment. Once that is complete: +```sh +$ cp config.conf.new /etc/telegraf/telegraf.conf +$ sudo service telegraf start +``` +Once the server is running you should configure your Organization's Webhooks to point at the `github_webhooks` service. To do this go to `github.com/{my_organization}` and click `Settings > Webhooks > Add webhook`. In the resulting menu set `Payload URL` to `http://:1618`, `Content type` to `application/json` and under the section `Which events would you like to trigger this webhook?` select 'Send me everything'. By default all of the events will write to the `github_webhooks` measurement, this is configurable by setting the `measurement_name` in the config file. + +## Events + +The titles of the following sections are links to the full payloads and details for each event. The body contains what information from the event is persisted. The format is as follows: +``` +# TAGS +* 'tagKey' = `tagValue` type +# FIELDS +* 'fieldKey' = `fieldValue` type +``` +The tag values and field values show the place on the incoming JSON object where the data is sourced from. + +#### [`commit_comment` event](https://developer.github.com/v3/activity/events/types/#commitcommentevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int +* 'commit' = `event.comment.commit_id` string +* 'comment' = `event.comment.body` string + +#### [`create` event](https://developer.github.com/v3/activity/events/types/#createevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int +* 'ref' = `event.ref` string +* 'issues' = `event.ref_type` string + +#### [`delete` event](https://developer.github.com/v3/activity/events/types/#deleteevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int +* 'ref' = `event.ref` string +* 'issues' = `event.ref_type` string + +#### [`deployment` event](https://developer.github.com/v3/activity/events/types/#deploymentevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int +* 'commit' = `event.deployment.sha` string +* 'task' = `event.deployment.task` string +* 'environment' = `event.deployment.evnironment` string +* 'description' = `event.deployment.description` string + +#### [`deployment_status` event](https://developer.github.com/v3/activity/events/types/#deploymentstatusevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int +* 'commit' = `event.deployment.sha` string +* 'task' = `event.deployment.task` string +* 'environment' = `event.deployment.evnironment` string +* 'description' = `event.deployment.description` string +* 'depState' = `event.deployment_status.state` string +* 'depDescription' = `event.deployment_status.description` string + +#### [`fork` event](https://developer.github.com/v3/activity/events/types/#forkevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int +* 'forkee' = `event.forkee.repository` string + +#### [`gollum` event](https://developer.github.com/v3/activity/events/types/#gollumevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int + +#### [`issue_comment` event](https://developer.github.com/v3/activity/events/types/#issuecommentevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool +* 'issue' = `event.issue.number` int + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int +* 'title' = `event.issue.title` string +* 'comments' = `event.issue.comments` int +* 'body' = `event.comment.body` string + +#### [`issues` event](https://developer.github.com/v3/activity/events/types/#issuesevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool +* 'issue' = `event.issue.number` int +* 'action' = `event.action` string + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int +* 'title' = `event.issue.title` string +* 'comments' = `event.issue.comments` int + +#### [`member` event](https://developer.github.com/v3/activity/events/types/#memberevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int +* 'newMember' = `event.sender.login` string +* 'newMemberStatus' = `event.sender.site_admin` bool + +#### [`membership` event](https://developer.github.com/v3/activity/events/types/#membershipevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool +* 'action' = `event.action` string + +**Fields:** +* 'newMember' = `event.sender.login` string +* 'newMemberStatus' = `event.sender.site_admin` bool + +#### [`page_build` event](https://developer.github.com/v3/activity/events/types/#pagebuildevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int + +#### [`public` event](https://developer.github.com/v3/activity/events/types/#publicevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int + +#### [`pull_request_review_comment` event](https://developer.github.com/v3/activity/events/types/#pullrequestreviewcommentevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'action' = `event.action` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool +* 'prNumber' = `event.pull_request.number` int + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int +* 'state' = `event.pull_request.state` string +* 'title' = `event.pull_request.title` string +* 'comments' = `event.pull_request.comments` int +* 'commits' = `event.pull_request.commits` int +* 'additions' = `event.pull_request.additions` int +* 'deletions' = `event.pull_request.deletions` int +* 'changedFiles' = `event.pull_request.changed_files` int +* 'commentFile' = `event.comment.file` string +* 'comment' = `event.comment.body` string + +#### [`pull_request` event](https://developer.github.com/v3/activity/events/types/#pullrequestevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'action' = `event.action` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool +* 'prNumber' = `event.pull_request.number` int + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int +* 'state' = `event.pull_request.state` string +* 'title' = `event.pull_request.title` string +* 'comments' = `event.pull_request.comments` int +* 'commits' = `event.pull_request.commits` int +* 'additions' = `event.pull_request.additions` int +* 'deletions' = `event.pull_request.deletions` int +* 'changedFiles' = `event.pull_request.changed_files` int + +#### [`push` event](https://developer.github.com/v3/activity/events/types/#pushevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int +* 'ref' = `event.ref` string +* 'before' = `event.before` string +* 'after' = `event.after` string + +#### [`repository` event](https://developer.github.com/v3/activity/events/types/#repositoryevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int + +#### [`release` event](https://developer.github.com/v3/activity/events/types/#releaseevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int +* 'tagName' = `event.release.tag_name` string + +#### [`status` event](https://developer.github.com/v3/activity/events/types/#statusevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int +* 'commit' = `event.sha` string +* 'state' = `event.state` string + +#### [`team_add` event](https://developer.github.com/v3/activity/events/types/#teamaddevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int +* 'teamName' = `event.team.name` string + +#### [`watch` event](https://developer.github.com/v3/activity/events/types/#watchevent) + +**Tags:** +* 'event' = `headers[X-Github-Event]` string +* 'repository' = `event.repository.full_name` string +* 'private' = `event.repository.private` bool +* 'user' = `event.sender.login` string +* 'admin' = `event.sender.site_admin` bool + +**Fields:** +* 'stars' = `event.repository.stargazers_count` int +* 'forks' = `event.repository.forks_count` int +* 'issues' = `event.repository.open_issues_count` int diff --git a/plugins/inputs/github_webhooks/models/models.go b/plugins/inputs/github_webhooks/models/models.go index a499218f5..1f45f7ed9 100644 --- a/plugins/inputs/github_webhooks/models/models.go +++ b/plugins/inputs/github_webhooks/models/models.go @@ -561,9 +561,9 @@ func (s PushEvent) NewPoint() *client.Point { "stars": s.Repository.Stars, "forks": s.Repository.Forks, "issues": s.Repository.Issues, - "Ref": s.Ref, - "Before": s.Before, - "After": s.After, + "ref": s.Ref, + "before": s.Before, + "after": s.After, } p, err := client.NewPoint(meas, t, f, time.Now()) if err != nil { From a70452219bcf92dbcf91cf7838dd414019f80dd6 Mon Sep 17 00:00:00 2001 From: Jack Zampolin Date: Mon, 25 Jan 2016 17:28:28 -0800 Subject: [PATCH 09/10] Remove internal dependancy --- Godeps | 1 - .../inputs/github_webhooks/github_webhooks.go | 91 +++++++++---------- ...k_json.go => github_webhooks_mock_json.go} | 2 +- .../models.go => github_webhooks_models.go} | 4 +- .../github_webhooks/github_webhooks_test.go | 40 ++++---- 5 files changed, 67 insertions(+), 71 deletions(-) rename plugins/inputs/github_webhooks/{models/mock_json.go => github_webhooks_mock_json.go} (99%) rename plugins/inputs/github_webhooks/{models/models.go => github_webhooks_models.go} (99%) diff --git a/Godeps b/Godeps index 6daa3709b..e4b0ad815 100644 --- a/Godeps +++ b/Godeps @@ -26,7 +26,6 @@ github.com/hashicorp/raft b95f335efee1992886864389183ebda0c0a5d0f6 github.com/hashicorp/raft-boltdb d1e82c1ec3f15ee991f7cc7ffd5b67ff6f5bbaee github.com/influxdata/influxdb 0e0f85a0c1fd1788ae4f9145531b02c539cfa5b5 github.com/influxdb/influxdb c1d6c14c47dfb4d60878a979fbdd8b526281d3d6 -github.com/influxdb/telegraf d3a5cca1bc18f315dacbd9941f1e4556fde86538 github.com/jmespath/go-jmespath c01cf91b011868172fdcd9f41838e80c9d716264 github.com/klauspost/crc32 999f3125931f6557b991b2f8472172bdfa578d38 github.com/lib/pq 8ad2b298cadd691a77015666a5372eae5dbfac8f diff --git a/plugins/inputs/github_webhooks/github_webhooks.go b/plugins/inputs/github_webhooks/github_webhooks.go index ba83bef4c..0663c9dea 100644 --- a/plugins/inputs/github_webhooks/github_webhooks.go +++ b/plugins/inputs/github_webhooks/github_webhooks.go @@ -10,7 +10,6 @@ import ( "github.com/gorilla/mux" "github.com/influxdata/telegraf/plugins/inputs" - mod "github.com/influxdata/telegraf/plugins/inputs/github_webhooks/models" ) func init() { @@ -23,7 +22,7 @@ type GithubWebhooks struct { // Lock for the struct sync.Mutex // Events buffer to store events between Gather calls - events []mod.Event + events []Event } func NewGithubWebhooks() *GithubWebhooks { @@ -51,7 +50,7 @@ func (gh *GithubWebhooks) Gather(acc inputs.Accumulator) error { p := event.NewPoint() acc.AddFields(gh.MeasurementName, p.Fields(), p.Tags(), p.Time()) } - gh.events = make([]mod.Event, 0) + gh.events = make([]Event, 0) return nil } @@ -91,8 +90,8 @@ func (gh *GithubWebhooks) eventHandler(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) } -func newCommitComment(data []byte) (mod.Event, error) { - commitCommentStruct := mod.CommitCommentEvent{} +func newCommitComment(data []byte) (Event, error) { + commitCommentStruct := CommitCommentEvent{} err := json.Unmarshal(data, &commitCommentStruct) if err != nil { return nil, err @@ -100,8 +99,8 @@ func newCommitComment(data []byte) (mod.Event, error) { return commitCommentStruct, nil } -func newCreate(data []byte) (mod.Event, error) { - createStruct := mod.CreateEvent{} +func newCreate(data []byte) (Event, error) { + createStruct := CreateEvent{} err := json.Unmarshal(data, &createStruct) if err != nil { return nil, err @@ -109,8 +108,8 @@ func newCreate(data []byte) (mod.Event, error) { return createStruct, nil } -func newDelete(data []byte) (mod.Event, error) { - deleteStruct := mod.DeleteEvent{} +func newDelete(data []byte) (Event, error) { + deleteStruct := DeleteEvent{} err := json.Unmarshal(data, &deleteStruct) if err != nil { return nil, err @@ -118,8 +117,8 @@ func newDelete(data []byte) (mod.Event, error) { return deleteStruct, nil } -func newDeployment(data []byte) (mod.Event, error) { - deploymentStruct := mod.DeploymentEvent{} +func newDeployment(data []byte) (Event, error) { + deploymentStruct := DeploymentEvent{} err := json.Unmarshal(data, &deploymentStruct) if err != nil { return nil, err @@ -127,8 +126,8 @@ func newDeployment(data []byte) (mod.Event, error) { return deploymentStruct, nil } -func newDeploymentStatus(data []byte) (mod.Event, error) { - deploymentStatusStruct := mod.DeploymentStatusEvent{} +func newDeploymentStatus(data []byte) (Event, error) { + deploymentStatusStruct := DeploymentStatusEvent{} err := json.Unmarshal(data, &deploymentStatusStruct) if err != nil { return nil, err @@ -136,8 +135,8 @@ func newDeploymentStatus(data []byte) (mod.Event, error) { return deploymentStatusStruct, nil } -func newFork(data []byte) (mod.Event, error) { - forkStruct := mod.ForkEvent{} +func newFork(data []byte) (Event, error) { + forkStruct := ForkEvent{} err := json.Unmarshal(data, &forkStruct) if err != nil { return nil, err @@ -145,8 +144,8 @@ func newFork(data []byte) (mod.Event, error) { return forkStruct, nil } -func newGollum(data []byte) (mod.Event, error) { - gollumStruct := mod.GollumEvent{} +func newGollum(data []byte) (Event, error) { + gollumStruct := GollumEvent{} err := json.Unmarshal(data, &gollumStruct) if err != nil { return nil, err @@ -154,8 +153,8 @@ func newGollum(data []byte) (mod.Event, error) { return gollumStruct, nil } -func newIssueComment(data []byte) (mod.Event, error) { - issueCommentStruct := mod.IssueCommentEvent{} +func newIssueComment(data []byte) (Event, error) { + issueCommentStruct := IssueCommentEvent{} err := json.Unmarshal(data, &issueCommentStruct) if err != nil { return nil, err @@ -163,8 +162,8 @@ func newIssueComment(data []byte) (mod.Event, error) { return issueCommentStruct, nil } -func newIssues(data []byte) (mod.Event, error) { - issuesStruct := mod.IssuesEvent{} +func newIssues(data []byte) (Event, error) { + issuesStruct := IssuesEvent{} err := json.Unmarshal(data, &issuesStruct) if err != nil { return nil, err @@ -172,8 +171,8 @@ func newIssues(data []byte) (mod.Event, error) { return issuesStruct, nil } -func newMember(data []byte) (mod.Event, error) { - memberStruct := mod.MemberEvent{} +func newMember(data []byte) (Event, error) { + memberStruct := MemberEvent{} err := json.Unmarshal(data, &memberStruct) if err != nil { return nil, err @@ -181,8 +180,8 @@ func newMember(data []byte) (mod.Event, error) { return memberStruct, nil } -func newMembership(data []byte) (mod.Event, error) { - membershipStruct := mod.MembershipEvent{} +func newMembership(data []byte) (Event, error) { + membershipStruct := MembershipEvent{} err := json.Unmarshal(data, &membershipStruct) if err != nil { return nil, err @@ -190,8 +189,8 @@ func newMembership(data []byte) (mod.Event, error) { return membershipStruct, nil } -func newPageBuild(data []byte) (mod.Event, error) { - pageBuildEvent := mod.PageBuildEvent{} +func newPageBuild(data []byte) (Event, error) { + pageBuildEvent := PageBuildEvent{} err := json.Unmarshal(data, &pageBuildEvent) if err != nil { return nil, err @@ -199,8 +198,8 @@ func newPageBuild(data []byte) (mod.Event, error) { return pageBuildEvent, nil } -func newPublic(data []byte) (mod.Event, error) { - publicEvent := mod.PublicEvent{} +func newPublic(data []byte) (Event, error) { + publicEvent := PublicEvent{} err := json.Unmarshal(data, &publicEvent) if err != nil { return nil, err @@ -208,8 +207,8 @@ func newPublic(data []byte) (mod.Event, error) { return publicEvent, nil } -func newPullRequest(data []byte) (mod.Event, error) { - pullRequestStruct := mod.PullRequestEvent{} +func newPullRequest(data []byte) (Event, error) { + pullRequestStruct := PullRequestEvent{} err := json.Unmarshal(data, &pullRequestStruct) if err != nil { return nil, err @@ -217,8 +216,8 @@ func newPullRequest(data []byte) (mod.Event, error) { return pullRequestStruct, nil } -func newPullRequestReviewComment(data []byte) (mod.Event, error) { - pullRequestReviewCommentStruct := mod.PullRequestReviewCommentEvent{} +func newPullRequestReviewComment(data []byte) (Event, error) { + pullRequestReviewCommentStruct := PullRequestReviewCommentEvent{} err := json.Unmarshal(data, &pullRequestReviewCommentStruct) if err != nil { return nil, err @@ -226,8 +225,8 @@ func newPullRequestReviewComment(data []byte) (mod.Event, error) { return pullRequestReviewCommentStruct, nil } -func newPush(data []byte) (mod.Event, error) { - pushStruct := mod.PushEvent{} +func newPush(data []byte) (Event, error) { + pushStruct := PushEvent{} err := json.Unmarshal(data, &pushStruct) if err != nil { return nil, err @@ -235,8 +234,8 @@ func newPush(data []byte) (mod.Event, error) { return pushStruct, nil } -func newRelease(data []byte) (mod.Event, error) { - releaseStruct := mod.ReleaseEvent{} +func newRelease(data []byte) (Event, error) { + releaseStruct := ReleaseEvent{} err := json.Unmarshal(data, &releaseStruct) if err != nil { return nil, err @@ -244,8 +243,8 @@ func newRelease(data []byte) (mod.Event, error) { return releaseStruct, nil } -func newRepository(data []byte) (mod.Event, error) { - repositoryStruct := mod.RepositoryEvent{} +func newRepository(data []byte) (Event, error) { + repositoryStruct := RepositoryEvent{} err := json.Unmarshal(data, &repositoryStruct) if err != nil { return nil, err @@ -253,8 +252,8 @@ func newRepository(data []byte) (mod.Event, error) { return repositoryStruct, nil } -func newStatus(data []byte) (mod.Event, error) { - statusStruct := mod.StatusEvent{} +func newStatus(data []byte) (Event, error) { + statusStruct := StatusEvent{} err := json.Unmarshal(data, &statusStruct) if err != nil { return nil, err @@ -262,8 +261,8 @@ func newStatus(data []byte) (mod.Event, error) { return statusStruct, nil } -func newTeamAdd(data []byte) (mod.Event, error) { - teamAddStruct := mod.TeamAddEvent{} +func newTeamAdd(data []byte) (Event, error) { + teamAddStruct := TeamAddEvent{} err := json.Unmarshal(data, &teamAddStruct) if err != nil { return nil, err @@ -271,8 +270,8 @@ func newTeamAdd(data []byte) (mod.Event, error) { return teamAddStruct, nil } -func newWatch(data []byte) (mod.Event, error) { - watchStruct := mod.WatchEvent{} +func newWatch(data []byte) (Event, error) { + watchStruct := WatchEvent{} err := json.Unmarshal(data, &watchStruct) if err != nil { return nil, err @@ -288,7 +287,7 @@ func (e *newEventError) Error() string { return e.s } -func NewEvent(r []byte, t string) (mod.Event, error) { +func NewEvent(r []byte, t string) (Event, error) { log.Printf("New %v event recieved", t) switch t { case "commit_comment": diff --git a/plugins/inputs/github_webhooks/models/mock_json.go b/plugins/inputs/github_webhooks/github_webhooks_mock_json.go similarity index 99% rename from plugins/inputs/github_webhooks/models/mock_json.go rename to plugins/inputs/github_webhooks/github_webhooks_mock_json.go index 91c59cc22..386d62e65 100644 --- a/plugins/inputs/github_webhooks/models/mock_json.go +++ b/plugins/inputs/github_webhooks/github_webhooks_mock_json.go @@ -1,4 +1,4 @@ -package models +package github_webhooks func CommitCommentEventJSON() string { return `{ diff --git a/plugins/inputs/github_webhooks/models/models.go b/plugins/inputs/github_webhooks/github_webhooks_models.go similarity index 99% rename from plugins/inputs/github_webhooks/models/models.go rename to plugins/inputs/github_webhooks/github_webhooks_models.go index 1f45f7ed9..16acad6b5 100644 --- a/plugins/inputs/github_webhooks/models/models.go +++ b/plugins/inputs/github_webhooks/github_webhooks_models.go @@ -1,4 +1,4 @@ -package models +package github_webhooks import ( "fmt" @@ -8,7 +8,7 @@ import ( "github.com/influxdata/influxdb/client/v2" ) -const meas = "ghWebhooks" +const meas = "github_webhooks" type Event interface { NewPoint() *client.Point diff --git a/plugins/inputs/github_webhooks/github_webhooks_test.go b/plugins/inputs/github_webhooks/github_webhooks_test.go index f2907cb90..7b0631990 100644 --- a/plugins/inputs/github_webhooks/github_webhooks_test.go +++ b/plugins/inputs/github_webhooks/github_webhooks_test.go @@ -5,13 +5,11 @@ import ( "net/http/httptest" "strings" "testing" - - mod "github.com/influxdata/telegraf/plugins/inputs/github_webhooks/models" ) func TestCommitCommentEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.CommitCommentEventJSON() + jsonString := CommitCommentEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "commit_comment") w := httptest.NewRecorder() @@ -23,7 +21,7 @@ func TestCommitCommentEvent(t *testing.T) { func TestDeleteEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.DeleteEventJSON() + jsonString := DeleteEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "delete") w := httptest.NewRecorder() @@ -35,7 +33,7 @@ func TestDeleteEvent(t *testing.T) { func TestDeploymentEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.DeploymentEventJSON() + jsonString := DeploymentEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "deployment") w := httptest.NewRecorder() @@ -47,7 +45,7 @@ func TestDeploymentEvent(t *testing.T) { func TestDeploymentStatusEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.DeploymentStatusEventJSON() + jsonString := DeploymentStatusEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "deployment_status") w := httptest.NewRecorder() @@ -59,7 +57,7 @@ func TestDeploymentStatusEvent(t *testing.T) { func TestForkEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.ForkEventJSON() + jsonString := ForkEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "fork") w := httptest.NewRecorder() @@ -71,7 +69,7 @@ func TestForkEvent(t *testing.T) { func TestGollumEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.GollumEventJSON() + jsonString := GollumEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "gollum") w := httptest.NewRecorder() @@ -83,7 +81,7 @@ func TestGollumEvent(t *testing.T) { func TestIssueCommentEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.IssueCommentEventJSON() + jsonString := IssueCommentEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "issue_comment") w := httptest.NewRecorder() @@ -95,7 +93,7 @@ func TestIssueCommentEvent(t *testing.T) { func TestIssuesEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.IssuesEventJSON() + jsonString := IssuesEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "issues") w := httptest.NewRecorder() @@ -107,7 +105,7 @@ func TestIssuesEvent(t *testing.T) { func TestMemberEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.MemberEventJSON() + jsonString := MemberEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "member") w := httptest.NewRecorder() @@ -119,7 +117,7 @@ func TestMemberEvent(t *testing.T) { func TestMembershipEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.MembershipEventJSON() + jsonString := MembershipEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "membership") w := httptest.NewRecorder() @@ -131,7 +129,7 @@ func TestMembershipEvent(t *testing.T) { func TestPageBuildEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.PageBuildEventJSON() + jsonString := PageBuildEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "page_build") w := httptest.NewRecorder() @@ -143,7 +141,7 @@ func TestPageBuildEvent(t *testing.T) { func TestPublicEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.PublicEventJSON() + jsonString := PublicEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "public") w := httptest.NewRecorder() @@ -155,7 +153,7 @@ func TestPublicEvent(t *testing.T) { func TestPullRequestReviewCommentEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.PullRequestReviewCommentEventJSON() + jsonString := PullRequestReviewCommentEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "pull_request_review_comment") w := httptest.NewRecorder() @@ -167,7 +165,7 @@ func TestPullRequestReviewCommentEvent(t *testing.T) { func TestPushEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.PushEventJSON() + jsonString := PushEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "push") w := httptest.NewRecorder() @@ -179,7 +177,7 @@ func TestPushEvent(t *testing.T) { func TestReleaseEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.ReleaseEventJSON() + jsonString := ReleaseEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "release") w := httptest.NewRecorder() @@ -191,7 +189,7 @@ func TestReleaseEvent(t *testing.T) { func TestRepositoryEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.RepositoryEventJSON() + jsonString := RepositoryEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "repository") w := httptest.NewRecorder() @@ -204,7 +202,7 @@ func TestRepositoryEvent(t *testing.T) { func TestStatusEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.StatusEventJSON() + jsonString := StatusEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "status") w := httptest.NewRecorder() @@ -216,7 +214,7 @@ func TestStatusEvent(t *testing.T) { func TestTeamAddEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.TeamAddEventJSON() + jsonString := TeamAddEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "team_add") w := httptest.NewRecorder() @@ -228,7 +226,7 @@ func TestTeamAddEvent(t *testing.T) { func TestWatchEvent(t *testing.T) { gh := NewGithubWebhooks() - jsonString := mod.WatchEventJSON() + jsonString := WatchEventJSON() req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) req.Header.Add("X-Github-Event", "watch") w := httptest.NewRecorder() From 4c74a2dd3a2a88fac43cbd178fb04c356146fbc1 Mon Sep 17 00:00:00 2001 From: Jack Zampolin Date: Mon, 25 Jan 2016 17:34:44 -0800 Subject: [PATCH 10/10] Fix naming issue --- plugins/inputs/ghwebhooks/github_webhooks.go | 338 -- .../inputs/ghwebhooks/github_webhooks_test.go | 239 -- plugins/inputs/ghwebhooks/models/mock_json.go | 3559 ----------------- plugins/inputs/ghwebhooks/models/models.go | 711 ---- 4 files changed, 4847 deletions(-) delete mode 100644 plugins/inputs/ghwebhooks/github_webhooks.go delete mode 100644 plugins/inputs/ghwebhooks/github_webhooks_test.go delete mode 100644 plugins/inputs/ghwebhooks/models/mock_json.go delete mode 100644 plugins/inputs/ghwebhooks/models/models.go diff --git a/plugins/inputs/ghwebhooks/github_webhooks.go b/plugins/inputs/ghwebhooks/github_webhooks.go deleted file mode 100644 index 177b04c75..000000000 --- a/plugins/inputs/ghwebhooks/github_webhooks.go +++ /dev/null @@ -1,338 +0,0 @@ -package github_webhooks - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "log" - "net/http" - "sync" - - "github.com/gorilla/mux" - "github.com/influxdata/telegraf/plugins/inputs" - mod "github.com/influxdata/telegraf/plugins/inputs/ghWebhooks/models" -) - -func init() { - inputs.Add("github_webhooks", func() inputs.Input { return &GithubWebhooks{} }) -} - -type GithubWebhooks struct { - ServiceAddress string - MeasurementName string - // Lock for the struct - sync.Mutex - // Events buffer to store events between Gather calls - events []mod.Event -} - -func NewGithubWebhooks() *GithubWebhooks { - return &GithubWebhooks{} -} - -func (gh *GithubWebhooks) SampleConfig() string { - return ` - # Address and port to host Webhook listener on - service_address = ":1618" - # Measurement name - measurement_name = "github_webhooks" -` -} - -func (gh *GithubWebhooks) Description() string { - return "A Github Webhook Event collector" -} - -// Writes the points from <-gh.in to the Accumulator -func (gh *GithubWebhooks) Gather(acc inputs.Accumulator) error { - gh.Lock() - defer gh.Unlock() - for _, event := range gh.events { - p := event.NewPoint() - acc.AddFields(gh.MeasurementName, p.Fields(), p.Tags(), p.Time()) - } - gh.events = make([]mod.Event, 0) - return nil -} - -func (gh *GithubWebhooks) Listen() { - r := mux.NewRouter() - r.HandleFunc("/", gh.eventHandler).Methods("POST") - err := http.ListenAndServe(fmt.Sprintf("%s", gh.ServiceAddress), r) - if err != nil { - log.Printf("Error starting server: %v", err) - } -} - -func (gh *GithubWebhooks) Start() error { - go gh.Listen() - log.Printf("Started the github_webhooks service on %s\n", gh.ServiceAddress) - return nil -} - -func (gh *GithubWebhooks) Stop() { - log.Println("Stopping the ghWebhooks service") -} - -// Handles the / route -func (gh *GithubWebhooks) eventHandler(w http.ResponseWriter, r *http.Request) { - eventType := r.Header["X-Github-Event"][0] - data, err := ioutil.ReadAll(r.Body) - if err != nil { - w.WriteHeader(http.StatusBadRequest) - } - e, err := NewEvent(data, eventType) - if err != nil { - w.WriteHeader(http.StatusBadRequest) - } - gh.Lock() - gh.events = append(gh.events, e) - gh.Unlock() - w.WriteHeader(http.StatusOK) -} - -func newCommitComment(data []byte) (mod.Event, error) { - commitCommentStruct := mod.CommitCommentEvent{} - err := json.Unmarshal(data, &commitCommentStruct) - if err != nil { - return nil, err - } - return commitCommentStruct, nil -} - -func newCreate(data []byte) (mod.Event, error) { - createStruct := mod.CreateEvent{} - err := json.Unmarshal(data, &createStruct) - if err != nil { - return nil, err - } - return createStruct, nil -} - -func newDelete(data []byte) (mod.Event, error) { - deleteStruct := mod.DeleteEvent{} - err := json.Unmarshal(data, &deleteStruct) - if err != nil { - return nil, err - } - return deleteStruct, nil -} - -func newDeployment(data []byte) (mod.Event, error) { - deploymentStruct := mod.DeploymentEvent{} - err := json.Unmarshal(data, &deploymentStruct) - if err != nil { - return nil, err - } - return deploymentStruct, nil -} - -func newDeploymentStatus(data []byte) (mod.Event, error) { - deploymentStatusStruct := mod.DeploymentStatusEvent{} - err := json.Unmarshal(data, &deploymentStatusStruct) - if err != nil { - return nil, err - } - return deploymentStatusStruct, nil -} - -func newFork(data []byte) (mod.Event, error) { - forkStruct := mod.ForkEvent{} - err := json.Unmarshal(data, &forkStruct) - if err != nil { - return nil, err - } - return forkStruct, nil -} - -func newGollum(data []byte) (mod.Event, error) { - gollumStruct := mod.GollumEvent{} - err := json.Unmarshal(data, &gollumStruct) - if err != nil { - return nil, err - } - return gollumStruct, nil -} - -func newIssueComment(data []byte) (mod.Event, error) { - issueCommentStruct := mod.IssueCommentEvent{} - err := json.Unmarshal(data, &issueCommentStruct) - if err != nil { - return nil, err - } - return issueCommentStruct, nil -} - -func newIssues(data []byte) (mod.Event, error) { - issuesStruct := mod.IssuesEvent{} - err := json.Unmarshal(data, &issuesStruct) - if err != nil { - return nil, err - } - return issuesStruct, nil -} - -func newMember(data []byte) (mod.Event, error) { - memberStruct := mod.MemberEvent{} - err := json.Unmarshal(data, &memberStruct) - if err != nil { - return nil, err - } - return memberStruct, nil -} - -func newMembership(data []byte) (mod.Event, error) { - membershipStruct := mod.MembershipEvent{} - err := json.Unmarshal(data, &membershipStruct) - if err != nil { - return nil, err - } - return membershipStruct, nil -} - -func newPageBuild(data []byte) (mod.Event, error) { - pageBuildEvent := mod.PageBuildEvent{} - err := json.Unmarshal(data, &pageBuildEvent) - if err != nil { - return nil, err - } - return pageBuildEvent, nil -} - -func newPublic(data []byte) (mod.Event, error) { - publicEvent := mod.PublicEvent{} - err := json.Unmarshal(data, &publicEvent) - if err != nil { - return nil, err - } - return publicEvent, nil -} - -func newPullRequest(data []byte) (mod.Event, error) { - pullRequestStruct := mod.PullRequestEvent{} - err := json.Unmarshal(data, &pullRequestStruct) - if err != nil { - return nil, err - } - return pullRequestStruct, nil -} - -func newPullRequestReviewComment(data []byte) (mod.Event, error) { - pullRequestReviewCommentStruct := mod.PullRequestReviewCommentEvent{} - err := json.Unmarshal(data, &pullRequestReviewCommentStruct) - if err != nil { - return nil, err - } - return pullRequestReviewCommentStruct, nil -} - -func newPush(data []byte) (mod.Event, error) { - pushStruct := mod.PushEvent{} - err := json.Unmarshal(data, &pushStruct) - if err != nil { - return nil, err - } - return pushStruct, nil -} - -func newRelease(data []byte) (mod.Event, error) { - releaseStruct := mod.ReleaseEvent{} - err := json.Unmarshal(data, &releaseStruct) - if err != nil { - return nil, err - } - return releaseStruct, nil -} - -func newRepository(data []byte) (mod.Event, error) { - repositoryStruct := mod.RepositoryEvent{} - err := json.Unmarshal(data, &repositoryStruct) - if err != nil { - return nil, err - } - return repositoryStruct, nil -} - -func newStatus(data []byte) (mod.Event, error) { - statusStruct := mod.StatusEvent{} - err := json.Unmarshal(data, &statusStruct) - if err != nil { - return nil, err - } - return statusStruct, nil -} - -func newTeamAdd(data []byte) (mod.Event, error) { - teamAddStruct := mod.TeamAddEvent{} - err := json.Unmarshal(data, &teamAddStruct) - if err != nil { - return nil, err - } - return teamAddStruct, nil -} - -func newWatch(data []byte) (mod.Event, error) { - watchStruct := mod.WatchEvent{} - err := json.Unmarshal(data, &watchStruct) - if err != nil { - return nil, err - } - return watchStruct, nil -} - -type newEventError struct { - s string -} - -func (e *newEventError) Error() string { - return e.s -} - -func NewEvent(r []byte, t string) (mod.Event, error) { - log.Printf("New %v event recieved", t) - switch t { - case "commit_comment": - return newCommitComment(r) - case "create": - return newCreate(r) - case "delete": - return newDelete(r) - case "deployment": - return newDeployment(r) - case "deployment_status": - return newDeploymentStatus(r) - case "fork": - return newFork(r) - case "gollum": - return newGollum(r) - case "issue_comment": - return newIssueComment(r) - case "issues": - return newIssues(r) - case "member": - return newMember(r) - case "membership": - return newMembership(r) - case "page_build": - return newPageBuild(r) - case "public": - return newPublic(r) - case "pull_request": - return newPullRequest(r) - case "pull_request_review_comment": - return newPullRequestReviewComment(r) - case "push": - return newPush(r) - case "release": - return newRelease(r) - case "repository": - return newRepository(r) - case "status": - return newStatus(r) - case "team_add": - return newTeamAdd(r) - case "watch": - return newWatch(r) - } - return nil, &newEventError{"Not a recgonized event type"} -} diff --git a/plugins/inputs/ghwebhooks/github_webhooks_test.go b/plugins/inputs/ghwebhooks/github_webhooks_test.go deleted file mode 100644 index 873e2d2f7..000000000 --- a/plugins/inputs/ghwebhooks/github_webhooks_test.go +++ /dev/null @@ -1,239 +0,0 @@ -package github_webhooks - -import ( - "net/http" - "net/http/httptest" - "strings" - "testing" - - mod "github.com/influxdata/telegraf/plugins/inputs/ghwebhooks/models" -) - -func TestCommitCommentEvent(t *testing.T) { - gh := NewGithubWebhooks() - jsonString := mod.CommitCommentEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "commit_comment") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} - -func TestDeleteEvent(t *testing.T) { - gh := NewGithubWebhooks() - jsonString := mod.DeleteEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "delete") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} - -func TestDeploymentEvent(t *testing.T) { - gh := NewGithubWebhooks() - jsonString := mod.DeploymentEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "deployment") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} - -func TestDeploymentStatusEvent(t *testing.T) { - gh := NewGithubWebhooks() - jsonString := mod.DeploymentStatusEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "deployment_status") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} - -func TestForkEvent(t *testing.T) { - gh := NewGithubWebhooks() - jsonString := mod.ForkEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "fork") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} - -func TestGollumEvent(t *testing.T) { - gh := NewGithubWebhooks() - jsonString := mod.GollumEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "gollum") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} - -func TestIssueCommentEvent(t *testing.T) { - gh := NewGithubWebhooks() - jsonString := mod.IssueCommentEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "issue_comment") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} - -func TestIssuesEvent(t *testing.T) { - gh := NewGithubWebhooks() - jsonString := mod.IssuesEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "issues") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} - -func TestMemberEvent(t *testing.T) { - gh := NewGithubWebhooks() - jsonString := mod.MemberEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "member") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} - -func TestMembershipEvent(t *testing.T) { - gh := NewGithubWebhooks() - jsonString := mod.MembershipEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "membership") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} - -func TestPageBuildEvent(t *testing.T) { - gh := NewGithubWebhooks() - jsonString := mod.PageBuildEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "page_build") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} - -func TestPublicEvent(t *testing.T) { - gh := NewGithubWebhooks() - jsonString := mod.PublicEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "public") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} - -func TestPullRequestReviewCommentEvent(t *testing.T) { - gh := NewGithubWebhooks() - jsonString := mod.PullRequestReviewCommentEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "pull_request_review_comment") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} - -func TestPushEvent(t *testing.T) { - gh := NewGithubWebhooks() - jsonString := mod.PushEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "push") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} - -func TestReleaseEvent(t *testing.T) { - gh := NewGithubWebhooks() - jsonString := mod.ReleaseEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "release") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} - -func TestRepositoryEvent(t *testing.T) { - gh := NewGithubWebhooks() - jsonString := mod.RepositoryEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "repository") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} - -func TestStatusEvent(t *testing.T) { - gh := NewGithubWebhooks() - - jsonString := mod.StatusEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "status") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} - -func TestTeamAddEvent(t *testing.T) { - gh := NewGithubWebhooks() - jsonString := mod.TeamAddEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "team_add") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} - -func TestWatchEvent(t *testing.T) { - gh := NewGithubWebhooks() - jsonString := mod.WatchEventJSON() - req, _ := http.NewRequest("POST", "/", strings.NewReader(jsonString)) - req.Header.Add("X-Github-Event", "watch") - w := httptest.NewRecorder() - gh.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST commit_comment returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } -} diff --git a/plugins/inputs/ghwebhooks/models/mock_json.go b/plugins/inputs/ghwebhooks/models/mock_json.go deleted file mode 100644 index 91c59cc22..000000000 --- a/plugins/inputs/ghwebhooks/models/mock_json.go +++ /dev/null @@ -1,3559 +0,0 @@ -package models - -func CommitCommentEventJSON() string { - return `{ - "action": "created", - "comment": { - "url": "https://api.github.com/repos/baxterthehacker/public-repo/comments/11056394", - "html_url": "https://github.com/baxterthehacker/public-repo/commit/9049f1265b7d61be4a8904a9a27120d2064dab3b#commitcomment-11056394", - "id": 11056394, - "user": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "position": null, - "line": null, - "path": null, - "commit_id": "9049f1265b7d61be4a8904a9a27120d2064dab3b", - "created_at": "2015-05-05T23:40:29Z", - "updated_at": "2015-05-05T23:40:29Z", - "body": "This is a really good change! :+1:" - }, - "repository": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:12Z", - "pushed_at": "2015-05-05T23:40:27Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 2, - "forks": 0, - "open_issues": 2, - "watchers": 0, - "default_branch": "master" - }, - "sender": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - } -}` -} - -func CreateEventJSON() string { - return `{ - "ref": "0.0.1", - "ref_type": "tag", - "master_branch": "master", - "description": "", - "pusher_type": "user", - "repository": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:30Z", - "pushed_at": "2015-05-05T23:40:38Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 2, - "forks": 0, - "open_issues": 2, - "watchers": 0, - "default_branch": "master" - }, - "sender": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - } -}` -} - -func DeleteEventJSON() string { - return `{ - "ref": "simple-tag", - "ref_type": "tag", - "pusher_type": "user", - "repository": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:30Z", - "pushed_at": "2015-05-05T23:40:40Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 2, - "forks": 0, - "open_issues": 2, - "watchers": 0, - "default_branch": "master" - }, - "sender": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - } -}` -} - -func DeploymentEventJSON() string { - return `{ - "deployment": { - "url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692", - "id": 710692, - "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", - "ref": "master", - "task": "deploy", - "payload": { - }, - "environment": "production", - "description": null, - "creator": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "created_at": "2015-05-05T23:40:38Z", - "updated_at": "2015-05-05T23:40:38Z", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692/statuses", - "repository_url": "https://api.github.com/repos/baxterthehacker/public-repo" - }, - "repository": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:30Z", - "pushed_at": "2015-05-05T23:40:38Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 2, - "forks": 0, - "open_issues": 2, - "watchers": 0, - "default_branch": "master" - }, - "sender": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - } -}` -} - -func DeploymentStatusEventJSON() string { - return `{ - "deployment": { - "url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692", - "id": 710692, - "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", - "ref": "master", - "task": "deploy", - "payload": { - }, - "environment": "production", - "description": null, - "creator": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "created_at": "2015-05-05T23:40:38Z", - "updated_at": "2015-05-05T23:40:38Z", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692/statuses", - "repository_url": "https://api.github.com/repos/baxterthehacker/public-repo" - }, - "deployment_status": { - "url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692/statuses/1115122", - "id": 1115122, - "state": "success", - "creator": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "description": null, - "target_url": null, - "created_at": "2015-05-05T23:40:39Z", - "updated_at": "2015-05-05T23:40:39Z", - "deployment_url": "https://api.github.com/repos/baxterthehacker/public-repo/deployments/710692", - "repository_url": "https://api.github.com/repos/baxterthehacker/public-repo" - }, - "repository": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:30Z", - "pushed_at": "2015-05-05T23:40:38Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 2, - "forks": 0, - "open_issues": 2, - "watchers": 0, - "default_branch": "master" - }, - "sender": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - } -} -` -} - -func ForkEventJSON() string { - return `{ - "forkee": { - "id": 35129393, - "name": "public-repo", - "full_name": "baxterandthehackers/public-repo", - "owner": { - "login": "baxterandthehackers", - "id": 7649605, - "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterandthehackers", - "html_url": "https://github.com/baxterandthehackers", - "followers_url": "https://api.github.com/users/baxterandthehackers/followers", - "following_url": "https://api.github.com/users/baxterandthehackers/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterandthehackers/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterandthehackers/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterandthehackers/subscriptions", - "organizations_url": "https://api.github.com/users/baxterandthehackers/orgs", - "repos_url": "https://api.github.com/users/baxterandthehackers/repos", - "events_url": "https://api.github.com/users/baxterandthehackers/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterandthehackers/received_events", - "type": "Organization", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterandthehackers/public-repo", - "description": "", - "fork": true, - "url": "https://api.github.com/repos/baxterandthehackers/public-repo", - "forks_url": "https://api.github.com/repos/baxterandthehackers/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterandthehackers/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterandthehackers/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterandthehackers/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterandthehackers/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterandthehackers/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterandthehackers/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterandthehackers/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterandthehackers/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterandthehackers/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterandthehackers/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterandthehackers/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterandthehackers/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterandthehackers/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterandthehackers/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterandthehackers/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterandthehackers/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterandthehackers/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterandthehackers/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterandthehackers/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterandthehackers/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterandthehackers/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterandthehackers/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterandthehackers/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterandthehackers/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterandthehackers/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterandthehackers/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterandthehackers/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterandthehackers/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterandthehackers/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:30Z", - "updated_at": "2015-05-05T23:40:30Z", - "pushed_at": "2015-05-05T23:40:27Z", - "git_url": "git://github.com/baxterandthehackers/public-repo.git", - "ssh_url": "git@github.com:baxterandthehackers/public-repo.git", - "clone_url": "https://github.com/baxterandthehackers/public-repo.git", - "svn_url": "https://github.com/baxterandthehackers/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": false, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 0, - "forks": 0, - "open_issues": 0, - "watchers": 0, - "default_branch": "master", - "public": true - }, - "repository": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:30Z", - "pushed_at": "2015-05-05T23:40:27Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 1, - "mirror_url": null, - "open_issues_count": 2, - "forks": 1, - "open_issues": 2, - "watchers": 0, - "default_branch": "master" - }, - "sender": { - "login": "baxterandthehackers", - "id": 7649605, - "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterandthehackers", - "html_url": "https://github.com/baxterandthehackers", - "followers_url": "https://api.github.com/users/baxterandthehackers/followers", - "following_url": "https://api.github.com/users/baxterandthehackers/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterandthehackers/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterandthehackers/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterandthehackers/subscriptions", - "organizations_url": "https://api.github.com/users/baxterandthehackers/orgs", - "repos_url": "https://api.github.com/users/baxterandthehackers/repos", - "events_url": "https://api.github.com/users/baxterandthehackers/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterandthehackers/received_events", - "type": "Organization", - "site_admin": false - } -}` -} - -func GollumEventJSON() string { - return `{ - "pages": [ - { - "page_name": "Home", - "title": "Home", - "summary": null, - "action": "created", - "sha": "91ea1bd42aa2ba166b86e8aefe049e9837214e67", - "html_url": "https://github.com/baxterthehacker/public-repo/wiki/Home" - } - ], - "repository": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:12Z", - "pushed_at": "2015-05-05T23:40:17Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 0, - "forks": 0, - "open_issues": 0, - "watchers": 0, - "default_branch": "master" - }, - "sender": { - "login": "jasonrudolph", - "id": 2988, - "avatar_url": "https://avatars.githubusercontent.com/u/2988?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/jasonrudolph", - "html_url": "https://github.com/jasonrudolph", - "followers_url": "https://api.github.com/users/jasonrudolph/followers", - "following_url": "https://api.github.com/users/jasonrudolph/following{/other_user}", - "gists_url": "https://api.github.com/users/jasonrudolph/gists{/gist_id}", - "starred_url": "https://api.github.com/users/jasonrudolph/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/jasonrudolph/subscriptions", - "organizations_url": "https://api.github.com/users/jasonrudolph/orgs", - "repos_url": "https://api.github.com/users/jasonrudolph/repos", - "events_url": "https://api.github.com/users/jasonrudolph/events{/privacy}", - "received_events_url": "https://api.github.com/users/jasonrudolph/received_events", - "type": "User", - "site_admin": true - } -}` -} - -func IssueCommentEventJSON() string { - return `{ - "action": "created", - "issue": { - "url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2/labels{/name}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2/comments", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2/events", - "html_url": "https://github.com/baxterthehacker/public-repo/issues/2", - "id": 73464126, - "number": 2, - "title": "Spelling error in the README file", - "user": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "labels": [ - { - "url": "https://api.github.com/repos/baxterthehacker/public-repo/labels/bug", - "name": "bug", - "color": "fc2929" - } - ], - "state": "open", - "locked": false, - "assignee": null, - "milestone": null, - "comments": 1, - "created_at": "2015-05-05T23:40:28Z", - "updated_at": "2015-05-05T23:40:28Z", - "closed_at": null, - "body": "It looks like you accidently spelled 'commit' with two 't's." - }, - "comment": { - "url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments/99262140", - "html_url": "https://github.com/baxterthehacker/public-repo/issues/2#issuecomment-99262140", - "issue_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2", - "id": 99262140, - "user": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "created_at": "2015-05-05T23:40:28Z", - "updated_at": "2015-05-05T23:40:28Z", - "body": "You are totally right! I'll get this fixed right away." - }, - "repository": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:12Z", - "pushed_at": "2015-05-05T23:40:27Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 2, - "forks": 0, - "open_issues": 2, - "watchers": 0, - "default_branch": "master" - }, - "sender": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - } -}` -} - -func IssuesEventJSON() string { - return `{ - "action": "opened", - "issue": { - "url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2/labels{/name}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2/comments", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2/events", - "html_url": "https://github.com/baxterthehacker/public-repo/issues/2", - "id": 73464126, - "number": 2, - "title": "Spelling error in the README file", - "user": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "labels": [ - { - "url": "https://api.github.com/repos/baxterthehacker/public-repo/labels/bug", - "name": "bug", - "color": "fc2929" - } - ], - "state": "open", - "locked": false, - "assignee": null, - "milestone": null, - "comments": 0, - "created_at": "2015-05-05T23:40:28Z", - "updated_at": "2015-05-05T23:40:28Z", - "closed_at": null, - "body": "It looks like you accidently spelled 'commit' with two 't's." - }, - "repository": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:12Z", - "pushed_at": "2015-05-05T23:40:27Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 2, - "forks": 0, - "open_issues": 2, - "watchers": 0, - "default_branch": "master" - }, - "sender": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - } -}` -} - -func MemberEventJSON() string { - return `{ - "action": "added", - "member": { - "login": "octocat", - "id": 583231, - "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/octocat", - "html_url": "https://github.com/octocat", - "followers_url": "https://api.github.com/users/octocat/followers", - "following_url": "https://api.github.com/users/octocat/following{/other_user}", - "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", - "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", - "organizations_url": "https://api.github.com/users/octocat/orgs", - "repos_url": "https://api.github.com/users/octocat/repos", - "events_url": "https://api.github.com/users/octocat/events{/privacy}", - "received_events_url": "https://api.github.com/users/octocat/received_events", - "type": "User", - "site_admin": false - }, - "repository": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:30Z", - "pushed_at": "2015-05-05T23:40:40Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 2, - "forks": 0, - "open_issues": 2, - "watchers": 0, - "default_branch": "master" - }, - "sender": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - } -}` -} - -func MembershipEventJSON() string { - return `{ - "action": "added", - "scope": "team", - "member": { - "login": "kdaigle", - "id": 2501, - "avatar_url": "https://avatars.githubusercontent.com/u/2501?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/kdaigle", - "html_url": "https://github.com/kdaigle", - "followers_url": "https://api.github.com/users/kdaigle/followers", - "following_url": "https://api.github.com/users/kdaigle/following{/other_user}", - "gists_url": "https://api.github.com/users/kdaigle/gists{/gist_id}", - "starred_url": "https://api.github.com/users/kdaigle/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/kdaigle/subscriptions", - "organizations_url": "https://api.github.com/users/kdaigle/orgs", - "repos_url": "https://api.github.com/users/kdaigle/repos", - "events_url": "https://api.github.com/users/kdaigle/events{/privacy}", - "received_events_url": "https://api.github.com/users/kdaigle/received_events", - "type": "User", - "site_admin": true - }, - "sender": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=2", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "team": { - "name": "Contractors", - "id": 123456, - "slug": "contractors", - "permission": "admin", - "url": "https://api.github.com/teams/123456", - "members_url": "https://api.github.com/teams/123456/members{/member}", - "repositories_url": "https://api.github.com/teams/123456/repos" - }, - "organization": { - "login": "baxterandthehackers", - "id": 7649605, - "url": "https://api.github.com/orgs/baxterandthehackers", - "repos_url": "https://api.github.com/orgs/baxterandthehackers/repos", - "events_url": "https://api.github.com/orgs/baxterandthehackers/events", - "members_url": "https://api.github.com/orgs/baxterandthehackers/members{/member}", - "public_members_url": "https://api.github.com/orgs/baxterandthehackers/public_members{/member}", - "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=2" - } -}` -} - -func PageBuildEventJSON() string { - return `{ - "id": 15995382, - "build": { - "url": "https://api.github.com/repos/baxterthehacker/public-repo/pages/builds/15995382", - "status": "built", - "error": { - "message": null - }, - "pusher": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "commit": "053b99542c83021d6b202d1a1f5ecd5ef7084e55", - "duration": 3790, - "created_at": "2015-05-05T23:40:13Z", - "updated_at": "2015-05-05T23:40:17Z" - }, - "repository": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:12Z", - "pushed_at": "2015-05-05T23:40:17Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 0, - "forks": 0, - "open_issues": 0, - "watchers": 0, - "default_branch": "master" - }, - "sender": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - } -}` -} - -func PublicEventJSON() string { - return `{ - "repository": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:41Z", - "pushed_at": "2015-05-05T23:40:40Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 2, - "forks": 0, - "open_issues": 2, - "watchers": 0, - "default_branch": "master" - }, - "sender": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - } -}` -} - -func PullRequestReviewCommentEventJSON() string { - return `{ - "action": "created", - "comment": { - "url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments/29724692", - "id": 29724692, - "diff_hunk": "@@ -1 +1 @@\n-# public-repo", - "path": "README.md", - "position": 1, - "original_position": 1, - "commit_id": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", - "original_commit_id": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", - "user": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "body": "Maybe you should use more emojji on this line.", - "created_at": "2015-05-05T23:40:27Z", - "updated_at": "2015-05-05T23:40:27Z", - "html_url": "https://github.com/baxterthehacker/public-repo/pull/1#discussion_r29724692", - "pull_request_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1", - "_links": { - "self": { - "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments/29724692" - }, - "html": { - "href": "https://github.com/baxterthehacker/public-repo/pull/1#discussion_r29724692" - }, - "pull_request": { - "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1" - } - } - }, - "pull_request": { - "url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1", - "id": 34778301, - "html_url": "https://github.com/baxterthehacker/public-repo/pull/1", - "diff_url": "https://github.com/baxterthehacker/public-repo/pull/1.diff", - "patch_url": "https://github.com/baxterthehacker/public-repo/pull/1.patch", - "issue_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1", - "number": 1, - "state": "open", - "locked": false, - "title": "Update the README with new information", - "user": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "body": "This is a pretty simple change that we need to pull into master.", - "created_at": "2015-05-05T23:40:27Z", - "updated_at": "2015-05-05T23:40:27Z", - "closed_at": null, - "merged_at": null, - "merge_commit_sha": "18721552ba489fb84e12958c1b5694b5475f7991", - "assignee": null, - "milestone": null, - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/commits", - "review_comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/comments", - "review_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments{/number}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1/comments", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", - "head": { - "label": "baxterthehacker:changes", - "ref": "changes", - "sha": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", - "user": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "repo": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:12Z", - "pushed_at": "2015-05-05T23:40:27Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 1, - "forks": 0, - "open_issues": 1, - "watchers": 0, - "default_branch": "master" - } - }, - "base": { - "label": "baxterthehacker:master", - "ref": "master", - "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", - "user": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "repo": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:12Z", - "pushed_at": "2015-05-05T23:40:27Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 1, - "forks": 0, - "open_issues": 1, - "watchers": 0, - "default_branch": "master" - } - }, - "_links": { - "self": { - "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1" - }, - "html": { - "href": "https://github.com/baxterthehacker/public-repo/pull/1" - }, - "issue": { - "href": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1" - }, - "comments": { - "href": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1/comments" - }, - "review_comments": { - "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/comments" - }, - "review_comment": { - "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments{/number}" - }, - "commits": { - "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/commits" - }, - "statuses": { - "href": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c" - } - } - }, - "repository": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:12Z", - "pushed_at": "2015-05-05T23:40:27Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 1, - "forks": 0, - "open_issues": 1, - "watchers": 0, - "default_branch": "master" - }, - "sender": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - } -}` -} - -func PullRequestEventJSON() string { - return `{ - "action": "opened", - "number": 1, - "pull_request": { - "url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1", - "id": 34778301, - "html_url": "https://github.com/baxterthehacker/public-repo/pull/1", - "diff_url": "https://github.com/baxterthehacker/public-repo/pull/1.diff", - "patch_url": "https://github.com/baxterthehacker/public-repo/pull/1.patch", - "issue_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1", - "number": 1, - "state": "open", - "locked": false, - "title": "Update the README with new information", - "user": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "body": "This is a pretty simple change that we need to pull into master.", - "created_at": "2015-05-05T23:40:27Z", - "updated_at": "2015-05-05T23:40:27Z", - "closed_at": null, - "merged_at": null, - "merge_commit_sha": null, - "assignee": null, - "milestone": null, - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/commits", - "review_comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/comments", - "review_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments{/number}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1/comments", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", - "head": { - "label": "baxterthehacker:changes", - "ref": "changes", - "sha": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", - "user": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "repo": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:12Z", - "pushed_at": "2015-05-05T23:40:26Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 1, - "forks": 0, - "open_issues": 1, - "watchers": 0, - "default_branch": "master" - } - }, - "base": { - "label": "baxterthehacker:master", - "ref": "master", - "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", - "user": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "repo": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:12Z", - "pushed_at": "2015-05-05T23:40:26Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 1, - "forks": 0, - "open_issues": 1, - "watchers": 0, - "default_branch": "master" - } - }, - "_links": { - "self": { - "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1" - }, - "html": { - "href": "https://github.com/baxterthehacker/public-repo/pull/1" - }, - "issue": { - "href": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1" - }, - "comments": { - "href": "https://api.github.com/repos/baxterthehacker/public-repo/issues/1/comments" - }, - "review_comments": { - "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/comments" - }, - "review_comment": { - "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments{/number}" - }, - "commits": { - "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/commits" - }, - "statuses": { - "href": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c" - } - }, - "merged": false, - "mergeable": null, - "mergeable_state": "unknown", - "merged_by": null, - "comments": 0, - "review_comments": 0, - "commits": 1, - "additions": 1, - "deletions": 1, - "changed_files": 1 - }, - "repository": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:12Z", - "pushed_at": "2015-05-05T23:40:26Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 1, - "forks": 0, - "open_issues": 1, - "watchers": 0, - "default_branch": "master" - }, - "sender": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - } -}` -} - -func PushEventJSON() string { - return `{ - "ref": "refs/heads/changes", - "before": "9049f1265b7d61be4a8904a9a27120d2064dab3b", - "after": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", - "created": false, - "deleted": false, - "forced": false, - "base_ref": null, - "compare": "https://github.com/baxterthehacker/public-repo/compare/9049f1265b7d...0d1a26e67d8f", - "commits": [ - { - "id": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", - "distinct": true, - "message": "Update README.md", - "timestamp": "2015-05-05T19:40:15-04:00", - "url": "https://github.com/baxterthehacker/public-repo/commit/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", - "author": { - "name": "baxterthehacker", - "email": "baxterthehacker@users.noreply.github.com", - "username": "baxterthehacker" - }, - "committer": { - "name": "baxterthehacker", - "email": "baxterthehacker@users.noreply.github.com", - "username": "baxterthehacker" - }, - "added": [ - - ], - "removed": [ - - ], - "modified": [ - "README.md" - ] - } - ], - "head_commit": { - "id": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", - "distinct": true, - "message": "Update README.md", - "timestamp": "2015-05-05T19:40:15-04:00", - "url": "https://github.com/baxterthehacker/public-repo/commit/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", - "author": { - "name": "baxterthehacker", - "email": "baxterthehacker@users.noreply.github.com", - "username": "baxterthehacker" - }, - "committer": { - "name": "baxterthehacker", - "email": "baxterthehacker@users.noreply.github.com", - "username": "baxterthehacker" - }, - "added": [ - - ], - "removed": [ - - ], - "modified": [ - "README.md" - ] - }, - "repository": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "name": "baxterthehacker", - "email": "baxterthehacker@users.noreply.github.com" - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://github.com/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": 1430869212, - "updated_at": "2015-05-05T23:40:12Z", - "pushed_at": 1430869217, - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 0, - "forks": 0, - "open_issues": 0, - "watchers": 0, - "default_branch": "master", - "stargazers": 0, - "master_branch": "master" - }, - "pusher": { - "name": "baxterthehacker", - "email": "baxterthehacker@users.noreply.github.com" - }, - "sender": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - } -}` -} - -func RepositoryEventJSON() string { - return `{ - "action": "created", - "repository": { - "id": 27496774, - "name": "new-repository", - "full_name": "baxterandthehackers/new-repository", - "owner": { - "login": "baxterandthehackers", - "id": 7649605, - "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterandthehackers", - "html_url": "https://github.com/baxterandthehackers", - "followers_url": "https://api.github.com/users/baxterandthehackers/followers", - "following_url": "https://api.github.com/users/baxterandthehackers/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterandthehackers/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterandthehackers/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterandthehackers/subscriptions", - "organizations_url": "https://api.github.com/users/baxterandthehackers/orgs", - "repos_url": "https://api.github.com/users/baxterandthehackers/repos", - "events_url": "https://api.github.com/users/baxterandthehackers/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterandthehackers/received_events", - "type": "Organization", - "site_admin": false - }, - "private": true, - "html_url": "https://github.com/baxterandthehackers/new-repository", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterandthehackers/new-repository", - "forks_url": "https://api.github.com/repos/baxterandthehackers/new-repository/forks", - "keys_url": "https://api.github.com/repos/baxterandthehackers/new-repository/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterandthehackers/new-repository/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterandthehackers/new-repository/teams", - "hooks_url": "https://api.github.com/repos/baxterandthehackers/new-repository/hooks", - "issue_events_url": "https://api.github.com/repos/baxterandthehackers/new-repository/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterandthehackers/new-repository/events", - "assignees_url": "https://api.github.com/repos/baxterandthehackers/new-repository/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterandthehackers/new-repository/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterandthehackers/new-repository/tags", - "blobs_url": "https://api.github.com/repos/baxterandthehackers/new-repository/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterandthehackers/new-repository/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterandthehackers/new-repository/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterandthehackers/new-repository/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterandthehackers/new-repository/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterandthehackers/new-repository/languages", - "stargazers_url": "https://api.github.com/repos/baxterandthehackers/new-repository/stargazers", - "contributors_url": "https://api.github.com/repos/baxterandthehackers/new-repository/contributors", - "subscribers_url": "https://api.github.com/repos/baxterandthehackers/new-repository/subscribers", - "subscription_url": "https://api.github.com/repos/baxterandthehackers/new-repository/subscription", - "commits_url": "https://api.github.com/repos/baxterandthehackers/new-repository/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterandthehackers/new-repository/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterandthehackers/new-repository/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterandthehackers/new-repository/issues/comments/{number}", - "contents_url": "https://api.github.com/repos/baxterandthehackers/new-repository/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterandthehackers/new-repository/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterandthehackers/new-repository/merges", - "archive_url": "https://api.github.com/repos/baxterandthehackers/new-repository/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterandthehackers/new-repository/downloads", - "issues_url": "https://api.github.com/repos/baxterandthehackers/new-repository/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterandthehackers/new-repository/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterandthehackers/new-repository/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterandthehackers/new-repository/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterandthehackers/new-repository/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterandthehackers/new-repository/releases{/id}", - "created_at": "2014-12-03T16:39:25Z", - "updated_at": "2014-12-03T16:39:25Z", - "pushed_at": "2014-12-03T16:39:25Z", - "git_url": "git://github.com/baxterandthehackers/new-repository.git", - "ssh_url": "git@github.com:baxterandthehackers/new-repository.git", - "clone_url": "https://github.com/baxterandthehackers/new-repository.git", - "svn_url": "https://github.com/baxterandthehackers/new-repository", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 0, - "forks": 0, - "open_issues": 0, - "watchers": 0, - "default_branch": "master" - }, - "organization": { - "login": "baxterandthehackers", - "id": 7649605, - "url": "https://api.github.com/orgs/baxterandthehackers", - "repos_url": "https://api.github.com/orgs/baxterandthehackers/repos", - "events_url": "https://api.github.com/orgs/baxterandthehackers/events", - "members_url": "https://api.github.com/orgs/baxterandthehackers/members{/member}", - "public_members_url": "https://api.github.com/orgs/baxterandthehackers/public_members{/member}", - "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=2" - }, - "sender": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=2", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - } -}` -} - -func ReleaseEventJSON() string { - return `{ - "action": "published", - "release": { - "url": "https://api.github.com/repos/baxterthehacker/public-repo/releases/1261438", - "assets_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases/1261438/assets", - "upload_url": "https://uploads.github.com/repos/baxterthehacker/public-repo/releases/1261438/assets{?name}", - "html_url": "https://github.com/baxterthehacker/public-repo/releases/tag/0.0.1", - "id": 1261438, - "tag_name": "0.0.1", - "target_commitish": "master", - "name": null, - "draft": false, - "author": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "prerelease": false, - "created_at": "2015-05-05T23:40:12Z", - "published_at": "2015-05-05T23:40:38Z", - "assets": [ - - ], - "tarball_url": "https://api.github.com/repos/baxterthehacker/public-repo/tarball/0.0.1", - "zipball_url": "https://api.github.com/repos/baxterthehacker/public-repo/zipball/0.0.1", - "body": null - }, - "repository": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:30Z", - "pushed_at": "2015-05-05T23:40:38Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 2, - "forks": 0, - "open_issues": 2, - "watchers": 0, - "default_branch": "master" - }, - "sender": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - } -}` -} - -func StatusEventJSON() string { - return `{ - "id": 214015194, - "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", - "name": "baxterthehacker/public-repo", - "target_url": null, - "context": "default", - "description": null, - "state": "success", - "commit": { - "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", - "commit": { - "author": { - "name": "baxterthehacker", - "email": "baxterthehacker@users.noreply.github.com", - "date": "2015-05-05T23:40:12Z" - }, - "committer": { - "name": "baxterthehacker", - "email": "baxterthehacker@users.noreply.github.com", - "date": "2015-05-05T23:40:12Z" - }, - "message": "Initial commit", - "tree": { - "sha": "02b49ad0ba4f1acd9f06531b21e16a4ac5d341d0", - "url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees/02b49ad0ba4f1acd9f06531b21e16a4ac5d341d0" - }, - "url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits/9049f1265b7d61be4a8904a9a27120d2064dab3b", - "comment_count": 1 - }, - "url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/9049f1265b7d61be4a8904a9a27120d2064dab3b", - "html_url": "https://github.com/baxterthehacker/public-repo/commit/9049f1265b7d61be4a8904a9a27120d2064dab3b", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/9049f1265b7d61be4a8904a9a27120d2064dab3b/comments", - "author": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "committer": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "parents": [ - - ] - }, - "branches": [ - { - "name": "master", - "commit": { - "sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b", - "url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/9049f1265b7d61be4a8904a9a27120d2064dab3b" - } - }, - { - "name": "changes", - "commit": { - "sha": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c", - "url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c" - } - }, - { - "name": "gh-pages", - "commit": { - "sha": "b11bb7545ac14abafc6191a0481b0d961e7793c6", - "url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/b11bb7545ac14abafc6191a0481b0d961e7793c6" - } - } - ], - "created_at": "2015-05-05T23:40:39Z", - "updated_at": "2015-05-05T23:40:39Z", - "repository": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:30Z", - "pushed_at": "2015-05-05T23:40:39Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 2, - "forks": 0, - "open_issues": 2, - "watchers": 0, - "default_branch": "master" - }, - "sender": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - } -}` -} - -func TeamAddEventJSON() string { - return `{ - "team": { - "name": "github", - "id": 836012, - "slug": "github", - "description": "", - "permission": "pull", - "url": "https://api.github.com/teams/836012", - "members_url": "https://api.github.com/teams/836012/members{/member}", - "repositories_url": "https://api.github.com/teams/836012/repos" - }, - "repository": { - "id": 35129393, - "name": "public-repo", - "full_name": "baxterandthehackers/public-repo", - "owner": { - "login": "baxterandthehackers", - "id": 7649605, - "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterandthehackers", - "html_url": "https://github.com/baxterandthehackers", - "followers_url": "https://api.github.com/users/baxterandthehackers/followers", - "following_url": "https://api.github.com/users/baxterandthehackers/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterandthehackers/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterandthehackers/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterandthehackers/subscriptions", - "organizations_url": "https://api.github.com/users/baxterandthehackers/orgs", - "repos_url": "https://api.github.com/users/baxterandthehackers/repos", - "events_url": "https://api.github.com/users/baxterandthehackers/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterandthehackers/received_events", - "type": "Organization", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterandthehackers/public-repo", - "description": "", - "fork": true, - "url": "https://api.github.com/repos/baxterandthehackers/public-repo", - "forks_url": "https://api.github.com/repos/baxterandthehackers/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterandthehackers/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterandthehackers/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterandthehackers/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterandthehackers/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterandthehackers/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterandthehackers/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterandthehackers/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterandthehackers/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterandthehackers/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterandthehackers/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterandthehackers/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterandthehackers/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterandthehackers/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterandthehackers/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterandthehackers/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterandthehackers/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterandthehackers/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterandthehackers/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterandthehackers/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterandthehackers/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterandthehackers/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterandthehackers/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterandthehackers/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterandthehackers/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterandthehackers/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterandthehackers/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterandthehackers/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterandthehackers/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterandthehackers/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterandthehackers/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:30Z", - "updated_at": "2015-05-05T23:40:30Z", - "pushed_at": "2015-05-05T23:40:27Z", - "git_url": "git://github.com/baxterandthehackers/public-repo.git", - "ssh_url": "git@github.com:baxterandthehackers/public-repo.git", - "clone_url": "https://github.com/baxterandthehackers/public-repo.git", - "svn_url": "https://github.com/baxterandthehackers/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": false, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 0, - "forks": 0, - "open_issues": 0, - "watchers": 0, - "default_branch": "master" - }, - "organization": { - "login": "baxterandthehackers", - "id": 7649605, - "url": "https://api.github.com/orgs/baxterandthehackers", - "repos_url": "https://api.github.com/orgs/baxterandthehackers/repos", - "events_url": "https://api.github.com/orgs/baxterandthehackers/events", - "members_url": "https://api.github.com/orgs/baxterandthehackers/members{/member}", - "public_members_url": "https://api.github.com/orgs/baxterandthehackers/public_members{/member}", - "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=3", - "description": null - }, - "sender": { - "login": "baxterandthehackers", - "id": 7649605, - "avatar_url": "https://avatars.githubusercontent.com/u/7649605?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterandthehackers", - "html_url": "https://github.com/baxterandthehackers", - "followers_url": "https://api.github.com/users/baxterandthehackers/followers", - "following_url": "https://api.github.com/users/baxterandthehackers/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterandthehackers/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterandthehackers/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterandthehackers/subscriptions", - "organizations_url": "https://api.github.com/users/baxterandthehackers/orgs", - "repos_url": "https://api.github.com/users/baxterandthehackers/repos", - "events_url": "https://api.github.com/users/baxterandthehackers/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterandthehackers/received_events", - "type": "Organization", - "site_admin": false - } -}` -} - -func WatchEventJSON() string { - return `{ - "action": "started", - "repository": { - "id": 35129377, - "name": "public-repo", - "full_name": "baxterthehacker/public-repo", - "owner": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/baxterthehacker/public-repo", - "description": "", - "fork": false, - "url": "https://api.github.com/repos/baxterthehacker/public-repo", - "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks", - "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams", - "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks", - "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events", - "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags", - "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages", - "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers", - "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors", - "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers", - "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription", - "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges", - "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads", - "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}", - "created_at": "2015-05-05T23:40:12Z", - "updated_at": "2015-05-05T23:40:30Z", - "pushed_at": "2015-05-05T23:40:27Z", - "git_url": "git://github.com/baxterthehacker/public-repo.git", - "ssh_url": "git@github.com:baxterthehacker/public-repo.git", - "clone_url": "https://github.com/baxterthehacker/public-repo.git", - "svn_url": "https://github.com/baxterthehacker/public-repo", - "homepage": null, - "size": 0, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 2, - "forks": 0, - "open_issues": 2, - "watchers": 0, - "default_branch": "master" - }, - "sender": { - "login": "baxterthehacker", - "id": 6752317, - "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/baxterthehacker", - "html_url": "https://github.com/baxterthehacker", - "followers_url": "https://api.github.com/users/baxterthehacker/followers", - "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}", - "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}", - "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions", - "organizations_url": "https://api.github.com/users/baxterthehacker/orgs", - "repos_url": "https://api.github.com/users/baxterthehacker/repos", - "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}", - "received_events_url": "https://api.github.com/users/baxterthehacker/received_events", - "type": "User", - "site_admin": false - } -}` -} diff --git a/plugins/inputs/ghwebhooks/models/models.go b/plugins/inputs/ghwebhooks/models/models.go deleted file mode 100644 index a499218f5..000000000 --- a/plugins/inputs/ghwebhooks/models/models.go +++ /dev/null @@ -1,711 +0,0 @@ -package models - -import ( - "fmt" - "log" - "time" - - "github.com/influxdata/influxdb/client/v2" -) - -const meas = "ghWebhooks" - -type Event interface { - NewPoint() *client.Point -} - -type Repository struct { - Repository string `json:"full_name"` - Private bool `json:"private"` - Stars int `json:"stargazers_count"` - Forks int `json:"forks_count"` - Issues int `json:"open_issues_count"` -} - -type Sender struct { - User string `json:"login"` - Admin bool `json:"site_admin"` -} - -type CommitComment struct { - Commit string `json:"commit_id"` - Body string `json:"body"` -} - -type Deployment struct { - Commit string `json:"sha"` - Task string `json:"task"` - Environment string `json:"environment"` - Description string `json:"description"` -} - -type Page struct { - Name string `json:"page_name"` - Title string `json:"title"` - Action string `json:"action"` -} - -type Issue struct { - Number int `json:"number"` - Title string `json:"title"` - Comments int `json:"comments"` -} - -type IssueComment struct { - Body string `json:"body"` -} - -type Team struct { - Name string `json:"name"` -} - -type PullRequest struct { - Number int `json:"number"` - State string `json:"state"` - Title string `json:"title"` - Comments int `json:"comments"` - Commits int `json:"commits"` - Additions int `json:"additions"` - Deletions int `json:"deletions"` - ChangedFiles int `json:"changed_files"` -} - -type PullRequestReviewComment struct { - File string `json:"path"` - Comment string `json:"body"` -} - -type Release struct { - TagName string `json:"tag_name"` -} - -type DeploymentStatus struct { - State string `json:"state"` - Description string `json:"description"` -} - -type CommitCommentEvent struct { - Comment CommitComment `json:"comment"` - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s CommitCommentEvent) NewPoint() *client.Point { - event := "commit_comment" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - "commit": s.Comment.Commit, - "comment": s.Comment.Body, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type CreateEvent struct { - Ref string `json:"ref"` - RefType string `json:"ref_type"` - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s CreateEvent) NewPoint() *client.Point { - event := "create" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - "ref": s.Ref, - "refType": s.RefType, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type DeleteEvent struct { - Ref string `json:"ref"` - RefType string `json:"ref_type"` - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s DeleteEvent) NewPoint() *client.Point { - event := "delete" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - "ref": s.Ref, - "refType": s.RefType, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type DeploymentEvent struct { - Deployment Deployment `json:"deployment"` - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s DeploymentEvent) NewPoint() *client.Point { - event := "deployment" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - "commit": s.Deployment.Commit, - "task": s.Deployment.Task, - "environment": s.Deployment.Environment, - "description": s.Deployment.Description, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type DeploymentStatusEvent struct { - Deployment Deployment `json:"deployment"` - DeploymentStatus DeploymentStatus `json:"deployment_status"` - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s DeploymentStatusEvent) NewPoint() *client.Point { - event := "delete" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - "commit": s.Deployment.Commit, - "task": s.Deployment.Task, - "environment": s.Deployment.Environment, - "description": s.Deployment.Description, - "depState": s.DeploymentStatus.State, - "depDescription": s.DeploymentStatus.Description, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type ForkEvent struct { - Forkee Repository `json:"forkee"` - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s ForkEvent) NewPoint() *client.Point { - event := "fork" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - "fork": s.Forkee.Repository, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type GollumEvent struct { - Pages []Page `json:"pages"` - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -// REVIEW: Going to be lazy and not deal with the pages. -func (s GollumEvent) NewPoint() *client.Point { - event := "gollum" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type IssueCommentEvent struct { - Issue Issue `json:"issue"` - Comment IssueComment `json:"comment"` - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s IssueCommentEvent) NewPoint() *client.Point { - event := "issue_comment" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - "issue": fmt.Sprintf("%v", s.Issue.Number), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - "title": s.Issue.Title, - "comments": s.Issue.Comments, - "body": s.Comment.Body, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type IssuesEvent struct { - Action string `json:"action"` - Issue Issue `json:"issue"` - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s IssuesEvent) NewPoint() *client.Point { - event := "issue" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - "issue": fmt.Sprintf("%v", s.Issue.Number), - "action": s.Action, - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - "title": s.Issue.Title, - "comments": s.Issue.Comments, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type MemberEvent struct { - Member Sender `json:"member"` - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s MemberEvent) NewPoint() *client.Point { - event := "member" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - "newMember": s.Member.User, - "newMemberStatus": s.Member.Admin, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type MembershipEvent struct { - Action string `json:"action"` - Member Sender `json:"member"` - Sender Sender `json:"sender"` - Team Team `json:"team"` -} - -func (s MembershipEvent) NewPoint() *client.Point { - event := "membership" - t := map[string]string{ - "event": event, - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - "action": s.Action, - } - f := map[string]interface{}{ - "newMember": s.Member.User, - "newMemberStatus": s.Member.Admin, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type PageBuildEvent struct { - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s PageBuildEvent) NewPoint() *client.Point { - event := "page_build" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type PublicEvent struct { - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s PublicEvent) NewPoint() *client.Point { - event := "public" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type PullRequestEvent struct { - Action string `json:"action"` - PullRequest PullRequest `json:"pull_request"` - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s PullRequestEvent) NewPoint() *client.Point { - event := "pull_request" - t := map[string]string{ - "event": event, - "action": s.Action, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - "prNumber": fmt.Sprintf("%v", s.PullRequest.Number), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - "state": s.PullRequest.State, - "title": s.PullRequest.Title, - "comments": s.PullRequest.Comments, - "commits": s.PullRequest.Commits, - "additions": s.PullRequest.Additions, - "deletions": s.PullRequest.Deletions, - "changedFiles": s.PullRequest.ChangedFiles, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type PullRequestReviewCommentEvent struct { - Comment PullRequestReviewComment `json:"comment"` - PullRequest PullRequest `json:"pull_request"` - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s PullRequestReviewCommentEvent) NewPoint() *client.Point { - event := "pull_request_review_comment" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - "prNumber": fmt.Sprintf("%v", s.PullRequest.Number), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - "state": s.PullRequest.State, - "title": s.PullRequest.Title, - "comments": s.PullRequest.Comments, - "commits": s.PullRequest.Commits, - "additions": s.PullRequest.Additions, - "deletions": s.PullRequest.Deletions, - "changedFiles": s.PullRequest.ChangedFiles, - "commentFile": s.Comment.File, - "comment": s.Comment.Comment, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type PushEvent struct { - Ref string `json:"ref"` - Before string `json:"before"` - After string `json:"after"` - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s PushEvent) NewPoint() *client.Point { - event := "push" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - "Ref": s.Ref, - "Before": s.Before, - "After": s.After, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type ReleaseEvent struct { - Release Release `json:"release"` - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s ReleaseEvent) NewPoint() *client.Point { - event := "release" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - "tagName": s.Release.TagName, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type RepositoryEvent struct { - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s RepositoryEvent) NewPoint() *client.Point { - event := "repository" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type StatusEvent struct { - Commit string `json:"sha"` - State string `json:"state"` - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s StatusEvent) NewPoint() *client.Point { - event := "status" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - "commit": s.Commit, - "state": s.State, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type TeamAddEvent struct { - Team Team `json:"team"` - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s TeamAddEvent) NewPoint() *client.Point { - event := "team_add" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - "teamName": s.Team.Name, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -} - -type WatchEvent struct { - Repository Repository `json:"repository"` - Sender Sender `json:"sender"` -} - -func (s WatchEvent) NewPoint() *client.Point { - event := "delete" - t := map[string]string{ - "event": event, - "repository": s.Repository.Repository, - "private": fmt.Sprintf("%v", s.Repository.Private), - "user": s.Sender.User, - "admin": fmt.Sprintf("%v", s.Sender.Admin), - } - f := map[string]interface{}{ - "stars": s.Repository.Stars, - "forks": s.Repository.Forks, - "issues": s.Repository.Issues, - } - p, err := client.NewPoint(meas, t, f, time.Now()) - if err != nil { - log.Fatalf("Failed to create %v event", event) - } - return p -}