Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserData ¶
type UserData struct { ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"` Username string `json:"username,omitempty" bson:"username,omitempty"` EmailAddress string `json:"emailAddress,omitempty" bson:"email_address,omitempty"` Password []byte `json:"password,omitempty" bson:"password,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty" bson:"created_at,omitempty"` }
UserData is used only to push data to db
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(logger *zerolog.Logger, collection *mongo.Collection) *UserRepository
func (*UserRepository) CreateUser ¶
func (r *UserRepository) CreateUser( ctx context.Context, username, emailAddress string, passwordHash []byte) (*entities.User, error)
CreateUser inserts newly registered user into storage
func (*UserRepository) GetUserByID ¶
GetUserByID retrieves user info from storage
Click to show internal directories.
Click to hide internal directories.