Documentation ¶
Index ¶
- type Account
- type CreateUserRequest
- type Interests
- type Nofication
- type Service
- func (s *Service) AppendUserInterests(user User, interests []types.TopWord) bool
- func (s *Service) CreateAdminUser(user User) (User, error)
- func (s *Service) CreateUser(user User) (User, error)
- func (s *Service) FetchallUsers() []User
- func (s *Service) GetNofications(user User) []Nofication
- func (s *Service) GetUserByEmail(email string) (User, error)
- func (s *Service) GetUserbyID(id uint, email string) (User, error)
- func (s *Service) GetUserbyOnlyID(id uint) (User, error)
- func (s *Service) IsAdmin(user User) bool
- func (s *Service) IsEmailExists(email string) bool
- func (s *Service) IsHighPriv(user User) bool
- func (s *Service) IsUserNameExists(username string) bool
- func (s *Service) SendNofications(user User, nofication Nofication)
- type User
- type UserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { AccountID uint64 `gorm:"primaryKey" json:"account_id"` UserID int `gorm:"column:user_id" json:"user_id"` Location string `gorm:"column:location" json:"location"` WebsiteURL string `gorm:"column:website_url" json:"website_url"` ProfileImage string `gorm:"column:profile_image" json:"profile_image"` DisplayName string `gorm:"column:display_name" json:"display_name"` Description string `gorm:"column:description" json:"description"` Name string `gorm:"column:name" json:"name"` IsEmployee bool `gorm:"column:is_employee default:false" json:"is_employee"` Reputation int `gorm:"column:reputation default:0" json:"reputation"` }
type CreateUserRequest ¶
type CreateUserRequest struct { Username string `json:"username"` Email string `json:"email"` Password string `json:"password"` Account struct { DisplayName string `json:"display_name"` Description string `json:"description"` Name string `json:"name"` Location string `json:"location"` WebsiteURL string `json:"website_url"` ProfileImage string `json:"profile_image"` } `json:"account"` }
type Nofication ¶
type Service ¶
func NewService ¶
func (*Service) AppendUserInterests ¶
func (*Service) FetchallUsers ¶
func (*Service) GetNofications ¶
func (s *Service) GetNofications(user User) []Nofication
get nofication sof a given user
func (*Service) IsEmailExists ¶
func (*Service) IsHighPriv ¶
func (*Service) IsUserNameExists ¶
func (*Service) SendNofications ¶
func (s *Service) SendNofications(user User, nofication Nofication)
type User ¶
type User struct { ID uint64 Username string `gorm:"column:username" json:"username"` Email string `gorm:"column:email" json:"email"` Password string `gorm:"column:password" json:"-"` UserType int `gorm:"column:user_type" json:"user_type"` UserAcc Account `json:"account" gorm:"foreignKey:user_id;id"` Nofications []Nofication `gorm:"many2many:user_nofication" json:"-"` Interests []types.TopWord `gorm:"many2many:user_interests" json:"interests"` TokenVersion int `gorm:"column:tokenversion" json:"tokenversion"` IsVerified bool `gorm:"column:verified" json:"verified"` }
type UserService ¶
type UserService interface { CreateUser(user User) (User, error) FetchallUsers() []User GetUserByEmail(email string) (User, error) GetUserbyID(id uint, email string) (User, error) // roles IsAdmin(user User) bool IsHighPriv(user User) // nofications SendNofications(user User, nofication Nofication) GetNofications(user User) []Nofication // interests AppendUserInterests(user User, interests types.TopWord) bool }
Click to show internal directories.
Click to hide internal directories.