repository

package
v0.0.0-...-e2b7729 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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) Create

func (repo *RoleRepositoryImpl) Create(ctx context.Context, role entity.Role) (id int, err error)

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)

func (*RoleRepositoryImpl) GetByID

func (repo *RoleRepositoryImpl) GetByID(ctx context.Context, id int) (role *entity.Role, err error)

func (*RoleRepositoryImpl) GetByName

func (repo *RoleRepositoryImpl) GetByName(ctx context.Context, name string) (role *entity.Role, err error)

func (*RoleRepositoryImpl) Update

func (repo *RoleRepositoryImpl) Update(ctx context.Context, role entity.Role) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL