Remove unused payload types

This commit is contained in:
Unknwon 2016-08-14 04:16:36 -07:00
parent 5799eb65e0
commit e363d3ff8f
2 changed files with 20 additions and 45 deletions

View file

@ -14,7 +14,7 @@ import (
)
func Version() string {
return "0.11.0"
return "0.12.0"
}
// Client represents a Gogs API client.

View file

@ -74,47 +74,22 @@ type Payloader interface {
JSONPayload() ([]byte, error)
}
type PayloadAuthor struct {
Name string `json:"name"`
Email string `json:"email"`
UserName string `json:"username"`
}
type PayloadCommitter struct {
Name string `json:"name"`
Email string `json:"email"`
UserName string `json:"username"`
}
type PayloadUser struct {
UserName string `json:"login"`
ID int64 `json:"id"`
AvatarUrl string `json:"avatar_url"`
Name string `json:"name"`
Email string `json:"email"`
UserName string `json:"username"`
}
// FIXME: consider use same format as API when commits API are added.
type PayloadCommit struct {
ID string `json:"id"`
Message string `json:"message"`
URL string `json:"url"`
Author *PayloadAuthor `json:"author"`
Committer *PayloadCommitter `json:"committer"`
Author *PayloadUser `json:"author"`
Committer *PayloadUser `json:"committer"`
Timestamp time.Time `json:"timestamp"`
}
type PayloadRepo struct {
ID int64 `json:"id"`
Name string `json:"name"`
URL string `json:"url"`
SSHURL string `json:"ssh_url"`
CloneURL string `json:"clone_url"`
Description string `json:"description"`
Website string `json:"website"`
Watchers int `json:"watchers"`
Owner *PayloadAuthor `json:"owner"`
Private bool `json:"private"`
DefaultBranch string `json:"default_branch"`
}
var (
_ Payloader = &CreatePayload{}
_ Payloader = &PushPayload{}
@ -132,8 +107,8 @@ type CreatePayload struct {
Secret string `json:"secret"`
Ref string `json:"ref"`
RefType string `json:"ref_type"`
Repo *PayloadRepo `json:"repository"`
Sender *PayloadUser `json:"sender"`
Repo *Repository `json:"repository"`
Sender *User `json:"sender"`
}
func (p *CreatePayload) SetSecret(secret string) {
@ -177,11 +152,11 @@ type PushPayload struct {
Ref string `json:"ref"`
Before string `json:"before"`
After string `json:"after"`
CompareUrl string `json:"compare_url"`
CompareURL string `json:"compare_url"`
Commits []*PayloadCommit `json:"commits"`
Repo *PayloadRepo `json:"repository"`
Pusher *PayloadAuthor `json:"pusher"`
Sender *PayloadUser `json:"sender"`
Repo *Repository `json:"repository"`
Pusher *User `json:"pusher"`
Sender *User `json:"sender"`
}
func (p *PushPayload) SetSecret(secret string) {