Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Monster ¶
type Monster struct { ID primitive.ObjectID `json:"_id" bson:"_id,omitempty"` MonsterTypes []primitive.ObjectID `json:"monster_types" bson:"monster_types"` Name string `json:"name" bson:"name"` ImageUrl string `json:"image_url" bson:"image_url"` Description string `json:"description" bson:"description"` Size float32 `json:"size" bson:"size"` Weight float32 `json:"weight" bson:"weight"` Hp int32 `json:"hp" bson:"hp"` Attack int32 `json:"attack" bson:"attack"` Defense int32 `json:"defense" bson:"defense"` Speed int32 `json:"speed" bson:"speed"` CreatedAt time.Time `json:"created_at" bson:"created_at"` UpdatedAt time.Time `json:"updated_at" bson:"updated_at"` }
type MonsterList ¶
type MonsterType ¶
type MonsterTypeBody ¶
type MonsterTypeList ¶
type MonsterTypeUpdate ¶
type MonsterUpdate ¶
type MonsterUpdate struct { ID primitive.ObjectID `json:"_id,omitempty"` Name string `json:"name"` Description string `json:"description"` Size float32 `json:"size"` Weight float32 `json:"weight"` Hp int32 `json:"hp"` Attack int32 `json:"attack"` Defense int32 `json:"defense"` Speed int32 `json:"speed"` }
type User ¶
type User struct { ID primitive.ObjectID `json:"_id" bson:"_id,omitempty"` Monsters []primitive.ObjectID `json:"monsters" bson:"monsters"` Username string `json:"username" bson:"username" validate:"required"` Password string `json:"password,omitempty" bson:"password" validate:"required,gte=6"` Role *string `json:"role" bson:"role" validate:"required"` CreatedAt time.Time `json:"created_at" bson:"created_at"` UpdatedAt time.Time `json:"updated_at" bson:"updated_at"` }
func (*User) ComparePasswords ¶
func (*User) HashPassword ¶
func (*User) PrepareCreate ¶
func (*User) SanitizePassword ¶
func (u *User) SanitizePassword()
type UserMonsterBody ¶
type UserUpdate ¶
type UserUpdate struct { ID primitive.ObjectID `json:"_id,omitempty"` Username string `json:"username"` Role *string `json:"role"` }
func (*UserUpdate) PrepareUpdate ¶
func (u *UserUpdate) PrepareUpdate() error
type UserWithToken ¶
Click to show internal directories.
Click to hide internal directories.