Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTokenFromUser ¶
func IsPasswordValid ¶
Types ¶
type Booking ¶
type Booking struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` UserID primitive.ObjectID `bson:"userID,omitempty" json:"userID,omitempty"` RoomID primitive.ObjectID `bson:"roomID,omitempty" json:"roomID,omitempty"` NumGuests int `bson:"numGuests" json:"numGuests"` FromDate time.Time `bson:"fromDate" json:"fromDate"` ToDate time.Time `bson:"toDate" json:"toDate"` Canceled bool `bson:"canceled,omitempty" json:"canceled,omitempty"` }
type InsertUserParams ¶
type InsertUserParams struct { FirstName string `json:"firstName"` LastName string `json:"lastName"` Email string `json:"email"` Password string `json:"password"` }
func (InsertUserParams) Validate ¶
func (params InsertUserParams) Validate() map[string]string
type Room ¶
type Room struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` Size string `bson:"size" json:"size"` Seaside bool `bson:"seaside" json:"seaside"` Price float64 `bson:"price" json:"price"` HotelID primitive.ObjectID `bson:"hotelID" json:"hotelID"` Available bool `bson:"-" json:"available"` }
type RoomType ¶
type RoomType int
const ( SingleRoomType RoomType DoubleRoomType SeasideRoomType DeluxeRoomType )
type UpdateUserParams ¶
type UpdateUserParams struct { FirstName string `json:"firstName"` LastName string `json:"lastName"` }
func (UpdateUserParams) ToBSON ¶
func (p UpdateUserParams) ToBSON() bson.M
type User ¶
type User struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` FirstName string `bson:"firstName" json:"firstName"` LastName string `bson:"lastName" json:"lastName"` Email string `bson:"email" json:"email"` EncryptedPassword string `bson:"Encryptedpassword" json:"-"` IsAdmin bool `bson: "isAdmin" json"isAdmin"` }
func NewUserFromParams ¶
func NewUserFromParams(params InsertUserParams) (*User, error)
Click to show internal directories.
Click to hide internal directories.