repositories

package
v0.5.0-rc19 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterAccessRepository added in v0.4.0

type ClusterAccessRepository interface {
	// GetClustersAccessibleByUserId returns all clusters accessible by a user identified by user id
	GetClustersAccessibleByUserId(ctx context.Context, id uuid.UUID) ([]*projections.ClusterAccess, error)
	// GetClustersAccessibleByUserIdV2 returns all clusters accessible by a user identified by user id
	GetClustersAccessibleByUserIdV2(ctx context.Context, id uuid.UUID) ([]*projections.ClusterAccessV2, error)
}

ClusterAccessRepository is a repository for reading accesses to a cluster.

func NewClusterAccessRepository added in v0.3.0

func NewClusterAccessRepository(tenantClusterBindingRepo TenantClusterBindingRepository, clusterRepo ClusterRepository, userRoleBindingRepo UserRoleBindingRepository, tenantRepo TenantRepository) ClusterAccessRepository

NewClusterAccessRepository creates a repository for reading cluster access projections.

type ClusterRepository

type ClusterRepository interface {
	DomainRepository[*projections.Cluster]
	// ByName searches for the a tenant projection by it's name
	ByClusterName(context.Context, string) (*projections.Cluster, error)
}

ClusterRepository is a repository for reading and writing cluster projections.

func NewClusterRepository

func NewClusterRepository(repository es.Repository[*projections.Cluster]) ClusterRepository

NewClusterRepository creates a repository for reading and writing cluster projections.

type DomainRepository added in v0.4.0

type DomainRepository[T projections.DomainProjection] interface {
	es.Repository[T]
	// All returns all projections in the repository.
	AllWith(ctx context.Context, includeDeleted bool) ([]T, error)
}

Repository is a repository for reading projections.

func NewDomainRepository added in v0.4.0

func NewDomainRepository[T projections.DomainProjection](repository es.Repository[T]) DomainRepository[T]

NewDomainRepository creates a repository for reading and writing domain projections.

type TenantClusterBindingRepository added in v0.3.0

type TenantClusterBindingRepository interface {
	DomainRepository[*projections.TenantClusterBinding]
	GetByTenantId(ctx context.Context, tenantId uuid.UUID) ([]*projections.TenantClusterBinding, error)
	GetByClusterId(ctx context.Context, tenantId uuid.UUID) ([]*projections.TenantClusterBinding, error)
	GetByTenantAndClusterId(ctx context.Context, tenantId, clusterId uuid.UUID) (*projections.TenantClusterBinding, error)
}

TenantClusterBindingRepository is a repository for reading and writing tenantclusterbinding projections.

func NewTenantClusterBindingRepository added in v0.3.0

func NewTenantClusterBindingRepository(repository es.Repository[*projections.TenantClusterBinding]) TenantClusterBindingRepository

NewTenantClusterBindingRepository creates a repository for reading and writing tenantclusterbinding projections.

type TenantRepository

type TenantRepository interface {
	DomainRepository[*projections.Tenant]
	// ByName searches for the a tenant projection by it's name
	ByName(context.Context, string) (*projections.Tenant, error)
}

TenantRepository is a repository for reading and writing tenant projections.

func NewTenantRepository

func NewTenantRepository(repository es.Repository[*projections.Tenant]) TenantRepository

NewTenantRepository creates a repository for reading and writing tenant projections.

type TenantUserRepository added in v0.4.0

type TenantUserRepository interface {
	// GetTenantUsersById searches for users belonging to a tenant.
	GetTenantUsersById(context.Context, uuid.UUID) ([]*projections.TenantUser, error)
}

TenantUserRepository is a repository for reading users of a tenant.

func NewTenantUserRepository

func NewTenantUserRepository(userRepo UserRepository, userRoleBindingRepo UserRoleBindingRepository, tenantRepo TenantRepository) TenantUserRepository

NewTenantUserRepository creates a repository for reading and writing tenantuser projections.

type UserRepository

type UserRepository interface {
	DomainRepository[*projections.User]
	// ByUserId searches for the a user projection by it's id.
	ByUserId(context.Context, uuid.UUID) (*projections.User, error)
	// ByEmail searches for the a user projection by it's email address.
	ByEmail(context.Context, string) (*projections.User, error)
	// ByEmail searches for the a user projection by it's email address.
	ByEmailIncludingDeleted(context.Context, string) ([]*projections.User, error)
	// GetCount returns the user count
	GetCount(context.Context, bool) (int, error)
}

UserRepository is a repository for reading and writing user projections.

func NewUserRepository

func NewUserRepository(repository es.Repository[*projections.User], roleBindingRepo UserRoleBindingRepository) UserRepository

NewUserRepository creates a repository for reading and writing user projections.

type UserRoleBindingRepository

type UserRoleBindingRepository interface {
	DomainRepository[*projections.UserRoleBinding]
	// ByUserId searches for all UserRoleBinding projection's by the user id.
	ByUserId(context.Context, uuid.UUID) ([]*projections.UserRoleBinding, error)
	// ByUserIdScopeAndResource searches for all UserRoleBinding projection's by the user id and the scope.
	ByUserIdScopeAndResource(context.Context, uuid.UUID, es.Scope, string) ([]*projections.UserRoleBinding, error)
	// ByScopeAndResource returns all UserRoleBinding projections matching the given scope and resource.
	ByScopeAndResource(context.Context, es.Scope, uuid.UUID) ([]*projections.UserRoleBinding, error)
}

UserRoleBindingRepository is a repository for reading and writing UserRoleBinding projections.

func NewUserRoleBindingRepository

func NewUserRoleBindingRepository(repository es.Repository[*projections.UserRoleBinding]) UserRoleBindingRepository

NewUserRoleBindingRepository creates a repository for reading and writing UserRoleBinding projections.

Jump to

Keyboard shortcuts

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