schema

package
v0.1.1-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package schema contains Ent schema definitions for KubeVirt Shepherd.

Import Path (ADR-0016): kv-shepherd.io/shepherd/ent/schema

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApprovalPolicy

type ApprovalPolicy struct {
	ent.Schema
}

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

type AuditLog struct {
	ent.Schema
}

AuditLog holds the schema definition for the AuditLog entity. Append-only compliance records. Hard-delete is NOT allowed.

func (AuditLog) Fields

func (AuditLog) Fields() []ent.Field

Fields of the AuditLog.

func (AuditLog) Indexes

func (AuditLog) Indexes() []ent.Index

Indexes of the AuditLog.

func (AuditLog) Mixin

func (AuditLog) Mixin() []ent.Mixin

Mixin of the AuditLog.

type AuditMixin

type AuditMixin struct {
	mixin.Schema
}

AuditMixin adds created_at (immutable, no updated_at) for append-only tables.

func (AuditMixin) Fields

func (AuditMixin) Fields() []ent.Field

Fields of the AuditMixin.

type AuthProvider

type AuthProvider struct {
	ent.Schema
}

AuthProvider holds the schema definition for the AuthProvider entity. Standardized auth provider records. Concrete providers are adapter-registered.

func (AuthProvider) Fields

func (AuthProvider) Fields() []ent.Field

Fields of the AuthProvider.

func (AuthProvider) Indexes

func (AuthProvider) Indexes() []ent.Index

Indexes of the AuthProvider.

func (AuthProvider) Mixin

func (AuthProvider) Mixin() []ent.Mixin

Mixin of the AuthProvider.

type BatchTicket

type BatchTicket struct {
	ent.Schema
}

BatchTicket holds parent-level batch operation projection.

ADR-0015 §19: parent-child batch model with persisted aggregate counters.

func (BatchTicket) Fields

func (BatchTicket) Fields() []ent.Field

Fields of the BatchTicket.

func (BatchTicket) Indexes

func (BatchTicket) Indexes() []ent.Index

Indexes of the BatchTicket.

func (BatchTicket) Mixin

func (BatchTicket) Mixin() []ent.Mixin

Mixin of the BatchTicket.

type Cluster

type Cluster struct {
	ent.Schema
}

Cluster holds the schema definition for the Cluster entity. Multi-cluster credential management with sensitive kubeconfig storage.

func (Cluster) Edges

func (Cluster) Edges() []ent.Edge

Edges of the Cluster.

func (Cluster) Fields

func (Cluster) Fields() []ent.Field

Fields of the Cluster.

func (Cluster) Indexes

func (Cluster) Indexes() []ent.Index

Indexes of the Cluster.

func (Cluster) Mixin

func (Cluster) Mixin() []ent.Mixin

Mixin of the Cluster.

type ClusterPolicy

type ClusterPolicy struct {
	ent.Schema
}

ClusterPolicy holds the schema definition for the ClusterPolicy entity. ADR-0042: Administrative policy layer separate from detected cluster capability.

func (ClusterPolicy) Edges

func (ClusterPolicy) Edges() []ent.Edge

Edges of the ClusterPolicy.

func (ClusterPolicy) Fields

func (ClusterPolicy) Fields() []ent.Field

Fields of the ClusterPolicy.

func (ClusterPolicy) Indexes

func (ClusterPolicy) Indexes() []ent.Index

Indexes of the ClusterPolicy.

func (ClusterPolicy) Mixin

func (ClusterPolicy) Mixin() []ent.Mixin

Mixin of the ClusterPolicy.

type DirectorySyncJob

type DirectorySyncJob struct {
	ent.Schema
}

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

type DomainEvent struct {
	ent.Schema
}

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.

func (DomainEvent) Fields

func (DomainEvent) Fields() []ent.Field

Fields of the DomainEvent.

func (DomainEvent) Indexes

func (DomainEvent) Indexes() []ent.Index

Indexes of the DomainEvent.

func (DomainEvent) Mixin

func (DomainEvent) Mixin() []ent.Mixin

Mixin of the DomainEvent.

type ExternalCohort

type ExternalCohort struct {
	ent.Schema
}

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

type ExternalCohortGrant struct {
	ent.Schema
}

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

type ExternalCohortMapping struct {
	ent.Schema
}

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

type InstanceSize struct {
	ent.Schema
}

InstanceSize holds the schema definition for the InstanceSize entity. ADR-0018: Abstraction layer between user-facing size names and actual resource specs.

func (InstanceSize) Fields

func (InstanceSize) Fields() []ent.Field

Fields of the InstanceSize.

func (InstanceSize) Indexes

func (InstanceSize) Indexes() []ent.Index

Indexes of the InstanceSize.

func (InstanceSize) Mixin

func (InstanceSize) Mixin() []ent.Mixin

Mixin of the InstanceSize.

type NamespaceRegistry

type NamespaceRegistry struct {
	ent.Schema
}

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

type Notification struct {
	ent.Schema
}

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) Edges

func (Notification) Edges() []ent.Edge

Edges of the Notification.

func (Notification) Fields

func (Notification) Fields() []ent.Field

Fields of the Notification.

func (Notification) Indexes

func (Notification) Indexes() []ent.Index

Indexes of the Notification.

func (Notification) Mixin

func (Notification) Mixin() []ent.Mixin

Mixin of the Notification.

type PendingAdoption

type PendingAdoption struct {
	ent.Schema
}

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

type PlatformSetting struct {
	ent.Schema
}

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

type RateLimitExemption struct {
	ent.Schema
}

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

type RateLimitUserOverride struct {
	ent.Schema
}

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

type ResourceRoleBinding struct {
	ent.Schema
}

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

type Role struct {
	ent.Schema
}

Role holds the schema definition for the Role entity. ADR-0015 §22, ADR-0019: Role = bundle of permissions. No wildcard permissions.

func (Role) Edges

func (Role) Edges() []ent.Edge

Edges of the Role.

func (Role) Fields

func (Role) Fields() []ent.Field

Fields of the Role.

func (Role) Indexes

func (Role) Indexes() []ent.Index

Indexes of the Role.

func (Role) Mixin

func (Role) Mixin() []ent.Mixin

Mixin of the Role.

type RoleBinding

type RoleBinding struct {
	ent.Schema
}

RoleBinding holds the schema definition for the RoleBinding entity. ADR-0015 §22, ADR-0018 §7: User-role assignments with optional scope.

func (RoleBinding) Edges

func (RoleBinding) Edges() []ent.Edge

Edges of the RoleBinding.

func (RoleBinding) Fields

func (RoleBinding) Fields() []ent.Field

Fields of the RoleBinding.

func (RoleBinding) Indexes

func (RoleBinding) Indexes() []ent.Index

Indexes of the RoleBinding.

func (RoleBinding) Mixin

func (RoleBinding) Mixin() []ent.Mixin

Mixin of the RoleBinding.

type Service

type Service struct {
	ent.Schema
}

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.

func (Service) Edges

func (Service) Edges() []ent.Edge

Edges of the Service.

func (Service) Fields

func (Service) Fields() []ent.Field

Fields of the Service.

func (Service) Indexes

func (Service) Indexes() []ent.Index

Indexes of the Service.

func (Service) Mixin

func (Service) Mixin() []ent.Mixin

Mixin of the Service.

type System

type System struct {
	ent.Schema
}

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.

func (System) Edges

func (System) Edges() []ent.Edge

Edges of the System.

func (System) Fields

func (System) Fields() []ent.Field

Fields of the System.

func (System) Indexes

func (System) Indexes() []ent.Index

Indexes of the System.

func (System) Mixin

func (System) Mixin() []ent.Mixin

Mixin of the System.

type SystemSecret

type SystemSecret struct {
	ent.Schema
}

SystemSecret holds the schema definition for the SystemSecret entity. ADR-0025: Bootstrap secret storage. Only app DB role can access.

func (SystemSecret) Fields

func (SystemSecret) Fields() []ent.Field

Fields of the SystemSecret.

func (SystemSecret) Indexes

func (SystemSecret) Indexes() []ent.Index

Indexes of the SystemSecret.

func (SystemSecret) Mixin

func (SystemSecret) Mixin() []ent.Mixin

Mixin of the SystemSecret.

type Template

type Template struct {
	ent.Schema
}

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).

func (Template) Fields

func (Template) Fields() []ent.Field

Fields of the Template.

func (Template) Indexes

func (Template) Indexes() []ent.Index

Indexes of the Template.

func (Template) Mixin

func (Template) Mixin() []ent.Mixin

Mixin of the Template.

type Ticket

type Ticket struct {
	ent.Schema
}

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).

func (Ticket) Fields

func (Ticket) Fields() []ent.Field

Fields of the Ticket.

func (Ticket) Indexes

func (Ticket) Indexes() []ent.Index

Indexes of the Ticket.

func (Ticket) Mixin

func (Ticket) Mixin() []ent.Mixin

Mixin of the Ticket.

type TimeMixin

type TimeMixin struct {
	mixin.Schema
}

TimeMixin adds created_at and updated_at fields to schemas. Ent best practice: use mixin for shared timestamp fields.

func (TimeMixin) Fields

func (TimeMixin) Fields() []ent.Field

Fields of the TimeMixin.

type User

type User struct {
	ent.Schema
}

User holds the schema definition for the User entity. ADR-0018: Platform user accounts (local + IdP-linked).

func (User) Edges

func (User) Edges() []ent.Edge

Edges of the User.

func (User) Fields

func (User) Fields() []ent.Field

Fields of the User.

func (User) Indexes

func (User) Indexes() []ent.Index

Indexes of the User.

func (User) Mixin

func (User) Mixin() []ent.Mixin

Mixin of the User.

type UserDirectoryProfile

type UserDirectoryProfile struct {
	ent.Schema
}

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

type UserPreference struct {
	ent.Schema
}

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

type VM struct {
	ent.Schema
}

VM holds the schema definition for the VM entity. ADR-0015 §3: Associates service_id only. No system_id field — obtain via service edge.

func (VM) Edges

func (VM) Edges() []ent.Edge

Edges of the VM.

func (VM) Fields

func (VM) Fields() []ent.Field

Fields of the VM.

func (VM) Indexes

func (VM) Indexes() []ent.Index

Indexes of the VM.

func (VM) Mixin

func (VM) Mixin() []ent.Mixin

Mixin of the VM.

type VMRevision

type VMRevision struct {
	ent.Schema
}

VMRevision holds the schema definition for the VMRevision entity. Tracks VM configuration version history for audit and rollback.

func (VMRevision) Edges

func (VMRevision) Edges() []ent.Edge

Edges of the VMRevision.

func (VMRevision) Fields

func (VMRevision) Fields() []ent.Field

Fields of the VMRevision.

func (VMRevision) Indexes

func (VMRevision) Indexes() []ent.Index

Indexes of the VMRevision.

func (VMRevision) Mixin

func (VMRevision) Mixin() []ent.Mixin

Mixin of the VMRevision.

Jump to

Keyboard shortcuts

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