repositories

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRepository

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

BaseRepository represents base repository object.

func NewBaseRepository

func NewBaseRepository(db *gorm.DB) *BaseRepository

NewBaseRepository creates new Base repository.

func (BaseRepository) GetDB

func (r BaseRepository) GetDB() *gorm.DB

GetDB returns current DB instance.

type BaseRepositoryProvider

type BaseRepositoryProvider interface {
	// GetDB returns current DB instance.
	GetDB() *gorm.DB
}

BaseRepositoryProvider provides base repository interface.

type RoleCachedRepository

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

RoleCachedRepository cached repository to work with `role` entity.

func NewRoleCachedRepository

func NewRoleCachedRepository(
	ctx context.Context, db *gorm.DB, namespaceEventListener dao.EventListenerProvider,
) (*RoleCachedRepository, error)

NewRoleCachedRepository creates new instance of cached repository to work with `role` entity.

func (RoleCachedRepository) ValidateRolesAccessToNamespace

func (r RoleCachedRepository) ValidateRolesAccessToNamespace(
	ctx context.Context, requestedRoles []string, requestedNamespaceCode string,
) (bool, error)

ValidateRolesAccessToNamespace makes validation that requested roles has access to requested namespace.

type RoleRepositoryProvider

type RoleRepositoryProvider interface {
	// ValidateRolesAccessToNamespace makes validation that requested roles has access to requested namespace.
	ValidateRolesAccessToNamespace(ctx context.Context, roles []string, namespaceCode string) (bool, error)
}

RoleRepositoryProvider provides an interface to work with `role` entity.

Jump to

Keyboard shortcuts

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