Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateUser ¶
func CreateUser(username, password, firstName, lastName, email string, isStaff, isSuperuser bool) error
CreateUser creates a new active user with a given password
Types ¶
type SessionData ¶
type SessionData struct { ID int64 Username string Email string IsStaff bool SessionVersion string }
SessionData type to store user data in session
type User ¶
type User struct { ID int64 `pg:",pk" json:"id"` Password string `pg:"type:varchar(128),notnull" json:"-"` LastLogin time.Time `json:"-"` Username string `pg:"type:varchar(150),notnull,unique" json:"username"` FirstName string `pg:"type:varchar(30),notnull" json:"-"` LastName string `pg:"type:varchar(30),notnull" json:"-"` Email string `pg:"type:varchar(254),notnull" json:"email"` IsSuperuser bool `pg:",notnull" json:"-"` IsStaff bool `pg:",notnull" json:"-"` IsActive bool `pg:",notnull" json:"-"` DateJoined time.Time `pg:",notnull" json:"-"` // contains filtered or unexported fields }
User type
Click to show internal directories.
Click to hide internal directories.