Documentation ¶
Index ¶
- Constants
- type BookingStore
- type Dropper
- type HotelStore
- type Map
- type MongoBookingStore
- func (s *MongoBookingStore) Get(ctx context.Context, filter Map) ([]*types.Booking, error)
- func (s *MongoBookingStore) GetByID(ctx context.Context, id string) (*types.Booking, error)
- func (s *MongoBookingStore) Insert(ctx context.Context, booking *types.Booking) (*types.Booking, error)
- func (s *MongoBookingStore) Update(ctx context.Context, id string, update Map) error
- type MongoHotelStore
- func (s *MongoHotelStore) Get(ctx context.Context, filter Map, pagination *Pagination) ([]*types.Hotel, error)
- func (s *MongoHotelStore) GetByID(ctx context.Context, id string) (*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) GetByEmail(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 Pagination
- type RoomStore
- type Store
- type UserStore
Constants ¶
View Source
const MongoDBEnvName = "MONGO_DB_NAME"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BookingStore ¶
type HotelStore ¶
type MongoBookingStore ¶
type MongoBookingStore struct {
// contains filtered or unexported fields
}
func NewMongoBookingStore ¶
func NewMongoBookingStore(client *mongo.Client) *MongoBookingStore
type MongoHotelStore ¶
type MongoHotelStore struct {
// contains filtered or unexported fields
}
func NewMongoHotelStore ¶
func NewMongoHotelStore(client *mongo.Client) *MongoHotelStore
func (*MongoHotelStore) Get ¶
func (s *MongoHotelStore) Get(ctx context.Context, filter Map, pagination *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
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) GetByEmail ¶
func (*MongoUserStore) GetUserByID ¶
func (*MongoUserStore) InsertUser ¶
func (*MongoUserStore) UpdateUser ¶
func (s *MongoUserStore) UpdateUser(ctx context.Context, id string, params types.UpdateUserParams) error
type Pagination ¶
type Store ¶
type Store struct { User UserStore Hotel HotelStore Room RoomStore Booking BookingStore }
type UserStore ¶
type UserStore interface { Dropper GetByEmail(context.Context, string) (*types.User, error) GetUserByID(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(context.Context, string, types.UpdateUserParams) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.