Documentation
¶
Overview ¶
Package schema contains Ent schema definitions for KubeVirt Shepherd.
Import Path (ADR-0016): kv-shepherd.io/shepherd/ent/schema
Index ¶
- type ApprovalPolicy
- type AuditLog
- type AuditMixin
- type AuthProvider
- type BatchTicket
- type Cluster
- type ClusterPolicy
- type DirectorySyncJob
- type DomainEvent
- type ExternalCohort
- type ExternalCohortGrant
- type ExternalCohortMapping
- type InstanceSize
- type NamespaceRegistry
- type Notification
- type PendingAdoption
- type PlatformSetting
- type RateLimitExemption
- type RateLimitUserOverride
- type ResourceRoleBinding
- type Role
- type RoleBinding
- type Service
- type System
- type SystemSecret
- type Template
- type Ticket
- type TimeMixin
- type User
- type UserDirectoryProfile
- type UserPreference
- type VM
- type VMRevision
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApprovalPolicy ¶
ApprovalPolicy holds the schema definition for the ApprovalPolicy entity. ADR-0005: Defines environment-level policies. V1 scope: PENDING → APPROVED/REJECTED only.
func (ApprovalPolicy) Fields ¶
func (ApprovalPolicy) Fields() []ent.Field
Fields of the ApprovalPolicy.
func (ApprovalPolicy) Indexes ¶
func (ApprovalPolicy) Indexes() []ent.Index
Indexes of the ApprovalPolicy.
func (ApprovalPolicy) Mixin ¶
func (ApprovalPolicy) Mixin() []ent.Mixin
Mixin of the ApprovalPolicy.
type AuditLog ¶
AuditLog holds the schema definition for the AuditLog entity. Append-only compliance records. Hard-delete is NOT allowed.
type AuditMixin ¶
AuditMixin adds created_at (immutable, no updated_at) for append-only tables.
type AuthProvider ¶
AuthProvider holds the schema definition for the AuthProvider entity. Standardized auth provider records. Concrete providers are adapter-registered.
func (AuthProvider) Indexes ¶
func (AuthProvider) Indexes() []ent.Index
Indexes of the AuthProvider.
type BatchTicket ¶
BatchTicket holds parent-level batch operation projection.
ADR-0015 §19: parent-child batch model with persisted aggregate counters.
type Cluster ¶
Cluster holds the schema definition for the Cluster entity. Multi-cluster credential management with sensitive kubeconfig storage.
type ClusterPolicy ¶
ClusterPolicy holds the schema definition for the ClusterPolicy entity. ADR-0042: Administrative policy layer separate from detected cluster capability.
func (ClusterPolicy) Fields ¶
func (ClusterPolicy) Fields() []ent.Field
Fields of the ClusterPolicy.
func (ClusterPolicy) Indexes ¶
func (ClusterPolicy) Indexes() []ent.Index
Indexes of the ClusterPolicy.
type DirectorySyncJob ¶
DirectorySyncJob tracks async directory import jobs per auth provider.
func (DirectorySyncJob) Fields ¶
func (DirectorySyncJob) Fields() []ent.Field
func (DirectorySyncJob) Indexes ¶
func (DirectorySyncJob) Indexes() []ent.Index
func (DirectorySyncJob) Mixin ¶
func (DirectorySyncJob) Mixin() []ent.Mixin
type DomainEvent ¶
DomainEvent holds the schema definition for the DomainEvent entity. ADR-0009: Claim-check pattern. Payload is IMMUTABLE (append-only). River job carries only EventID; full payload stored here.
type ExternalCohort ¶
ExternalCohort stores non-authoritative provider cohorts discovered or entered by admins.
func (ExternalCohort) Fields ¶
func (ExternalCohort) Fields() []ent.Field
Fields of the ExternalCohort.
func (ExternalCohort) Indexes ¶
func (ExternalCohort) Indexes() []ent.Index
Indexes of the ExternalCohort.
func (ExternalCohort) Mixin ¶
func (ExternalCohort) Mixin() []ent.Mixin
Mixin of the ExternalCohort.
type ExternalCohortGrant ¶
ExternalCohortGrant tracks auto-managed role bindings derived from external cohorts.
func (ExternalCohortGrant) Edges ¶
func (ExternalCohortGrant) Edges() []ent.Edge
Edges of the ExternalCohortGrant.
func (ExternalCohortGrant) Fields ¶
func (ExternalCohortGrant) Fields() []ent.Field
Fields of the ExternalCohortGrant.
func (ExternalCohortGrant) Indexes ¶
func (ExternalCohortGrant) Indexes() []ent.Index
Indexes of the ExternalCohortGrant.
func (ExternalCohortGrant) Mixin ¶
func (ExternalCohortGrant) Mixin() []ent.Mixin
Mixin of the ExternalCohortGrant.
type ExternalCohortMapping ¶
ExternalCohortMapping maps normalized external cohorts into platform RBAC targets.
func (ExternalCohortMapping) Fields ¶
func (ExternalCohortMapping) Fields() []ent.Field
Fields of the ExternalCohortMapping.
func (ExternalCohortMapping) Indexes ¶
func (ExternalCohortMapping) Indexes() []ent.Index
Indexes of the ExternalCohortMapping.
func (ExternalCohortMapping) Mixin ¶
func (ExternalCohortMapping) Mixin() []ent.Mixin
Mixin of the ExternalCohortMapping.
type InstanceSize ¶
InstanceSize holds the schema definition for the InstanceSize entity. ADR-0018: Abstraction layer between user-facing size names and actual resource specs.
func (InstanceSize) Indexes ¶
func (InstanceSize) Indexes() []ent.Index
Indexes of the InstanceSize.
type NamespaceRegistry ¶
NamespaceRegistry holds the schema definition for the NamespaceRegistry entity. Namespace is a Shepherd-managed logical entity, NOT bound to any single K8s cluster.
ADR-0017: No cluster_id field. Namespace ↔ Cluster binding occurs at VM approval time. ADR-0015 §15: Environment is explicitly set by admin (test/prod).
When a VM is approved, the admin selects the target cluster. If the namespace doesn't exist on that cluster, Shepherd creates it JIT (Just-In-Time).
func (NamespaceRegistry) Fields ¶
func (NamespaceRegistry) Fields() []ent.Field
Fields of the NamespaceRegistry.
func (NamespaceRegistry) Indexes ¶
func (NamespaceRegistry) Indexes() []ent.Index
Indexes of the NamespaceRegistry.
func (NamespaceRegistry) Mixin ¶
func (NamespaceRegistry) Mixin() []ent.Mixin
Mixin of the NamespaceRegistry.
type Notification ¶
Notification holds the schema definition for the Notification entity. V1 implementation: Platform Inbox (database-backed in-app notifications).
ADR-0015 §20: Notifications are synchronous writes within the same DB transaction as business operations (NOT via River Queue). V2+: External push channels (email, webhook) via River Queue.
func (Notification) Indexes ¶
func (Notification) Indexes() []ent.Index
Indexes of the Notification.
type PendingAdoption ¶
PendingAdoption holds the schema definition for the PendingAdoption entity. Recovery and compensation: tracks K8s resources that need adoption after failures.
func (PendingAdoption) Fields ¶
func (PendingAdoption) Fields() []ent.Field
Fields of the PendingAdoption.
func (PendingAdoption) Indexes ¶
func (PendingAdoption) Indexes() []ent.Index
Indexes of the PendingAdoption.
func (PendingAdoption) Mixin ¶
func (PendingAdoption) Mixin() []ent.Mixin
Mixin of the PendingAdoption.
type PlatformSetting ¶
PlatformSetting stores platform-wide runtime settings owned by Shepherd core.
func (PlatformSetting) Fields ¶
func (PlatformSetting) Fields() []ent.Field
Fields of the PlatformSetting.
func (PlatformSetting) Indexes ¶
func (PlatformSetting) Indexes() []ent.Index
Indexes of the PlatformSetting.
func (PlatformSetting) Mixin ¶
func (PlatformSetting) Mixin() []ent.Mixin
Mixin of the PlatformSetting.
type RateLimitExemption ¶
RateLimitExemption stores admin-granted user exemptions for batch submission limits.
ADR-0015 §19: trusted internal users can be exempted from user-level throttles.
func (RateLimitExemption) Fields ¶
func (RateLimitExemption) Fields() []ent.Field
Fields of the RateLimitExemption.
func (RateLimitExemption) Indexes ¶
func (RateLimitExemption) Indexes() []ent.Index
Indexes of the RateLimitExemption.
func (RateLimitExemption) Mixin ¶
func (RateLimitExemption) Mixin() []ent.Mixin
Mixin of the RateLimitExemption.
type RateLimitUserOverride ¶
RateLimitUserOverride stores per-user custom limits for batch submissions.
ADR-0015 §19: administrators can tune user-level limits when defaults are unsuitable.
func (RateLimitUserOverride) Fields ¶
func (RateLimitUserOverride) Fields() []ent.Field
Fields of the RateLimitUserOverride.
func (RateLimitUserOverride) Indexes ¶
func (RateLimitUserOverride) Indexes() []ent.Index
Indexes of the RateLimitUserOverride.
func (RateLimitUserOverride) Mixin ¶
func (RateLimitUserOverride) Mixin() []ent.Mixin
Mixin of the RateLimitUserOverride.
type ResourceRoleBinding ¶
ResourceRoleBinding holds the schema definition for the ResourceRoleBinding entity. ADR-0018, master-flow Stage 4.A+: Resource-level member management (owner/admin/member/viewer).
func (ResourceRoleBinding) Fields ¶
func (ResourceRoleBinding) Fields() []ent.Field
Fields of the ResourceRoleBinding.
func (ResourceRoleBinding) Indexes ¶
func (ResourceRoleBinding) Indexes() []ent.Index
Indexes of the ResourceRoleBinding.
func (ResourceRoleBinding) Mixin ¶
func (ResourceRoleBinding) Mixin() []ent.Mixin
Mixin of the ResourceRoleBinding.
type Role ¶
Role holds the schema definition for the Role entity. ADR-0015 §22, ADR-0019: Role = bundle of permissions. No wildcard permissions.
type RoleBinding ¶
RoleBinding holds the schema definition for the RoleBinding entity. ADR-0015 §22, ADR-0018 §7: User-role assignments with optional scope.
type Service ¶
Service holds the schema definition for the Service entity. ADR-0015 §2: Name is immutable after creation. No created_by (inherited from System). Permissions inherited from parent System via RoleBinding.
type System ¶
System holds the schema definition for the System entity. ADR-0015 §1: System is a logical business grouping, decoupled from namespace/environment. Permissions managed via RoleBinding table, NOT entity fields.
type SystemSecret ¶
SystemSecret holds the schema definition for the SystemSecret entity. ADR-0025: Bootstrap secret storage. Only app DB role can access.
func (SystemSecret) Indexes ¶
func (SystemSecret) Indexes() []ent.Index
Indexes of the SystemSecret.
type Template ¶
Template holds the schema definition for the Template entity. ADR-0018: Templates stored in PostgreSQL, not as YAML files. ADR-0036: Template contains software-baseline only (source + cloud-init).
type Ticket ¶
Ticket holds the schema definition for the Ticket entity. ADR-0005: Simple approval flow — PENDING → APPROVED or PENDING → REJECTED. ADR-0017: Admin-determined fields (cluster, template_version, storage_class).
type TimeMixin ¶
TimeMixin adds created_at and updated_at fields to schemas. Ent best practice: use mixin for shared timestamp fields.
type User ¶
User holds the schema definition for the User entity. ADR-0018: Platform user accounts (local + IdP-linked).
type UserDirectoryProfile ¶
UserDirectoryProfile stores non-authoritative raw directory attributes.
func (UserDirectoryProfile) Edges ¶
func (UserDirectoryProfile) Edges() []ent.Edge
func (UserDirectoryProfile) Fields ¶
func (UserDirectoryProfile) Fields() []ent.Field
func (UserDirectoryProfile) Indexes ¶
func (UserDirectoryProfile) Indexes() []ent.Index
func (UserDirectoryProfile) Mixin ¶
func (UserDirectoryProfile) Mixin() []ent.Mixin
type UserPreference ¶
UserPreference stores generic per-user UI/runtime preferences owned by the user.
func (UserPreference) Edges ¶
func (UserPreference) Edges() []ent.Edge
func (UserPreference) Fields ¶
func (UserPreference) Fields() []ent.Field
func (UserPreference) Indexes ¶
func (UserPreference) Indexes() []ent.Index
func (UserPreference) Mixin ¶
func (UserPreference) Mixin() []ent.Mixin
type VM ¶
VM holds the schema definition for the VM entity. ADR-0015 §3: Associates service_id only. No system_id field — obtain via service edge.
type VMRevision ¶
VMRevision holds the schema definition for the VMRevision entity. Tracks VM configuration version history for audit and rollback.
Source Files
¶
- approval_policy.go
- audit_log.go
- auth_provider.go
- batch_ticket.go
- cluster.go
- cluster_policy.go
- directory_sync_job.go
- domain_event.go
- external_cohort.go
- external_cohort_grant.go
- external_cohort_mapping.go
- instance_size.go
- mixin.go
- namespace_registry.go
- notification.go
- pending_adoption.go
- platform_setting.go
- rate_limit_exemption.go
- rate_limit_user_override.go
- resource_role_binding.go
- role.go
- role_binding.go
- service.go
- system.go
- system_secret.go
- template.go
- ticket.go
- user.go
- user_directory_profile.go
- user_preference.go
- vm.go
- vm_revision.go