Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreateUserRequest ¶
type CreateUserRequest struct { Name string `json:"name"` Email string `json:"email"` Password string `json:"password"` Roles []string `json:"roles"` }
func (CreateUserRequest) Validate ¶
func (m CreateUserRequest) Validate() error
Validate validates the CreateAlbumRequest fields.
type Repository ¶
type Repository interface { Get(ctx context.Context, id primitive.ObjectID) (entity.User, error) GetByEmail(ctx context.Context, id string) (entity.User, error) Create(ctx context.Context, user entity.User) (*primitive.ObjectID, error) //GetByEmailAndPassword(ctx context.Context, email string, hashedPassword []byte) (entity.User, error) StartSession() (mongo.Session, error) }
Repository encapsulates the logic to access categories from the data source.
func NewRepository ¶
func NewRepository(db *dbcontext.DB, logger log.Logger) Repository
type Service ¶
type Service interface { Get(ctx context.Context, id primitive.ObjectID) (*User, error) GetByEmail(ctx context.Context, email string) (User, error) Create(ctx context.Context, req CreateUserRequest) (*User, error) }
Service encapsulates use case logic for businessCategories.
func NewService ¶
func NewService(repo Repository, logger log.Logger) Service
NewService creates a new category service.
Click to show internal directories.
Click to hide internal directories.