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 ¶
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.
Click to show internal directories.
Click to hide internal directories.