Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidScope = errors.New("invalid scope") ErrInvalidTenantID = errors.New("invalid tenant ID") ErrInvalidTeamID = errors.New("invalid team ID") ErrInvalidProjectID = errors.New("invalid project ID") ErrInvalidCollection = errors.New("invalid collection type") ErrAccessDenied = errors.New("access denied") )
Common errors.
Functions ¶
func GetDefaultTenantID ¶
func GetDefaultTenantID() string
GetDefaultTenantID returns the default tenant ID for single-tenant mode. Uses git user.name from global config if available, falls back to OS username.
func GetTenantIDForPath ¶
GetTenantIDForPath returns a tenant ID, preferring GitHub username from repo remote. Priority: GitHub username from remote → git user.name → $USER → "local"
Types ¶
type CollectionRouter ¶
type CollectionRouter interface {
// GetCollectionName returns the collection name for the given scope and identifiers.
GetCollectionName(scope Scope, collectionType CollectionType, tenantID, teamID, projectID string) (string, error)
// ValidateAccess verifies that the session has access to the specified collection.
ValidateAccess(sessionTenantID, sessionTeamID, sessionProjectID, collectionName string) error
// GetSearchCollections returns collections to search based on scope hierarchy.
GetSearchCollections(scope Scope, collectionType CollectionType, tenantID, teamID, projectID string) ([]string, error)
}
CollectionRouter routes requests to the appropriate collection based on tenant scope. This is a stub interface for contextd-v2 port - full implementation pending.
func NewRouter ¶
func NewRouter(strictMode bool) CollectionRouter
NewRouter creates a new collection router.
type CollectionType ¶
type CollectionType string
CollectionType represents the type of data stored in a collection.
const ( CollectionMemories CollectionType = "memories" CollectionRemediations CollectionType = "remediations" CollectionCheckpoints CollectionType = "checkpoints" CollectionPolicies CollectionType = "policies" CollectionSkills CollectionType = "skills" CollectionAgents CollectionType = "agents" CollectionSessions CollectionType = "sessions" CollectionCodebase CollectionType = "codebase" CollectionStandards CollectionType = "coding_standards" CollectionRepoStandards CollectionType = "repo_standards" CollectionAntiPatterns CollectionType = "anti_patterns" CollectionFeedback CollectionType = "feedback" )
Click to show internal directories.
Click to hide internal directories.