Documentation ¶
Index ¶
- type Repository
- type User
- type UserRepo
- func (r *UserRepo) CreateUser(ctx context.Context, newUser *User) error
- func (r *UserRepo) GetUserByEmail(ctx context.Context, email string) (*User, error)
- func (r *UserRepo) GetUserByID(ctx context.Context, id string) (*User, error)
- func (r *UserRepo) GetUsers(ctx context.Context, afterId string, limit int32) ([]User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type User ¶
type User struct { ID string `json:"id" bson:"_id,omitempty"` FullName string `json:"fullName" bson:"fullName,omitempty"` Email string `json:"email" bson:"email,omitempty"` Password string `json:"password" bson:"password,omitempty"` Country string `json:"country" bson:"country,omitempty"` TimeAdded time.Time `json:"timeAdded" bson:"timeAdded,omitempty"` LastUpdated time.Time `json:"lastUpdated" bson:"lastUpdated,omitempty"` }
type UserRepo ¶
type UserRepo struct {
// contains filtered or unexported fields
}
func NewRepository ¶
NewRepository returns a new user repository object that implements the Repository interface.
func (*UserRepo) CreateUser ¶
CreateUser adds a new user to the database.
func (*UserRepo) GetUserByEmail ¶
func (*UserRepo) GetUserByID ¶
Click to show internal directories.
Click to hide internal directories.