Documentation ¶
Index ¶
- Constants
- type BookingStore
- type HotelStore
- type MongoBookingStore
- func (s *MongoBookingStore) GetBookingByID(ctx context.Context, id string) (*types.Booking, error)
- func (s *MongoBookingStore) GetBookings(ctx context.Context, filter map[string]any) ([]*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 map[string]any) error
- type MongoHotelStore
- func (s *MongoHotelStore) GetHotel(ctx context.Context, id string) (*types.Hotel, error)
- func (s *MongoHotelStore) GetHotels(ctx context.Context, filter map[string]any, 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, update map[string]any) error
- type MongoRoomStore
- type MongoUserStore
- func (s *MongoUserStore) DeleteUser(ctx context.Context, id string) 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) InsertUser(ctx context.Context, user *types.User) (*types.User, error)
- func (s *MongoUserStore) UpdateUser(ctx context.Context, filter map[string]any, params types.UpdateUserParams) error
- type Pagination
- type RoomStore
- type Store
- type UserStore
Constants ¶
View Source
const ( ENV_DB_NAME = "MONGODB_DB_NAME" ENV_DB_URI = "MONGODB_DB_URI" ENV_TEST_DB_URI = "MONGODB_TEST_DB_URI" ENV_LISTEN_ADDRESS = "HTTP_LISTEN_ADDRESS" ENV_JWT_SECRET = "JWT_SECRET" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BookingStore ¶
type HotelStore ¶
type MongoBookingStore ¶
type MongoBookingStore struct { BookingStore // 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) GetHotels ¶
func (s *MongoHotelStore) GetHotels(ctx context.Context, filter map[string]any, 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) GetRoomByID ¶
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) InsertUser ¶
func (*MongoUserStore) UpdateUser ¶
func (s *MongoUserStore) UpdateUser(ctx context.Context, filter map[string]any, params types.UpdateUserParams) error
type Pagination ¶
type Store ¶
type Store struct { User UserStore Hotel HotelStore Room RoomStore Booking BookingStore }
type UserStore ¶
type UserStore interface { GetUserByID(context.Context, string) (*types.User, error) GetUserByEmail(context.Context, string) (*types.User, error) GetUsers(context.Context) ([]*types.User, error) InsertUser(context.Context, *types.User) (*types.User, error) DeleteUser(context.Context, string) error UpdateUser(ctx context.Context, filter map[string]any, params types.UpdateUserParams) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.