This commit is contained in:
venture
2026-11-13 13:01:53 +01:00
commit fdb52d1cfe
20 changed files with 1660 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
package user
const (
ADMIN = "admin"
MEMBER = "member"
)
+26
View File
@@ -0,0 +1,26 @@
package user
type User struct {
Username string
Password string
Email *string
Role string
}
type NewUserParams struct {
Username string
Password string
}
func NewUser(params NewUserParams) User {
return User{
Username: params.Username,
Password: params.Password,
}
}
func (u *User) Is(role string) bool {
return role == u.Role
}