Documentation
¶
Index ¶
- Constants
- type BookingStore
- type Dropper
- type HotelStore
- type MongoBookingStore
- func (s *MongoBookingStore) GetBookings(ctx context.Context, filter bson.M) ([]*types.Booking, error)
- func (s *MongoBookingStore) GetBookingsByID(ctx context.Context, id primitive.ObjectID) (*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) GetHotelByID(ctx context.Context, id primitive.ObjectID) (*types.Hotel, error)
- func (s *MongoHotelStore) GetHotels(ctx context.Context, filter bson.M) ([]*types.Hotel, error)
- func (s *MongoHotelStore) InsertHotel(ctx context.Context, hotel *types.Hotel) (*types.Hotel, error)
- func (s *MongoHotelStore) UpdateHotels(ctx context.Context, filter bson.M, update bson.M) error
- type MongoRoomStore
- type MongoUserStore
- func (s *MongoUserStore) DeleteUsers(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) UpdateUsers(ctx context.Context, filter bson.M, params types.UpdateUserParams) error
- type RoomStore
- type Store
- type UserStorer
Constants ¶
View Source
const MongoDbEnvName = "MONGO_DB_NAME"
View Source
const (
Usercoll = "users"
)
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) GetBookings ¶
func (*MongoBookingStore) GetBookingsByID ¶
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) GetHotelByID ¶
func (*MongoHotelStore) InsertHotel ¶
func (*MongoHotelStore) UpdateHotels ¶
type MongoRoomStore ¶
type MongoRoomStore struct { HotelStore *MongoHotelStore // Embed an instance of MongoHotelStore // contains filtered or unexported fields }
func NewMongoRoomStore ¶
func NewMongoRoomStore(client *mongo.Client, hotelStore *MongoHotelStore) *MongoRoomStore
func (*MongoRoomStore) InsertRoom ¶
func (*MongoRoomStore) UpdateHotels ¶
type MongoUserStore ¶
type MongoUserStore struct {
// contains filtered or unexported fields
}
func NewMongoUserStore ¶
func NewMongoUserStore(c *mongo.Client) *MongoUserStore
func (*MongoUserStore) DeleteUsers ¶
func (s *MongoUserStore) DeleteUsers(ctx context.Context, id string) error
func (*MongoUserStore) GetUserByEmail ¶
func (*MongoUserStore) GetUserByID ¶
func (*MongoUserStore) InsertUsers ¶
func (*MongoUserStore) UpdateUsers ¶
func (s *MongoUserStore) UpdateUsers(ctx context.Context, filter bson.M, params types.UpdateUserParams) error
type Store ¶
type Store struct { User UserStorer Hotel HotelStore Room RoomStore Booking BookingStore }
type UserStorer ¶
type UserStorer interface { Dropper GetUserByEmail(context.Context, 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) DeleteUsers(context.Context, string) error UpdateUsers(ctx context.Context, filter bson.M, params types.UpdateUserParams) error }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.