Documentation ¶
Index ¶
- Variables
- type BookingStore
- type Dropper
- type HotelStore
- type MongoBookingStore
- func (s *MongoBookingStore) Drop(ctx context.Context) error
- 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, room *types.Booking) (*types.Booking, error)
- func (s *MongoBookingStore) UpdateBooking(ctx context.Context, id string, update bson.M) error
- type MongoHotelStore
- func (s *MongoHotelStore) DeleteHotel(ctx context.Context, id string) error
- func (s *MongoHotelStore) Drop(ctx context.Context) error
- func (s *MongoHotelStore) GetHotelByID(ctx context.Context, id string) (*types.Hotel, error)
- func (s *MongoHotelStore) GetHotels(ctx context.Context, opts *options.FindOptions) ([]*types.Hotel, error)
- func (s *MongoHotelStore) InsertHotel(ctx context.Context, hotel *types.Hotel) (*types.Hotel, error)
- func (s *MongoHotelStore) InsertHotelRoom(ctx context.Context, room *types.Room) error
- func (s *MongoHotelStore) UpdateHotel(ctx context.Context, id string, params *types.UpdateHotelParams) 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) InsertUser(ctx context.Context, user *types.User) (*types.User, error)
- func (s *MongoUserStore) UpdateUser(ctx context.Context, id string, params *types.UpdateUserParams) error
- type RoomStore
- type Store
- type UserStore
Constants ¶
This section is empty.
Variables ¶
View Source
var (
MongoDBURL, MongoDBNAME, MongoTestDBNAME string
)
Functions ¶
This section is empty.
Types ¶
type BookingStore ¶
type HotelStore ¶
type HotelStore interface { GetHotelByID(context.Context, string) (*types.Hotel, error) GetHotels(context.Context, *options.FindOptions) ([]*types.Hotel, error) InsertHotel(context.Context, *types.Hotel) (*types.Hotel, error) InsertHotelRoom(context.Context, *types.Room) error UpdateHotel(context.Context, string, *types.UpdateHotelParams) error DeleteHotel(context.Context, string) error Dropper }
type MongoBookingStore ¶
type MongoBookingStore struct {
// contains filtered or unexported fields
}
func NewMongoBookingStore ¶
func NewMongoBookingStore(client *mongo.Client, dbname string) *MongoBookingStore
func (*MongoBookingStore) GetBookingByID ¶
func (*MongoBookingStore) GetBookings ¶
func (*MongoBookingStore) InsertBooking ¶
func (*MongoBookingStore) UpdateBooking ¶
type MongoHotelStore ¶
type MongoHotelStore struct {
// contains filtered or unexported fields
}
func (*MongoHotelStore) DeleteHotel ¶
func (s *MongoHotelStore) DeleteHotel(ctx context.Context, id string) error
func (*MongoHotelStore) GetHotelByID ¶
func (*MongoHotelStore) GetHotels ¶
func (s *MongoHotelStore) GetHotels(ctx context.Context, opts *options.FindOptions) ([]*types.Hotel, error)
func (*MongoHotelStore) InsertHotel ¶
func (*MongoHotelStore) InsertHotelRoom ¶
func (*MongoHotelStore) UpdateHotel ¶
func (s *MongoHotelStore) UpdateHotel(ctx context.Context, id string, params *types.UpdateHotelParams) error
type MongoRoomStore ¶
type MongoRoomStore struct {
// contains filtered or unexported fields
}
func (*MongoRoomStore) InsertRoom ¶
type MongoUserStore ¶
type MongoUserStore struct {
// contains filtered or unexported fields
}
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, id string, params *types.UpdateUserParams) error
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) UpdateUser(context.Context, string, *types.UpdateUserParams) error DeleteUser(context.Context, string) error Dropper }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.