authrepository

package
v0.0.0-...-fd201ba Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUnitOfWork

func NewUnitOfWork(log logger.Logger, db *sql.DB) port.AuthUnitOfWork

Types

type ACLRepository

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

func NewACLRepository

func NewACLRepository(log logger.Logger, tx *sql.Tx) *ACLRepository

func (*ACLRepository) AssignRolesToUser

func (r *ACLRepository) AssignRolesToUser(userID uint64, roleIDs []uint64) error

type MockACLRepository

type MockACLRepository struct {
	mock.Mock
}

func (*MockACLRepository) AssignRolesToUser

func (r *MockACLRepository) AssignRolesToUser(userID uint64, roleIDs []uint64) error

type MockPermissionRepository

type MockPermissionRepository struct {
	mock.Mock
}

func (*MockPermissionRepository) FilterValidPermissions

func (r *MockPermissionRepository) FilterValidPermissions(uuids []uuid.UUID) ([]uint64, error)

func (*MockPermissionRepository) GetUserPermissionKeys

func (r *MockPermissionRepository) GetUserPermissionKeys(userID uint64) ([]domain.PermissionKeyType, error)

func (*MockPermissionRepository) List

type MockRoleRepository

type MockRoleRepository struct {
	mock.Mock
}

func (*MockRoleRepository) Create

func (r *MockRoleRepository) Create(role domain.Role) error

func (*MockRoleRepository) Delete

func (r *MockRoleRepository) Delete(uuid uuid.UUID, deletedBy uint64) error

func (*MockRoleRepository) ExistKey

func (r *MockRoleRepository) ExistKey(key domain.RoleKeyType) (bool, error)

func (*MockRoleRepository) GetByUUID

func (r *MockRoleRepository) GetByUUID(uuid uuid.UUID) (*domain.Role, error)

func (*MockRoleRepository) GetPermissions

func (r *MockRoleRepository) GetPermissions(roleUUID uuid.UUID) (*domain.Role, error)

func (*MockRoleRepository) GetRoleUser

func (r *MockRoleRepository) GetRoleUser() (domain.Role, error)

func (*MockRoleRepository) GetUserRoleKeys

func (r *MockRoleRepository) GetUserRoleKeys(userID uint64) ([]domain.RoleKeyType, error)

func (*MockRoleRepository) List

func (r *MockRoleRepository) List() ([]*domain.Role, error)

func (*MockRoleRepository) SyncPermissions

func (r *MockRoleRepository) SyncPermissions(roleID uint64, permissionIDs []uint64) error

func (*MockRoleRepository) Update

func (r *MockRoleRepository) Update(role domain.Role, uuid uuid.UUID) error

type MockUnitOfWork

type MockUnitOfWork struct {
	mock.Mock
}

func (*MockUnitOfWork) ACLRepository

func (r *MockUnitOfWork) ACLRepository() port.ACLRepository

func (*MockUnitOfWork) BeginTx

func (r *MockUnitOfWork) BeginTx(ctx context.Context) error

func (*MockUnitOfWork) Commit

func (r *MockUnitOfWork) Commit() error

func (*MockUnitOfWork) PermissionRepository

func (r *MockUnitOfWork) PermissionRepository() port.PermissionRepository

func (*MockUnitOfWork) RoleRepository

func (r *MockUnitOfWork) RoleRepository() port.RoleRepository

func (*MockUnitOfWork) Rollback

func (r *MockUnitOfWork) Rollback() error

type PermissionRepository

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

func NewPermissionRepository

func NewPermissionRepository(log logger.Logger, tx *sql.Tx) *PermissionRepository

func (*PermissionRepository) FilterValidPermissions

func (r *PermissionRepository) FilterValidPermissions(uuids []uuid.UUID) ([]uint64, error)

func (*PermissionRepository) GetUserPermissionKeys

func (r *PermissionRepository) GetUserPermissionKeys(userID uint64) ([]domain.PermissionKeyType, error)

func (*PermissionRepository) List

func (r *PermissionRepository) List() ([]*domain.Permission, error)

type RoleRepository

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

func NewRoleRepository

func NewRoleRepository(log logger.Logger, tx *sql.Tx) *RoleRepository

func (*RoleRepository) Create

func (r *RoleRepository) Create(role domain.Role) error

func (*RoleRepository) Delete

func (r *RoleRepository) Delete(uuid uuid.UUID, deletedBy uint64) error

func (*RoleRepository) ExistKey

func (r *RoleRepository) ExistKey(key domain.RoleKeyType) (bool, error)

func (*RoleRepository) GetByUUID

func (r *RoleRepository) GetByUUID(uuid uuid.UUID) (*domain.Role, error)

func (*RoleRepository) GetPermissions

func (r *RoleRepository) GetPermissions(roleUUID uuid.UUID) (*domain.Role, error)

func (*RoleRepository) GetRoleUser

func (r *RoleRepository) GetRoleUser() (role domain.Role, err error)

func (*RoleRepository) GetUserRoleKeys

func (r *RoleRepository) GetUserRoleKeys(userID uint64) ([]domain.RoleKeyType, error)

func (*RoleRepository) List

func (r *RoleRepository) List() ([]*domain.Role, error)

func (*RoleRepository) SyncPermissions

func (r *RoleRepository) SyncPermissions(roleID uint64, permissionIDs []uint64) error

func (*RoleRepository) Update

func (r *RoleRepository) Update(role domain.Role, uuid uuid.UUID) error

Jump to

Keyboard shortcuts

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