summaryrefslogtreecommitdiffstats
path: root/models/update.go
diff options
context:
space:
mode:
authorBwko <bouwko@gmail.com>2016-11-24 22:35:47 +0100
committerBwko <bouwko@gmail.com>2016-11-25 07:55:08 +0100
commit33a2ac38301e07ab78cbee07788e80668ca5b6fa (patch)
treec31f2babfc690f17964a5f4c0fa0de7e4e942236 /models/update.go
parentece19f4a5e948a1e0fab7a1a0d64f39d5ad8d9d3 (diff)
downloadgitea-33a2ac38301e07ab78cbee07788e80668ca5b6fa.tar.gz
gitea-33a2ac38301e07ab78cbee07788e80668ca5b6fa.zip
Lint models/update.go & webhook_slack.go
Diffstat (limited to 'models/update.go')
-rw-r--r--models/update.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/models/update.go b/models/update.go
index 41aa98e0a3..789b99e7b2 100644
--- a/models/update.go
+++ b/models/update.go
@@ -15,6 +15,7 @@ import (
"code.gitea.io/gitea/modules/log"
)
+// UpdateTask defines an UpdateTask
type UpdateTask struct {
ID int64 `xorm:"pk autoincr"`
UUID string `xorm:"index"`
@@ -23,6 +24,7 @@ type UpdateTask struct {
NewCommitID string
}
+// AddUpdateTask adds an UpdateTask
func AddUpdateTask(task *UpdateTask) error {
_, err := x.Insert(task)
return err
@@ -42,6 +44,7 @@ func GetUpdateTaskByUUID(uuid string) (*UpdateTask, error) {
return task, nil
}
+// DeleteUpdateTaskByUUID deletes an UpdateTask from the database
func DeleteUpdateTaskByUUID(uuid string) error {
_, err := x.Delete(&UpdateTask{UUID: uuid})
return err
@@ -60,6 +63,7 @@ func CommitToPushCommit(commit *git.Commit) *PushCommit {
}
}
+// ListToPushCommits transforms a list.List to PushCommits type.
func ListToPushCommits(l *list.List) *PushCommits {
commits := make([]*PushCommit, 0)
var actEmail string
@@ -73,6 +77,7 @@ func ListToPushCommits(l *list.List) *PushCommits {
return &PushCommits{l.Len(), commits, "", nil}
}
+// PushUpdateOptions defines the push update options
type PushUpdateOptions struct {
PusherID int64
PusherName string