Documentation ¶
Index ¶
Constants ¶
View Source
const RolesCollectionName = "roles"
View Source
const UserCollectionName = "users"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Role ¶
type Role struct { ID primitive.ObjectID `bson:"_id,omitempty"` Code RoleCode `bson:"code" validate:"required,rolecode"` Status bool `bson:"status" validate:"required"` CreatedAt time.Time `bson:"createdAt" validate:"required"` UpdatedAt time.Time `bson:"updatedAt" validate:"required"` }
func (*Role) EnsureIndexes ¶
type User ¶
type User struct { ID primitive.ObjectID `bson:"_id,omitempty"` Name string `bson:"name" validate:"required,max=200"` Email string `bson:"email" validate:"required,email"` Password *string `bson:"password" validate:"required,min=6,max=100"` ProfilePicURL *string `bson:"profilePicUrl,omitempty" validate:"omitempty,max=500"` Roles []primitive.ObjectID `bson:"roles,omitempty" validate:"required"` Verified bool `bson:"verified" validate:"-"` Status bool `bson:"status" validate:"-"` CreatedAt time.Time `bson:"createdAt" validate:"required"` UpdatedAt time.Time `bson:"updatedAt" validate:"required"` // docs RoleDocs []*Role `bson:"-" validate:"-"` }
func (*User) EnsureIndexes ¶
Click to show internal directories.
Click to hide internal directories.