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 {
bun.BaseModel `bun:"auth_user"`
ID int64 `bun:",pk" json:"id"`
Password string `bun:"type:varchar(128),notnull" json:"-"`
LastLogin time.Time `json:"-"`
Username string `bun:"type:varchar(150),notnull,unique" json:"username"`
FirstName string `bun:"type:varchar(30),notnull" json:"-"`
LastName string `bun:"type:varchar(30),notnull" json:"-"`
Email string `bun:"type:varchar(254),notnull" json:"email"`
IsSuperuser bool `bun:",notnull" json:"-"`
IsStaff bool `bun:",notnull" json:"-"`
IsActive bool `bun:",notnull" json:"-"`
DateJoined time.Time `bun:",notnull" json:"-"`
}
User type
Click to show internal directories.
Click to hide internal directories.