Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { NewUser(u User) error GetSolvesWithTime(u string) []_ORMChallengesByUser Get(username string) (User, error) Contains(username, displayname string) bool Login(username, password string) error GetUserCount() int64 GetSolveCount(chall types.Challenge) int64 UpdateUser(u User) error DeleteUser(u User) error SolvedChallenge(u User, c *types.Challenge) error UserExists(u User) (bool, error) DisplayNameExists(n string) (bool, error) ChallengesSolved(u User) ([]*types.Challenge, error) LoadUser(username string) (User, error) UserByToken(token string) (User, error) AllUsersSortedByPoints() ([]User, error) }
type User ¶
type User struct { Name string `json:"name"` Hash []byte DisplayName string `json:"displayname"` Completed []*types.Challenge Admin bool `json:"admin"` Points int `json:"points"` VerifiedInfo VerifyInfo Created time.Time }
User was ist das wohl
func NewUserStruct ¶
NewUserStruct creates a new user object
func (*User) CalculatePoints ¶
func (u *User) CalculatePoints()
CalculatePoints calculates Points and updates user.Points
func (*User) ComparePassword ¶
ComparePassword checks if the password is valid
Click to show internal directories.
Click to hide internal directories.