Documentation
¶
Index ¶
- Constants
- type Dropper
- type HotelStore
- type MongoHotelStore
- func (s *MongoHotelStore) GetHotelByID(ctx context.Context, id string) (*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) Update(ctx context.Context, filter bson.M, update bson.M) 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) 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 bson.M, params types.UpdateUserParams) error
- type RoomStore
- type Store
- type UserStore
Constants ¶
View Source
const ( DBNAME = "hot-res" TestDBNAME = "hot-res-test" DBURI = "mongodb://localhost:27017" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HotelStore ¶
type MongoHotelStore ¶
type MongoHotelStore struct {
// contains filtered or unexported fields
}
func NewMongoHotelStore ¶
func NewMongoHotelStore(client *mongo.Client) *MongoHotelStore
func (*MongoHotelStore) GetHotelByID ¶
func (*MongoHotelStore) InsertHotel ¶
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) GetUserByID ¶
func (*MongoUserStore) InsertUser ¶
func (*MongoUserStore) UpdateUser ¶
func (s *MongoUserStore) UpdateUser(ctx context.Context, filter bson.M, params types.UpdateUserParams) error
type Store ¶
type Store struct { User UserStore Hotel HotelStore Room RoomStore }
type UserStore ¶
type UserStore interface { Dropper 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(ctx context.Context, filter bson.M, params types.UpdateUserParams) error }
Click to show internal directories.
Click to hide internal directories.