domain

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeNodeArchitectures

func NormalizeNodeArchitectures(archs []string) []string

NormalizeNodeArchitectures returns a sorted, de-duplicated copy of the input with empty entries removed. Callers should always use this before writing to the Cluster aggregate so repository layers can rely on deterministic ordering.

Types

type CloudProvider

type CloudProvider string
const (
	CloudProviderAWS          CloudProvider = "aws"
	CloudProviderAzure        CloudProvider = "azure"
	CloudProviderGCP          CloudProvider = "gcp"
	CloudProviderOCI          CloudProvider = "oci"
	CloudProviderIBMCloud     CloudProvider = "ibm_cloud"
	CloudProviderAlibabaCloud CloudProvider = "alibaba_cloud"
	CloudProviderTencentCloud CloudProvider = "tencent_cloud"
	CloudProviderNaverCloud   CloudProvider = "naver_cloud"
	CloudProviderKTCloud      CloudProvider = "kt_cloud"
	CloudProviderNHNCloud     CloudProvider = "nhn_cloud"
	CloudProviderOnPremise    CloudProvider = "on_premise"
)

type Cluster

type Cluster struct {
	ID                string           `json:"id"`
	Name              string           `json:"name"`
	Type              ClusterType      `json:"type"`
	Types             []ClusterType    `json:"types"`
	CloudProvider     CloudProvider    `json:"cloud_provider"`
	Endpoint          string           `json:"endpoint"`
	ConnectionStatus  ConnectionStatus `json:"connection_status"`
	OrgID             string           `json:"org_id"`
	NodeArchitectures []string         `json:"node_architectures"`
	CreatedAt         time.Time        `json:"created_at"`
	UpdatedAt         time.Time        `json:"updated_at"`
}

Cluster represents a Kubernetes cluster registered in the platform.

NodeArchitectures is the sorted, de-duplicated set of `node.status.nodeInfo.architecture` values discovered from the cluster. It is maintained by ClusterUseCase discovery flows and consumed by the Stack Pre-Deploy Gate so a tool whose `ArchSupport` does not cover every arch in the target cluster can be blocked/warned before install.

type ClusterDiscoveryInfo

type ClusterDiscoveryInfo struct {
	ServerVersion     string    `json:"server_version"`
	NodeArchitectures []string  `json:"node_architectures"`
	NodeCount         int       `json:"node_count"`
	DiscoveredAt      time.Time `json:"discovered_at"`
}

ClusterDiscoveryInfo is the value object returned by kube discovery. It captures the subset of cluster facts we persist back onto the Cluster aggregate after a Verify/Refresh call.

type ClusterType

type ClusterType string

ClusterType represents the type of a cluster.

const (
	ClusterTypePipeline ClusterType = "pipeline"
	ClusterTypeTarget   ClusterType = "target"
	// ClusterTypeSelf 는 Nullus 가 떠 있는 클러스터 자신을 가리킨다.
	// 에어갭 무인 설치와 단일 클러스터 배포에서 대상 클러스터로 쓰인다.
	ClusterTypeSelf ClusterType = "self"
)

func NormalizeClusterTypes

func NormalizeClusterTypes(types []ClusterType, legacyType ClusterType) []ClusterType

func ResolvePrimaryClusterType

func ResolvePrimaryClusterType(types []ClusterType, legacyType ClusterType) ClusterType

type ConnectionStatus

type ConnectionStatus string

ConnectionStatus represents the connection status of a cluster.

const (
	ConnectionStatusConnected        ConnectionStatus = "connected"
	ConnectionStatusPending          ConnectionStatus = "pending"
	ConnectionStatusUnreachable      ConnectionStatus = "unreachable"
	ConnectionStatusAuthFailed       ConnectionStatus = "auth_failed"
	ConnectionStatusConnectionFailed ConnectionStatus = "connection_failed"
)

type OrgResourceProfile

type OrgResourceProfile struct {
	ID                       string                        `json:"id"`
	Name                     string                        `json:"name"`
	OrgID                    string                        `json:"orgId"`
	BaseProfile              ResourceProfileBase           `json:"baseProfile"`
	OptionOverrides          map[string]map[string]float64 `json:"optionOverrides"`
	AppliedResourceOverrides map[string]ResourceVector     `json:"appliedResourceOverrides"`
	RowUnits                 map[string]PlanningRowUnit    `json:"rowUnits"`
	CreatedAt                time.Time                     `json:"createdAt"`
}

type OrgStatus

type OrgStatus string

OrgStatus represents the status of an organization.

const (
	OrgStatusActive   OrgStatus = "active"
	OrgStatusInactive OrgStatus = "inactive"
)

type Organization

type Organization struct {
	ID                 string    `json:"id"`
	Name               string    `json:"name"`
	Slug               string    `json:"slug"`
	Domain             string    `json:"domain"`
	Status             OrgStatus `json:"status"`
	DefaultAdminID     string    `json:"default_admin_id"`
	ClusterAccessScope []string  `json:"clusterAccessScope"`
	CreatedAt          time.Time `json:"created_at"`
	UpdatedAt          time.Time `json:"updated_at"`
}

Organization represents an organization (tenant) in the platform.

func (*Organization) ValidateSlug

func (o *Organization) ValidateSlug() error

ValidateSlug validates that the slug contains only lowercase letters, numbers, and hyphens.

type PlanningRowUnit

type PlanningRowUnit struct {
	Memory  string `json:"memory"`
	Storage string `json:"storage"`
}

type ResourceProfileBase

type ResourceProfileBase string
const (
	ResourceProfileLocal      ResourceProfileBase = "local"
	ResourceProfileStartup    ResourceProfileBase = "startup"
	ResourceProfileStandard   ResourceProfileBase = "standard"
	ResourceProfileEnterprise ResourceProfileBase = "enterprise"
)

type ResourceVector

type ResourceVector struct {
	CPURequest       float64 `json:"cpuRequest"`
	CPULimit         float64 `json:"cpuLimit"`
	MemoryRequestGi  float64 `json:"memoryRequestGi"`
	MemoryLimitGi    float64 `json:"memoryLimitGi"`
	StorageRequestGi float64 `json:"storageRequestGi"`
	StorageLimitGi   float64 `json:"storageLimitGi"`
}

type Role

type Role string

Role represents a user role in the system.

const (
	RoleAdmin     Role = "admin"
	RoleDevOps    Role = "devops"
	RoleDeveloper Role = "developer"
)

type TokenRotationEvent

type TokenRotationEvent struct {
	ID            string
	TokenSourceID string
	EventType     string
	Result        string
	ReasonCode    string
	DetailJSON    map[string]any
	TraceID       string
	CreatedAt     time.Time
}

type TokenSource

type TokenSource struct {
	ID               string
	OrgID            string
	Module           string
	Provider         string
	Path             string
	TokenType        string
	Status           string
	ExpiresAt        *time.Time
	LastRotatedAt    *time.Time
	NextCheckAt      *time.Time
	RequiresApproval bool
	Metadata         map[string]any
	CreatedAt        time.Time
	UpdatedAt        time.Time
}

type User

type User struct {
	ID        string    `json:"id"`
	Email     string    `json:"email"`
	Name      string    `json:"name"`
	Role      Role      `json:"role"`
	OrgID     string    `json:"org_id"`
	IsActive  bool      `json:"is_active"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

User represents a platform user.

func (*User) CanAccess

func (u *User) CanAccess(requiredRoles ...Role) bool

CanAccess checks if the user has one of the required roles.

Jump to

Keyboard shortcuts

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