Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface { Get(filter map[string]interface{}, where, orderBy, selectField string) ([]*model.UserModel, error) Count(filter map[string]interface{}, where string) (int, error) Create(userReq *model.UserModel) (*model.UserModel, error) GetByID(id, selectField string) (*model.UserModel, error) Update(userReq *model.UserModel) (*model.UserModel, error) Delete(id string) error }
Repository represent the repositories
func NewPostgresRepository ¶
func NewPostgresRepository(DBRead *sqlx.DB, DBWrite *sqlx.DB) Repository
NewPostgresRepository will create an object that represent the Repository interface
type Service ¶
type Service interface { Create(req *form.UserForm) (*model.UserModel, int, error) Delete(id string) (int, error) Detail(id string, selectField string) (*model.UserModel, int, error) List(filter, filterCount map[string]interface{}, where, orderBy, selectField string) ([]*model.UserModel, int, int, error) Update(req *form.UserForm, id string) (*model.UserModel, int, error) }
Service represent the services
func NewService ¶
func NewService(log *logrus.Entry, r Repository) Service
NewService will create an object that represent the Service interface
Click to show internal directories.
Click to hide internal directories.