Documentation
¶
Index ¶
Constants ¶
View Source
const ( NoDataFound = "not found" EmptyPasswordHash = "empty password hash" )
View Source
const ( ValidUser = "Valid" InvalidUser = "Invalid" )
View Source
const ( GuestUser = "Guest" StandardUser = "Standard" )
View Source
const ( SessionValid = "Valid" SessionInvalid = "Invalid" SessionStale = "Stale" )
Variables ¶
This section is empty.
Functions ¶
func ErrEmptyPasswordHash ¶
func ErrEmptyPasswordHash() error
func GenerateToken ¶
func IsNoDataFoundErr ¶
Types ¶
type AuthRequest ¶
type AuthResponse ¶
type AuthServer ¶
type AuthServer interface {
CreateUser(name, email, password string) (*UserAttrs, error)
CreateTypedUser(usertype, name, email, plainpass string) (*UserAttrs, error)
CreateSession(name, txtPassword string) (jwtToken string, userAttrs *UserAttrs, fnError error)
}
func NewAuthServer ¶
func NewAuthServer(db db_pkg.DatabaseContext) AuthServer
type Session ¶
type Session struct {
*User
Status SessionStatus
}
type SessionAttrs ¶
type SessionAttrs struct {
Id string
// contains filtered or unexported fields
}
not used yet
type SessionStatus ¶
type SessionStatus string
type UserAttrs ¶
type UserAttrs struct {
*User
Email string
PasswordHash string
Status UserStatus
Type UserType
}
type UserClaims ¶
type UserClaims struct {
User *User `json:"user"`
jwt.StandardClaims
}
type UserStatus ¶
type UserStatus string
Click to show internal directories.
Click to hide internal directories.