tenantparentmapping

package
v0.0.0-...-a423d60 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// TenantParentsTable the name of the table containing parency relations
	TenantParentsTable = "tenant_parents"
	// TenantIDColumn the column containing the tenant ID
	TenantIDColumn = "tenant_id"
	// ParentIDColumn the column containing the parent ID
	ParentIDColumn = "parent_id"
)

Variables

This section is empty.

Functions

func NewRepository

func NewRepository() *pgRepository

NewRepository returns a new entity responsible for repo-layer tenant operations. All of its methods require persistence.PersistenceOp it the provided context.

Types

type TenantParent

type TenantParent struct {
	TenantID string `db:"tenant_id"`
	ParentID string `db:"parent_id"`
}

TenantParent defines tenant parent record

type TenantParentCollection

type TenantParentCollection []TenantParent

TenantParentCollection is a wrapper type for slice of entities.

func (TenantParentCollection) GetParentIDs

func (tpc TenantParentCollection) GetParentIDs() []string

GetParentIDs returns list of all parent ids.

func (TenantParentCollection) GetTenantIDs

func (tpc TenantParentCollection) GetTenantIDs() []string

GetTenantIDs returns list of all tenant ids.

func (TenantParentCollection) Len

func (tpc TenantParentCollection) Len() int

Len returns the current number of entities in the collection.

type TenantParentRepository

type TenantParentRepository interface {
	ListParents(ctx context.Context, tenantID string) ([]string, error)
	ListByParent(ctx context.Context, parentID string) ([]string, error)
	UpsertMultiple(ctx context.Context, tenantID string, parentIDs []string) error
	Upsert(ctx context.Context, tenantID string, parentID string) error
	Delete(ctx context.Context, tenantID string, parentID string) error
}

TenantParentRepository is responsible for the repo-layer tenant operations.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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