2015-05-17 20:51:42 +00:00
|
|
|
package types
|
2015-04-07 08:20:55 +00:00
|
|
|
|
2015-05-11 07:45:31 +00:00
|
|
|
type Token struct {
|
|
|
|
ID int64 `meddler:"token_id,pk" json:"-"`
|
2015-06-13 23:48:06 +00:00
|
|
|
UserID int64 `meddler:"token_user_id" json:"-" sql:"index:ix_token_user_id,unique:ux_token_user_label"`
|
|
|
|
Login string `meddler:"-" json:"-" sql:"-"`
|
2015-05-11 07:45:31 +00:00
|
|
|
Kind string `meddler:"token_kind" json:"kind,omitempty"`
|
2015-06-13 23:48:06 +00:00
|
|
|
Label string `meddler:"token_label" json:"label,omitempty" sql:"unique:ux_token_user_label"`
|
2015-05-11 07:45:31 +00:00
|
|
|
Expiry int64 `meddler:"token_expiry" json:"expiry,omitempty"`
|
|
|
|
Issued int64 `meddler:"token_issued" json:"issued_at,omitempty"`
|
|
|
|
}
|
|
|
|
|
2015-04-13 05:32:32 +00:00
|
|
|
const (
|
2015-04-30 21:23:46 +00:00
|
|
|
TokenUser = "u"
|
|
|
|
TokenSess = "s"
|
|
|
|
TokenHook = "h"
|
|
|
|
TokenAgent = "a"
|
2015-04-13 05:32:32 +00:00
|
|
|
)
|