Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface { Create(ctx context.Context, user *User) error Get(ctx context.Context, id string) (*User, error) GetAll(ctx context.Context) ([]*User, error) Update(ctx context.Context, id string, user *UpdateUser) error Delete(ctx context.Context, id string) error }
Repository represent the user's repository contract
type UpdateUser ¶
type UpdateUser struct { Email string `json:"email" validate:"email,required"` Name string `json:"name" validate:"gte=1,lte=50"` Age uint32 `json:"age" validate:"gte=0,lte=130"` }
UpdateUser is used when updating
type Usecase ¶
type Usecase interface { Repository }
Usecase represents the user usecases It shares the same interface than the entity Repository plus something specific to the usecase
func NewUsecase ¶
func NewUsecase(repo Repository) Usecase
NewUsecase creates a new usecase object to implement Usecase interface
Click to show internal directories.
Click to hide internal directories.