Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JoinUserSQL ¶
JoinUserSQL returns a string ready to be embed in a JOIN query
func SessionJoinSQL ¶
SessionJoinSQL returns a string ready to be embed in a JOIN query
Types ¶
type Session ¶
type Session struct { ID string `db:"id"` CreatedAt *datetime.DateTime `db:"created_at"` UpdatedAt *datetime.DateTime `db:"updated_at"` DeletedAt *datetime.DateTime `db:"deleted_at"` UserID string `db:"user_id"` }
Session is a structure representing a session that can be saved in the database
type User ¶
type User struct { ID string `db:"id"` CreatedAt *datetime.DateTime `db:"created_at"` UpdatedAt *datetime.DateTime `db:"updated_at"` DeletedAt *datetime.DateTime `db:"deleted_at"` Name string `db:"name"` Email string `db:"email"` Password string `db:"password"` IsAdmin bool `db:"is_admin"` }
User is a structure representing a user that can be saved in the database
func GetAnyUserByID ¶
GetAnyUserByID finds and returns an user by ID. Deleted object are returned
func GetUserByID ¶
GetUserByID finds and returns an active user by ID Deleted object are not returned
func (*User) IsAdm ¶
IsAdm checks if the user object belong to a logged in admin Works on nil object
func (*User) IsLogged ¶
IsLogged checks if the user object belong to a logged in user Works on nil object
Click to show internal directories.
Click to hide internal directories.