Documentation ¶
Index ¶
- Constants
- type MongoUserStore
- func (s *MongoUserStore) DeleteUser(ctx context.Context, id string) 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, values bson.M) error
- type UserStore
Constants ¶
View Source
const DBNAME = "hotel-reservation"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 ¶
type UserStore ¶
type UserStore interface { 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, bson.M, bson.M) error Drop(context.Context) error }
Click to show internal directories.
Click to hide internal directories.