Documentation
¶
Index ¶
- Constants
- func NewMongoDBConn(cfg *Config) (*mongo.Database, error)
- func NewUserMongoRepo(db *mongo.Database) *userRepo
- func NewUserUC(userRepo MongoRepository) *userUC
- func ValidateStruct(ctx context.Context, s interface{}) error
- type Config
- type ErrorResponse
- type MongoDBConfig
- type MongoRepository
- type SignUpUserRequest
- type SignUpUserResponse
- type UseCase
- type User
Constants ¶
View Source
const ( ErrInvalidParameterValue = "invalid_parameter_value" ErrUnknownError = "unknown_error" ErrEmailAlreadyTaken = "email_already_taken" )
Variables ¶
This section is empty.
Functions ¶
func NewUserMongoRepo ¶
func NewUserUC ¶
func NewUserUC(userRepo MongoRepository) *userUC
func ValidateStruct ¶
Types ¶
type Config ¶
type Config struct {
MongoDB MongoDBConfig
}
type ErrorResponse ¶
type MongoDBConfig ¶
type MongoRepository ¶
type SignUpUserRequest ¶
type SignUpUserResponse ¶
type SignUpUserResponse struct {
Success bool `json:"success"`
}
type UseCase ¶
type UseCase interface {
SignUpUser(ctx context.Context, req *SignUpUserRequest) (*SignUpUserResponse, *ErrorResponse)
}
type User ¶
type User struct { ID primitive.ObjectID `bson:"_id"` Email string `bson:"email"` Password string `bson:"password"` }
func (*User) ComparePasswords ¶
func (*User) HashPassword ¶
func (*User) PrepareCreateUser ¶
Click to show internal directories.
Click to hide internal directories.