rbac

package
v0.0.0-...-833fa1d Latest Latest
Warning

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

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

Documentation

Overview

Package account present full API functionality of the specific object

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	ID             []uint64
	Names          []string
	MinAccessLevel int
	MaxAccessLevel int
}

Filter of the objects list

func (*Filter) PrepareQuery

func (fl *Filter) PrepareQuery(query *gorm.DB) *gorm.DB

type Order

type Order struct {
	ID          model.Order
	Name        model.Order
	Title       model.Order
	AccessLevel model.Order
	CreatedAt   model.Order
	UpdatedAt   model.Order
}

Order of the objects list

func (*Order) PrepareQuery

func (o *Order) PrepareQuery(query *gorm.DB) *gorm.DB

type Repository

type Repository interface {
	Get(ctx context.Context, id uint64) (*model.Role, error)
	GetByName(ctx context.Context, name string) (*model.Role, error)
	FetchList(ctx context.Context, filter *Filter, order *Order, pagination *repository.Pagination) ([]*model.Role, error)
	Count(ctx context.Context, filter *Filter) (int64, error)
	Create(ctx context.Context, role *model.Role) (uint64, error)
	Update(ctx context.Context, id uint64, role *model.Role) error
	Delete(ctx context.Context, id uint64) error
}

Repository of access to the account

type Usecase

type Usecase interface {
	Get(ctx context.Context, id uint64) (*model.Role, error)
	GetByName(ctx context.Context, title string) (*model.Role, error)
	FetchList(ctx context.Context, filter *Filter, order *Order, pagination *repository.Pagination) ([]*model.Role, error)
	Count(ctx context.Context, filter *Filter) (int64, error)
	Create(ctx context.Context, role *model.Role) (uint64, error)
	Update(ctx context.Context, id uint64, role *model.Role) error
	Delete(ctx context.Context, id uint64) error
}

Usecase of the account

Directories

Path Synopsis
delivery
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package repository implements methods of working with the repository objects
Package repository implements methods of working with the repository objects
Package usecase account implementation
Package usecase account implementation

Jump to

Keyboard shortcuts

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