Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is throw when an user is not found ErrNotFound = errors.New("user not found") // ErrNil is throw when an user is nil ErrNil = errors.New("user is nil") )
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { ID int `json:"-" gorm:"column:id; primary_key; not null"` PublicKeyDER []byte `json:"-" gorm:"column:key_public_der; size:2000; not null"` FingerPrint string `json:"key_fingerprint" gorm:"column:key_fingerprint; size:51; not null"` DisplayName string `json:"display_name" gorm:"column:display_name; size:42" validator-update:"string=length:max|42"` Signup time.Time `json:"signup" gorm:"column:signup; not null" sql:"DEFAULT:current_timestamp"` LoginFirst time.Time `json:"login_first" gorm:"column:login_first; not null" sql:"DEFAULT:'1970-01-01 00:00:00'"` LoginLast time.Time `json:"login_last" gorm:"column:login_last; not null" sql:"DEFAULT:'1970-01-01 00:00:00'"` }
User is the modelisation of an user
func (*User) MarshalJSON ¶
MarshalJSON overload the default user json marshal to add fields useful for clients
Click to show internal directories.
Click to hide internal directories.