Documentation ¶
Index ¶
- Constants
- Variables
- func CanBeTrusted(user User) bool
- func FindNames(d deps, list ...bson.ObjectId) (common.UsersStringMap, error)
- func IsBanned(d deps, id bson.ObjectId) bool
- func Page(limit int, reverse bool, before *bson.ObjectId, after *bson.ObjectId) common.Query
- func ResetNotifications(d deps, id bson.ObjectId) (err error)
- type Ban
- type Gaming
- type User
- type UserRole
- type Users
- type UsersSet
Constants ¶
View Source
const ( ACTIVE status = "active" PENDING status = "pending" REJECTED status = "rejected" REVOKED status = "revoked" )
Variables ¶
View Source
var ErrInvalidBanReason = errors.New("invalid ban reason")
ErrInvalidBanReason not present in config
View Source
var ErrInvalidUser = errors.New("invalid user to ban")
ErrInvalidUser user cannot be found
View Source
var UserNotFound = errors.New("User has not been found by given criteria.")
Functions ¶
func CanBeTrusted ¶
func ResetNotifications ¶
Types ¶
type Ban ¶
type Ban struct { ID bson.ObjectId `bson:"_id,omitempty" json:"id,omitempty"` UserID bson.ObjectId `bson:"user_id" json:"user_id"` RelatedTo string `bson:"related_to" json:"related_to"` RelatedID *bson.ObjectId `bson:"related_id,omitempty" json:"related_id,omitempty"` Content string `bson:"content" json:"content"` Status status `bson:"status" json:"status"` Reason string `bson:"reason" json:"reason"` Created time.Time `bson:"created_at" json:"created_at"` Updated time.Time `bson:"updated_at" json:"updated_at"` Until time.Time `bson:"until" json:"until"` Deleted *time.Time `bson:"deleted_at,omitempty" json:"-"` }
Ban represents a ban sent by a user.
type User ¶
type User struct { Id bson.ObjectId `bson:"_id,omitempty" json:"id"` FirstName string `bson:"first_name" json:"first_name"` LastName string `bson:"last_name" json:"last_name"` UserName string `bson:"username" json:"username"` UserNameSlug string `bson:"username_slug" json:"username_slug"` NameChanges int `bson:"name_changes" json:"name_changes"` Password string `bson:"password" json:"-"` Step int `bson:"step,omitempty" json:"step"` Email string `bson:"email" json:"email,omitempty"` Categories []bson.ObjectId `bson:"categories,omitempty" json:"categories,omitempty"` Roles []UserRole `bson:"roles" json:"roles,omitempty"` Permissions []string `bson:"permissions" json:"permissions,omitempty"` Description string `bson:"description" json:"description,omitempty"` Image string `bson:"image" json:"image"` Facebook interface{} `bson:"facebook,omitempty" json:"facebook,omitempty"` Notifications interface{} `bson:"notifications,omitempty" json:"notifications,omitempty"` Profile map[string]interface{} `bson:"profile,omitempty" json:"profile,omitempty"` Gaming Gaming `bson:"gaming,omitempty" json:"gaming,omitempty"` //Stats UserStats `bson:"stats,omitempty" json:"stats,omitempty"` Version string `bson:"version,omitempty" json:"version,omitempty"` Validated bool `bson:"validated" json:"validated"` VerificationCode string `bson:"ver_code,omitempty" json:"-"` Warnings int `bson:"warnings" json:"-"` ConfirmSent *time.Time `bson:"confirm_sent_at" json:"-"` Created time.Time `bson:"created_at" json:"created_at"` Updated time.Time `bson:"updated_at" json:"updated_at"` Banned bool `bson:"banned" json:"-"` BannedAt *time.Time `bson:"banned_at" json:"-"` BannedUntil *time.Time `bson:"banned_until" json:"-"` BannedReason *string `bson:"banned_re" json:"-"` BannedTimes int `bson:"banned_times" json:"-"` }
func UseRecoveryToken ¶
UseRecoveryToken to generate auth token.
func (User) ConfirmationEmail ¶
func (User) RecoveryPasswordEmail ¶
Click to show internal directories.
Click to hide internal directories.