summaryrefslogtreecommitdiffstats
path: root/models/token.go
diff options
context:
space:
mode:
authorBwko <bouwko@gmail.com>2016-11-25 09:03:52 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2016-11-25 16:03:52 +0800
commit081c2a9395706e24bb396bf2aa9ac8a92d0a8f40 (patch)
treed069d1a2285eed19aca9463bbde9e4a487d60763 /models/token.go
parent6a28909f40ad1ff20d325d9be4ada87e5b75ce53 (diff)
downloadgitea-081c2a9395706e24bb396bf2aa9ac8a92d0a8f40.tar.gz
gitea-081c2a9395706e24bb396bf2aa9ac8a92d0a8f40.zip
Lint models/token.go (#244)
Diffstat (limited to 'models/token.go')
-rw-r--r--models/token.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/models/token.go b/models/token.go
index 42e0af7be2..03ea554fbb 100644
--- a/models/token.go
+++ b/models/token.go
@@ -28,14 +28,17 @@ type AccessToken struct {
HasUsed bool `xorm:"-"`
}
+// BeforeInsert will be invoked by XORM before inserting a record representing this object.
func (t *AccessToken) BeforeInsert() {
t.CreatedUnix = time.Now().Unix()
}
+// BeforeUpdate is invoked from XORM before updating this object.
func (t *AccessToken) BeforeUpdate() {
t.UpdatedUnix = time.Now().Unix()
}
+// AfterSet is invoked from XORM after setting the value of a field of this object.
func (t *AccessToken) AfterSet(colName string, _ xorm.Cell) {
switch colName {
case "created_unix":