Documentation ¶
Index ¶
- Constants
- type BookingStore
- type Dropper
- type HotelStore
- type Map
- type MongoBookingStore
- func (s *MongoBookingStore) GetBookingByID(ctx context.Context, id string) (*types.Booking, error)
- func (s *MongoBookingStore) GetBookings(ctx context.Context, filter bson.M) ([]*types.Booking, error)
- func (s *MongoBookingStore) InsertBooking(ctx context.Context, booking *types.Booking) (*types.Booking, error)
- func (s *MongoBookingStore) UpdateBooking(ctx context.Context, id string, update bson.M) error
- type MongoHotelStore
- func (s *MongoHotelStore) GetHOtelsByID(ctx context.Context, id string) (*types.Hotel, error)
- func (s *MongoHotelStore) GetHotels(ctx context.Context, filter Map, page *Pagination) ([]*types.Hotel, error)
- func (s *MongoHotelStore) Insert(ctx context.Context, hotel *types.Hotel) (*types.Hotel, error)
- func (s *MongoHotelStore) Update(ctx context.Context, filter Map, update Map) error
- type MongoRoomStore
- type MongoUserStore
- func (s *MongoUserStore) DeleteUser(ctx context.Context, id string) error
- func (s *MongoUserStore) Drop(ctx context.Context) error
- func (s *MongoUserStore) GetUserByEmail(ctx context.Context, email string) (*types.User, error)
- func (s *MongoUserStore) GetUserByID(ctx context.Context, id string) (*types.User, error)
- func (s *MongoUserStore) GetUsers(ctx context.Context) ([]*types.User, error)
- func (s *MongoUserStore) InsertUsers(ctx context.Context, user *types.User) (*types.User, error)
- func (s *MongoUserStore) USerUpdate(ctx context.Context, filter bson.M, values types.UpdateUserParams) error
- type Pagination
- type RoomStore
- type Store
- type UserStore
Constants ¶
View Source
const MongoDBNameEnvName = "booking-room"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BookingStore ¶
type BookingStore interface { InsertBooking(ctx context.Context, booking *types.Booking) (*types.Booking, error) GetBookings(ctx context.Context, filter bson.M) ([]*types.Booking, error) GetBookingByID(ctx context.Context, id string) (*types.Booking, error) UpdateBooking(ctx context.Context, id string, update bson.M) error }
type HotelStore ¶
type HotelStore interface { Insert(context.Context, *types.Hotel) (*types.Hotel, error) Update(ctx context.Context, filter Map, update Map) error GetHotels(ctx context.Context, filter Map, pagination *Pagination) ([]*types.Hotel, error) GetHOtelsByID(ctx context.Context, id string) (*types.Hotel, error) }
type MongoBookingStore ¶
type MongoBookingStore struct {
// contains filtered or unexported fields
}
func NewMongoBookingStore ¶
func NewMongoBookingStore(client *mongo.Client) *MongoBookingStore
func (*MongoBookingStore) GetBookingByID ¶
func (*MongoBookingStore) GetBookings ¶
func (*MongoBookingStore) InsertBooking ¶
func (*MongoBookingStore) UpdateBooking ¶
type MongoHotelStore ¶
type MongoHotelStore struct {
// contains filtered or unexported fields
}
func NewMongoHotelStore ¶
func NewMongoHotelStore(client *mongo.Client) *MongoHotelStore
func (*MongoHotelStore) GetHOtelsByID ¶
func (*MongoHotelStore) GetHotels ¶
func (s *MongoHotelStore) GetHotels(ctx context.Context, filter Map, page *Pagination) ([]*types.Hotel, error)
type MongoRoomStore ¶
type MongoRoomStore struct { HotelStore // contains filtered or unexported fields }
func NewMongoRoomStore ¶
func NewMongoRoomStore(client *mongo.Client, hotelStore HotelStore) *MongoRoomStore
func (*MongoRoomStore) InsertRoom ¶
type MongoUserStore ¶
type MongoUserStore struct {
// contains filtered or unexported fields
}
func NewMongoUserStore ¶
func NewMongoUserStore(client *mongo.Client) *MongoUserStore
func (*MongoUserStore) DeleteUser ¶
func (s *MongoUserStore) DeleteUser(ctx context.Context, id string) error
func (*MongoUserStore) GetUserByEmail ¶
func (*MongoUserStore) GetUserByID ¶
func (*MongoUserStore) InsertUsers ¶
func (*MongoUserStore) USerUpdate ¶
func (s *MongoUserStore) USerUpdate(ctx context.Context, filter bson.M, values types.UpdateUserParams) error
type Pagination ¶
type Store ¶
type Store struct { Hotels HotelStore Rooms RoomStore User UserStore Booking BookingStore }
type UserStore ¶
type UserStore interface { Dropper GetUserByEmail(ctx context.Context, email string) (*types.User, error) GetUserByID(context.Context, string) (*types.User, error) GetUsers(context.Context) ([]*types.User, error) InsertUsers(context.Context, *types.User) (*types.User, error) DeleteUser(context.Context, string) error USerUpdate(ctx context.Context, filter bson.M, values types.UpdateUserParams) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.