usecase

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package usecase account implementation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RoleUsecase

type RoleUsecase struct {
	// contains filtered or unexported fields
}

RoleUsecase provides bussiness logic for account access

func New

func New(repo rbac.Repository) *RoleUsecase

New object usecase

func NewDefault

func NewDefault() *RoleUsecase

NewDefault object usecase

func (*RoleUsecase) Count

func (a *RoleUsecase) Count(ctx context.Context, filter *rbac.Filter) (int64, error)

Count of roles by filter

func (*RoleUsecase) Create

func (a *RoleUsecase) Create(ctx context.Context, roleObj *model.Role) (uint64, error)

Create new object in database

func (*RoleUsecase) Delete

func (a *RoleUsecase) Delete(ctx context.Context, id uint64) error

Delete delites record by ID

func (*RoleUsecase) FetchList

func (a *RoleUsecase) FetchList(ctx context.Context, filter *rbac.Filter, order *rbac.Order, pagination *repository.Pagination) ([]*model.Role, error)

FetchList of roles by filter

func (*RoleUsecase) Get

func (a *RoleUsecase) Get(ctx context.Context, id uint64) (*model.Role, error)

Get returns the group by ID if have access

func (*RoleUsecase) GetByName

func (a *RoleUsecase) GetByName(ctx context.Context, name string) (*model.Role, error)

GetByName returns the role by name if have access

func (*RoleUsecase) Update

func (a *RoleUsecase) Update(ctx context.Context, id uint64, roleObj *model.Role) error

Update object in database

Jump to

Keyboard shortcuts

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