tenancy

package
v1.4.25 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package tenancy defines tier-neutral organization scoping primitives.

Index

Constants

View Source
const DefaultOrgID = "default"

DefaultOrgID is the organization used when no explicit organization is supplied. It preserves the single-tenant OSS data layout.

Variables

This section is empty.

Functions

func NormalizeOrgID

func NormalizeOrgID(orgID string) string

NormalizeOrgID returns a non-empty organization ID.

Types

type OrgScope

type OrgScope struct {
	Write string
	Read  []string
}

OrgScope is the ordered set of organizations a data read may see. Write is where new records go. Read is ordered by precedence, with Write first.

func DefaultOrgScope

func DefaultOrgScope() OrgScope

DefaultOrgScope returns the single-tenant OSS scope.

func NewOrgScope

func NewOrgScope(write string, read ...string) OrgScope

NewOrgScope constructs a normalized scope. The write organization is always first, blank read organizations normalize to default, and duplicates are removed without changing precedence.

func (OrgScope) Normalized

func (s OrgScope) Normalized() OrgScope

Normalized returns a valid, independently owned copy of the scope.

func (OrgScope) OrgIDs

func (s OrgScope) OrgIDs() []string

OrgIDs returns the normalized ordered read organizations as a defensive copy.

Jump to

Keyboard shortcuts

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