Documentation ¶
Index ¶
- type RoleRepository
- type RoleRepositoryImpl
- func (repo *RoleRepositoryImpl) Create(ctx context.Context, role entity.Role) (id int, err error)
- func (repo *RoleRepositoryImpl) Delete(ctx context.Context, id int) (err error)
- func (repo *RoleRepositoryImpl) GetAll(ctx context.Context, filter model.RequestGetAll) (roles []entity.Role, total int, err error)
- func (repo *RoleRepositoryImpl) GetByID(ctx context.Context, id int) (role *entity.Role, err error)
- func (repo *RoleRepositoryImpl) GetByName(ctx context.Context, name string) (role *entity.Role, err error)
- func (repo *RoleRepositoryImpl) Update(ctx context.Context, role entity.Role) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RoleRepository ¶
type RoleRepository interface { // Create adds a new role to the repository. Create(ctx context.Context, role entity.Role) (id int, err error) // GetByID retrieves a role by its unique identifier. GetByID(ctx context.Context, id int) (role *entity.Role, err error) // GetByName retrieves a role by its name. GetByName(ctx context.Context, name string) (role *entity.Role, err error) // GetAll retrieves all roles based on a filter for pagination. GetAll(ctx context.Context, filter model.RequestGetAll) (roles []entity.Role, total int, err error) // Update modifies role information in the repository. Update(ctx context.Context, role entity.Role) (err error) // Delete removes a role from the repository by its ID. Delete(ctx context.Context, id int) (err error) }
func NewRoleRepository ¶
func NewRoleRepository() RoleRepository
type RoleRepositoryImpl ¶
type RoleRepositoryImpl struct {
// contains filtered or unexported fields
}
func (*RoleRepositoryImpl) Delete ¶
func (repo *RoleRepositoryImpl) Delete(ctx context.Context, id int) (err error)
func (*RoleRepositoryImpl) GetAll ¶
func (repo *RoleRepositoryImpl) GetAll(ctx context.Context, filter model.RequestGetAll) (roles []entity.Role, total int, err error)
Click to show internal directories.
Click to hide internal directories.