models

package
v1.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: EPL-2.0 Imports: 19 Imported by: 0

README

Models Package

This package contains Edgelet data structures and domain models shared across the daemon, field agent, EdgeletAPI, and CLI.

Overview

Models provide:

  • JSON/YAML marshaling support
  • Controller-compatible field naming for PoT wire formats
  • Validation functions
  • Constructor functions (New*)
  • Thread-safe operations where needed

Models

Core Models
  • Microservice: Main microservice/container configuration
  • MicroserviceState: Enum for microservice states
  • PortMapping: Port mapping configuration
  • EnvVar: Environment variable
  • VolumeMapping: Volume mapping configuration
  • VolumeMappingType: Enum for volume mapping types
  • Healthcheck: Container healthcheck configuration
  • Route: Microservice routing configuration
  • Registry: Docker registry configuration
Message Models
  • Message: ioMessage with binary and JSON serialization support
  • ExecMessage: Exec session WebSocket message
  • LogMessage: Log session WebSocket message
Status Models
  • MicroserviceStatus: Microservice status information
  • FieldAgentStatus: Field agent status
  • ControllerStatus: Controller connection status enum
  • StatusReporterStatus: Status reporter status
Configuration Models
  • YamlConfig: Root YAML configuration structure
  • ProfileConfig: Profile configuration with flexible property mapping

Usage

Creating Models
// Create a microservice
ms := models.NewMicroservice("uuid-123", "image:tag")
ms.SetMemoryLimitMB(int64Ptr(512))

// Create a port mapping
pm := models.NewPortMapping(8080, 80, false)

// Create a registry using builder
reg := models.NewRegistryBuilder().
    SetID(1).
    SetURL("https://registry.example.com").
    SetIsPublic(true).
    Build()
JSON Marshaling
// Marshal to JSON
jsonData, err := json.Marshal(ms)
if err != nil {
    log.Fatal(err)
}

// Unmarshal from JSON
var ms2 models.Microservice
err = json.Unmarshal(jsonData, &ms2)
Validation
// Validate a model
if err := models.ValidateMicroservice(ms); err != nil {
    log.Fatal(err)
}

// Or use the model's Validate method
if err := ms.Validate(); err != nil {
    log.Fatal(err)
}

JSON compatibility

Models use PoT-compatible JSON field names. Optional fields use pointers to distinguish nil from zero values.

Thread Safety

  • Microservice.IsUpdating: Thread-safe getter/setter using sync.RWMutex
  • DeleteLock: Global mutex for microservice deletion operations

Testing

Run tests with:

go test ./internal/models/... -v

Notes

  • Binary serialization for Message is not yet fully implemented (placeholder for future work)
  • All optional fields use pointers to distinguish between nil and zero values
  • Enum types use string-based constants for JSON compatibility

Documentation

Index

Constants

View Source
const (

	// ControlPlaneTLS*Filename are container-relative names under /etc/iofog/controller-cert/.
	ControlPlaneTLSCertFilename = "tls.crt"
	ControlPlaneTLSKeyFilename  = "tls.key"
	ControlPlaneTLSCAFilename   = "ca.crt"
)
View Source
const (
	ExecMessageTypeStdin   byte = 0
	ExecMessageTypeStdout  byte = 1
	ExecMessageTypeStderr  byte = 2
	ExecMessageTypeControl byte = 3
)

ExecMessageType represents the type of exec message

View Source
const (
	ModelStatePending = "Pending"
	ModelStatePulling = "Pulling"
	ModelStateReady   = "Ready"
	ModelStateFailed  = "Failed"
)

Model lifecycle states.

View Source
const (
	ModelFormatGGUF        = "gguf"
	ModelFormatSafetensors = "safetensors"
	ModelFormatONNX        = "onnx"
	ModelFormatPyTorch     = "pytorch"
	ModelFormatTensorRT    = "tensorrt"
	ModelFormatUnknown     = "unknown"
)

Optional spec.format hints.

View Source
const (
	RuntimeClassSourceLocal   = "local"
	RuntimeClassSourceManaged = "managed"
)

RuntimeClass provenance on the node.

View Source
const (
	LogMessageTypeLogLine  byte = 6
	LogMessageTypeLogStart byte = 7
	LogMessageTypeLogStop  byte = 8
	LogMessageTypeLogError byte = 9
)

LogMessageType represents the type of log message

View Source
const (
	ModelSourceLocal   = "local"
	ModelSourceManaged = "managed"
)

Model provenance on the node.

View Source
const (
	ModelCatalogPermRO = "ro"
	ModelCatalogPermRW = "rw"
)

Catalog mount mode. Default is read-only.

View Source
const (
	RegistryTypeOCI = "oci"
	RegistryTypeHF  = "hf"
)

Registry types. Default is oci when omitted.

View Source
const (
	BuiltInRegistryDockerIO    = 1
	BuiltInRegistryFromCache   = 2
	BuiltInRegistryHuggingFace = 3
	DefaultHuggingFaceHubURL   = "https://huggingface.co"
)

Built-in local registry row ids. These rows are seeded on startup and cannot be edited or removed.

View Source
const CatalogWaitingMessage = "workload is waiting for model download"

CatalogWaitingMessage is the status text when a workload is waiting for model download.

View Source
const ControlPlaneDefaultNamespace = "default"
View Source
const ReadOnlyRootWithoutTmpfsWarning = "read-only root filesystem is enabled and no tmpfs is mounted at /tmp"

ReadOnlyRootWithoutTmpfsWarning is logged when the root filesystem is read-only and the operator did not mount tmpfs at /tmp. Edgelet does not inject /tmp.

Variables

View Source
var DeleteLock = &sync.Mutex{}

DeleteLock is a global lock for microservice deletion operations

Functions

func CanonicalizeVerbs

func CanonicalizeVerbs(verbs []string) []string

func CatalogItemNames added in v1.1.0

func CatalogItemNames(c *ModelCatalog) []string

CatalogItemNames returns trimmed item names in catalog order.

func CatalogMountNeedsRecreate added in v1.1.0

func CatalogMountNeedsRecreate(prev, next *ModelCatalog) bool

CatalogMountNeedsRecreate reports bindPath or catalog permissions drift. Item add/remove and model generation changes do not recreate the container.

func CloneStringSlicePtr added in v1.1.0

func CloneStringSlicePtr(in *[]string) *[]string

CloneStringSlicePtr copies an optional string list, preserving omitted vs empty.

func HasTmpfsAt added in v1.1.0

func HasTmpfsAt(tmpfs []TmpfsMount, containerPath string) bool

HasTmpfsAt reports whether tmpfs lists the given absolute container path.

func HighestBuiltInLocalRegistryID added in v1.1.0

func HighestBuiltInLocalRegistryID() int

HighestBuiltInLocalRegistryID is the largest reserved local registry id.

func IsBuiltInLocalRegistryID added in v1.1.0

func IsBuiltInLocalRegistryID(id int) bool

IsBuiltInLocalRegistryID reports whether id is a seeded local default (docker.io, from_cache, or Hugging Face Hub).

func IsReservedRuntimeClassName added in v1.1.0

func IsReservedRuntimeClassName(name string) bool

IsReservedRuntimeClassName reports whether name is reserved and cannot be applied or deleted as a RuntimeClass (for example the default crun handler).

func LocalDeployNeedsRecreate added in v1.1.0

func LocalDeployNeedsRecreate(prev, next *Microservice) bool

LocalDeployNeedsRecreate reports whether a local re-apply must replace the running container. Catalog item add/remove does not recreate when bindPath and catalog permissions are unchanged.

func MaskedControlPlaneManifestYAML

func MaskedControlPlaneManifestYAML(manifest string) (string, error)

MaskedControlPlaneManifestYAML returns manifest YAML with secrets redacted.

func NeedsReadOnlyRootTmpfsWarning added in v1.1.0

func NeedsReadOnlyRootTmpfsWarning(readOnly bool, tmpfs []TmpfsMount) bool

NeedsReadOnlyRootTmpfsWarning is true when the root is read-only and /tmp is not a tmpfs.

func NormalizeRegistryType added in v1.1.0

func NormalizeRegistryType(registryType string) string

NormalizeRegistryType returns oci when type is empty; otherwise lower-trimmed type.

func PodIDForEngine added in v1.1.0

func PodIDForEngine(engineName, containerID, sandboxID string) string

PodIDForEngine returns the status pod id for a running container. The edgelet engine uses the pause / sandbox id. Docker and podman reuse the app container id. Unknown values are omitted by callers (empty string).

func RegistryIdentityCollision added in v1.1.0

func RegistryIdentityCollision(existing, incoming *Registry) error

RegistryIdentityCollision returns an error when the same id already exists with a different (type, url) pair.

func RequireOCIForImagePull added in v1.1.0

func RequireOCIForImagePull(reg *Registry) error

RequireOCIForImagePull returns an error when a registry cannot be used to pull container images. A nil registry is allowed (unauthenticated default pull).

func RequireRegistryType added in v1.1.0

func RequireRegistryType(reg *Registry, want string) error

RequireRegistryType returns an error when the registry type does not match want.

func RuntimeClassBinaryPathForHandler

func RuntimeClassBinaryPathForHandler(handler string) string

func RuntimeClassBlockingUUIDs added in v1.1.0

func RuntimeClassBlockingUUIDs(item *LocalRuntimeClass, locals []*LocalDeployedMicroservice, controller []*Microservice) []string

RuntimeClassBlockingUUIDs returns microservice UUIDs that still reference the RuntimeClass. Local workloads only block while running. Controller microservices block whenever they select the class and are not marked delete.

func RuntimeFromManifestYAML added in v1.1.0

func RuntimeFromManifestYAML(manifest string) string

RuntimeFromManifestYAML returns spec.container.runtime from a local Microservice manifest, or empty when the document has no runtime.

func StatControlPlaneTLSDir

func StatControlPlaneTLSDir(hostDir string) (os.FileInfo, error)

StatControlPlaneTLSDir returns metadata for a validated host TLS directory.

func StatControlPlaneTLSFile

func StatControlPlaneTLSFile(hostDir, basename string) (os.FileInfo, error)

StatControlPlaneTLSFile returns metadata for a known TLS file under a validated host directory.

func UsesImageDefault added in v1.1.0

func UsesImageDefault(argv *[]string) bool

UsesImageDefault reports whether an argv field should leave the image default (omitted or an explicit empty list).

func ValidModelFormat added in v1.1.0

func ValidModelFormat(format string) bool

ValidModelFormat reports whether format is empty or a known hint.

func ValidModelSource added in v1.1.0

func ValidModelSource(source string) bool

ValidModelSource reports whether source is local or managed.

func ValidModelState added in v1.1.0

func ValidModelState(state string) bool

ValidModelState reports whether state is a known Model lifecycle value.

func ValidRegistryType added in v1.1.0

func ValidRegistryType(registryType string) bool

ValidRegistryType reports whether type is oci or hf (empty is treated as oci).

func ValidRuntimeClassSource added in v1.1.0

func ValidRuntimeClassSource(source string) bool

ValidRuntimeClassSource reports whether source is local or managed.

func ValidateCatalogApply added in v1.1.0

func ValidateCatalogApply(c *ModelCatalog, requiredSource string, lookup ModelStatusLookup) error

ValidateCatalogApply checks source scope plus Failed/missing names for apply-time reject. Pending and Pulling names are allowed so the workload can wait for download.

func ValidateCatalogModelSources added in v1.1.0

func ValidateCatalogModelSources(c *ModelCatalog, requiredSource string, lookup ModelSourceLookup) error

ValidateCatalogModelSources checks that every named item exists with the required source.

func ValidateControlPlaneTLSPath

func ValidateControlPlaneTLSPath(path string) (string, error)

ValidateControlPlaneTLSPath canonicalizes and validates a host TLS directory path.

func ValidateEnvVar

func ValidateEnvVar(e *EnvVar) error

ValidateEnvVar validates an EnvVar

func ValidateExecMessage

func ValidateExecMessage(em *ExecMessage) error

ValidateExecMessage validates an ExecMessage

func ValidateFieldAgentStatus

func ValidateFieldAgentStatus(fa *FieldAgentStatus) error

ValidateFieldAgentStatus validates a FieldAgentStatus

func ValidateLogMessage

func ValidateLogMessage(lm *LogMessage) error

ValidateLogMessage validates a LogMessage

func ValidateMicroserviceStatus

func ValidateMicroserviceStatus(ms *MicroserviceStatus) error

ValidateMicroserviceStatus validates a MicroserviceStatus

func ValidateModelCatalog added in v1.1.0

func ValidateModelCatalog(c *ModelCatalog, volumeDests, tmpfsPaths []string) error

ValidateModelCatalog checks catalog shape, permissions, duplicates, and path collisions. Omitted catalog or empty items do not require bindPath. Permissions default to ro when items are present.

func ValidatePortMapping

func ValidatePortMapping(p *PortMapping) error

ValidatePortMapping validates a PortMapping

func ValidateRegistry

func ValidateRegistry(r *Registry) error

ValidateRegistry validates a Registry

func ValidateRoute

func ValidateRoute(r *Route) error

ValidateRoute validates a Route

func ValidateStatusReporterStatus

func ValidateStatusReporterStatus(sr *StatusReporterStatus) error

ValidateStatusReporterStatus validates a StatusReporterStatus

func ValidateVolumeMapping

func ValidateVolumeMapping(v *VolumeMapping) error

ValidateVolumeMapping validates a VolumeMapping

func ValidateYamlConfig

func ValidateYamlConfig(yc *YamlConfig) error

ValidateYamlConfig validates a YamlConfig

Types

type CatalogGateDecision added in v1.1.0

type CatalogGateDecision int

CatalogGateDecision is whether a workload may create, must wait, or has failed.

const (
	CatalogGateAllow CatalogGateDecision = iota
	CatalogGateWait
	CatalogGateFail
)

Catalog start-gate outcomes.

func EvaluateCatalogStartGate added in v1.1.0

func EvaluateCatalogStartGate(c *ModelCatalog, requiredSource string, lookup ModelStatusLookup) (CatalogGateDecision, string, error)

EvaluateCatalogStartGate decides create vs wait vs fail from named item status.

type ControlPlaneAuthBootstrap

type ControlPlaneAuthBootstrap struct {
	Username string `yaml:"username,omitempty" json:"username,omitempty"`
	Password string `yaml:"password,omitempty" json:"password,omitempty"`
}

ControlPlaneAuthBootstrap holds embedded OIDC bootstrap admin credentials.

type ControlPlaneAuthClient

type ControlPlaneAuthClient struct {
	ID     string `yaml:"id,omitempty" json:"id,omitempty"`
	Secret string `yaml:"secret,omitempty" json:"secret,omitempty"`
}

ControlPlaneAuthClient holds OIDC confidential client credentials.

type ControlPlaneAuthOIDCTTL

type ControlPlaneAuthOIDCTTL struct {
	InteractionTTLSeconds *int `yaml:"interactionTtlSeconds,omitempty" json:"interactionTtlSeconds,omitempty"`
	GrantTTLSeconds       *int `yaml:"grantTtlSeconds,omitempty" json:"grantTtlSeconds,omitempty"`
	SessionTTLSeconds     *int `yaml:"sessionTtlSeconds,omitempty" json:"sessionTtlSeconds,omitempty"`
	IDTokenTTLSeconds     *int `yaml:"idTokenTtlSeconds,omitempty" json:"idTokenTtlSeconds,omitempty"`
}

ControlPlaneAuthOIDCTTL configures embedded OIDC provider TTL overrides.

type ControlPlaneAuthRateLimit

type ControlPlaneAuthRateLimit struct {
	Enabled              *bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	MaxRequestsPerWindow *int  `yaml:"maxRequestsPerWindow,omitempty" json:"maxRequestsPerWindow,omitempty"`
	WindowMs             *int  `yaml:"windowMs,omitempty" json:"windowMs,omitempty"`
}

ControlPlaneAuthRateLimit configures auth endpoint rate limiting.

type ControlPlaneAuthSessionStore

type ControlPlaneAuthSessionStore struct {
	Type   string `yaml:"type,omitempty" json:"type,omitempty"`
	TTLMs  *int   `yaml:"ttlMs,omitempty" json:"ttlMs,omitempty"`
	Secret string `yaml:"secret,omitempty" json:"secret,omitempty"`
}

ControlPlaneAuthSessionStore configures OAuth BFF session storage.

type ControlPlaneAuthSpec

type ControlPlaneAuthSpec struct {
	Mode                      string                        `yaml:"mode,omitempty" json:"mode,omitempty"`
	InsecureAllowHTTP         *bool                         `yaml:"insecureAllowHttp,omitempty" json:"insecureAllowHttp,omitempty"`
	InsecureAllowBootstrapLog *bool                         `yaml:"insecureAllowBootstrapLog,omitempty" json:"insecureAllowBootstrapLog,omitempty"`
	Bootstrap                 *ControlPlaneAuthBootstrap    `yaml:"bootstrap,omitempty" json:"bootstrap,omitempty"`
	IssuerURL                 string                        `yaml:"issuerUrl,omitempty" json:"issuerUrl,omitempty"`
	Client                    *ControlPlaneAuthClient       `yaml:"client,omitempty" json:"client,omitempty"`
	ConsoleClient             string                        `yaml:"consoleClient,omitempty" json:"consoleClient,omitempty"`
	ConsoleClientEnabled      *bool                         `yaml:"consoleClientEnabled,omitempty" json:"consoleClientEnabled,omitempty"`
	RateLimit                 *ControlPlaneAuthRateLimit    `yaml:"rateLimit,omitempty" json:"rateLimit,omitempty"`
	SessionStore              *ControlPlaneAuthSessionStore `yaml:"sessionStore,omitempty" json:"sessionStore,omitempty"`
	TokenTTL                  *ControlPlaneAuthTokenTTL     `yaml:"tokenTtl,omitempty" json:"tokenTtl,omitempty"`
	OIDCTTL                   *ControlPlaneAuthOIDCTTL      `yaml:"oidcTtl,omitempty" json:"oidcTtl,omitempty"`
}

ControlPlaneAuthSpec configures Controller OIDC (embedded or external).

func ValidEmbeddedAuthForTest

func ValidEmbeddedAuthForTest() *ControlPlaneAuthSpec

ValidEmbeddedAuthForTest returns a minimal valid embedded auth block for unit tests.

type ControlPlaneAuthTokenTTL

type ControlPlaneAuthTokenTTL struct {
	AccessTokenTTLSeconds  *int `yaml:"accessTokenTtlSeconds,omitempty" json:"accessTokenTtlSeconds,omitempty"`
	RefreshTokenTTLSeconds *int `yaml:"refreshTokenTtlSeconds,omitempty" json:"refreshTokenTtlSeconds,omitempty"`
}

ControlPlaneAuthTokenTTL configures JWT access/refresh token TTL overrides.

type ControlPlaneConsoleSpec

type ControlPlaneConsoleSpec struct {
	Port *int   `yaml:"port,omitempty" json:"port,omitempty"`
	URL  string `yaml:"url,omitempty" json:"url,omitempty"`
}

ControlPlaneConsoleSpec configures EdgeOps Console exposure.

type ControlPlaneDeployment

type ControlPlaneDeployment struct {
	ControllerUUID        string
	Namespace             string
	Name                  string
	ManifestYAML          string
	Image                 string
	State                 string
	ContainerID           string
	DesiredState          string
	RuntimeState          string
	LastError             string
	RestartCount          int
	LastTransitionAt      int64
	LastReconcileAt       int64
	LastStartAttemptAt    int64
	FailureCount          int
	DeletedAt             *int64
	Generation            int64
	ObservedGeneration    int64
	ControllerRegistered  bool
	InitialRebuildSkipped bool
}

ControlPlaneDeployment is the singleton SQLite record for a local ControlPlane manifest.

func (*ControlPlaneDeployment) NormalizeDefaults

func (d *ControlPlaneDeployment) NormalizeDefaults()

NormalizeDefaults ensures lifecycle defaults for control plane records.

type ControlPlaneManifest

type ControlPlaneManifest struct {
	APIVersion string `yaml:"apiVersion" json:"apiVersion"`
	Kind       string `yaml:"kind" json:"kind"`
	Metadata   struct {
		Name      string            `yaml:"name" json:"name"`
		Namespace string            `yaml:"namespace,omitempty" json:"namespace,omitempty"`
		Labels    map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`
	} `yaml:"metadata" json:"metadata"`
	Spec ControlPlaneManifestSpec `yaml:"spec" json:"spec"`
}

ControlPlaneManifest is the operator YAML for kind ControlPlane.

func DecodeControlPlaneManifestYAML

func DecodeControlPlaneManifestYAML(manifest string) (*ControlPlaneManifest, error)

DecodeControlPlaneManifestYAML decodes ControlPlane YAML without semantic validation.

func ParseControlPlaneManifest

func ParseControlPlaneManifest(manifest string) (*ControlPlaneManifest, error)

ParseControlPlaneManifest decodes and validates ControlPlane YAML.

func (*ControlPlaneManifest) ControllerRegistryID

func (m *ControlPlaneManifest) ControllerRegistryID() (int, bool)

ControllerRegistryID returns spec.controller.registry when set.

func (*ControlPlaneManifest) ManifestControllerImage

func (m *ControlPlaneManifest) ManifestControllerImage() string

ManifestControllerImage returns spec.controller.image trimmed.

func (*ControlPlaneManifest) MaskSecrets

func (m *ControlPlaneManifest) MaskSecrets()

MaskSecrets redacts sensitive ControlPlane manifest fields in place.

func (*ControlPlaneManifest) NormalizeDefaults

func (m *ControlPlaneManifest) NormalizeDefaults()

NormalizeDefaults applies metadata defaults before validation or env build.

func (*ControlPlaneManifest) Validate

func (m *ControlPlaneManifest) Validate() error

Validate checks ControlPlane manifest semantics.

type ControlPlaneManifestSpec

type ControlPlaneManifestSpec struct {
	Controller struct {
		Image      string `yaml:"image" json:"image"`
		Registry   *int   `yaml:"registry,omitempty" json:"registry,omitempty"`
		Port       *int   `yaml:"port,omitempty" json:"port,omitempty"`
		PublicURL  string `yaml:"publicUrl,omitempty" json:"publicUrl,omitempty"`
		TrustProxy *bool  `yaml:"trustProxy,omitempty" json:"trustProxy,omitempty"`
	} `yaml:"controller" json:"controller"`
	Console  ControlPlaneConsoleSpec `yaml:"console,omitempty" json:"console,omitempty"`
	Auth     *ControlPlaneAuthSpec   `yaml:"auth,omitempty" json:"auth,omitempty"`
	Database *struct {
		Provider     string `yaml:"provider,omitempty" json:"provider,omitempty"`
		User         string `yaml:"user,omitempty" json:"user,omitempty"`
		Host         string `yaml:"host,omitempty" json:"host,omitempty"`
		Port         *int   `yaml:"port,omitempty" json:"port,omitempty"`
		Password     string `yaml:"password,omitempty" json:"password,omitempty"`
		DatabaseName string `yaml:"databaseName,omitempty" json:"databaseName,omitempty"`
		SSL          *bool  `yaml:"ssl,omitempty" json:"ssl,omitempty"`
		CA           string `yaml:"ca,omitempty" json:"ca,omitempty"`
	} `yaml:"database,omitempty" json:"database,omitempty"`
	Events *struct {
		AuditEnabled     *bool `yaml:"auditEnabled,omitempty" json:"auditEnabled,omitempty"`
		RetentionDays    *int  `yaml:"retentionDays,omitempty" json:"retentionDays,omitempty"`
		CleanupInterval  *int  `yaml:"cleanupInterval,omitempty" json:"cleanupInterval,omitempty"`
		CaptureIPAddress *bool `yaml:"captureIpAddress,omitempty" json:"captureIpAddress,omitempty"`
	} `yaml:"events,omitempty" json:"events,omitempty"`
	SystemMicroservices *struct {
		Router map[string]string `yaml:"router,omitempty" json:"router,omitempty"`
		NATS   map[string]string `yaml:"nats,omitempty" json:"nats,omitempty"`
	} `yaml:"systemMicroservices,omitempty" json:"systemMicroservices,omitempty"`
	NATS *struct {
		Enabled *bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	} `yaml:"nats,omitempty" json:"nats,omitempty"`
	LogLevel string                 `yaml:"logLevel,omitempty" json:"logLevel,omitempty"`
	TLS      *ControlPlaneTLSConfig `yaml:"tls,omitempty" json:"tls,omitempty"`
	Vault    *ControlPlaneVaultSpec `yaml:"vault,omitempty" json:"vault,omitempty"`
	// Forbidden in Edgelet ControlPlane YAML (potctl REST import only).
	SiteCA  any `yaml:"siteCA,omitempty" json:"-"`
	LocalCA any `yaml:"localCA,omitempty" json:"-"`
}

ControlPlaneManifestSpec holds controller deployment configuration.

type ControlPlaneTLSBase64

type ControlPlaneTLSBase64 struct {
	Cert string `yaml:"cert,omitempty" json:"cert,omitempty"`
	Key  string `yaml:"key,omitempty" json:"key,omitempty"`
	CA   string `yaml:"ca,omitempty" json:"ca,omitempty"`
}

ControlPlaneTLSBase64 holds inline TLS material for ControlPlane listeners.

type ControlPlaneTLSConfig

type ControlPlaneTLSConfig struct {
	Path   string                 `yaml:"path,omitempty" json:"path,omitempty"`
	Base64 *ControlPlaneTLSBase64 `yaml:"base64,omitempty" json:"base64,omitempty"`
}

ControlPlaneTLSConfig configures TLS for the control plane controller.

type ControlPlaneVaultSpec

type ControlPlaneVaultSpec struct {
	Enabled   *bool  `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	Provider  string `yaml:"provider,omitempty" json:"provider,omitempty"`
	BasePath  string `yaml:"basePath,omitempty" json:"basePath,omitempty"`
	Hashicorp *struct {
		Address string `yaml:"address,omitempty" json:"address,omitempty"`
		Token   string `yaml:"token,omitempty" json:"token,omitempty"`
		Mount   string `yaml:"mount,omitempty" json:"mount,omitempty"`
	} `yaml:"hashicorp,omitempty" json:"hashicorp,omitempty"`
	AWS *struct {
		Region      string `yaml:"region,omitempty" json:"region,omitempty"`
		AccessKeyID string `yaml:"accessKeyId,omitempty" json:"accessKeyId,omitempty"`
		AccessKey   string `yaml:"accessKey,omitempty" json:"accessKey,omitempty"`
	} `yaml:"aws,omitempty" json:"aws,omitempty"`
	Azure *struct {
		URL          string `yaml:"url,omitempty" json:"url,omitempty"`
		TenantID     string `yaml:"tenantId,omitempty" json:"tenantId,omitempty"`
		ClientID     string `yaml:"clientId,omitempty" json:"clientId,omitempty"`
		ClientSecret string `yaml:"clientSecret,omitempty" json:"clientSecret,omitempty"`
	} `yaml:"azure,omitempty" json:"azure,omitempty"`
	Google *struct {
		ProjectID   string `yaml:"projectId,omitempty" json:"projectId,omitempty"`
		Credentials string `yaml:"credentials,omitempty" json:"credentials,omitempty"`
	} `yaml:"google,omitempty" json:"google,omitempty"`
}

ControlPlaneVaultSpec mirrors optional vault provider blocks.

type ControllerModel added in v1.1.0

type ControllerModel struct {
	UUID       string `json:"uuid"`
	Name       string `json:"name"`
	Repo       string `json:"repo"`
	Revision   string `json:"revision,omitempty"`
	RegistryID int    `json:"registryId"`
	FilesJSON  string `json:"filesJson,omitempty"`
	Format     string `json:"format,omitempty"`
}

ControllerModel is a fleet-desired Model row. Identity is uuid plus unique name.

func (*ControllerModel) Files added in v1.1.0

func (m *ControllerModel) Files() []string

Files returns the decoded spec.files list (empty slice when unset).

func (*ControllerModel) NormalizeDefaults added in v1.1.0

func (m *ControllerModel) NormalizeDefaults()

NormalizeDefaults trims ControllerModel identity fields.

func (*ControllerModel) SetFiles added in v1.1.0

func (m *ControllerModel) SetFiles(files []string)

SetFiles encodes spec.files as JSON for persistence.

func (*ControllerModel) ToLocalModel added in v1.1.0

func (m *ControllerModel) ToLocalModel() *LocalModel

ToLocalModel builds a Pending local row from a controller-desired Model.

type ControllerRuntimeClass added in v1.1.0

type ControllerRuntimeClass struct {
	Name    string `json:"name"`
	Handler string `json:"handler"`
}

ControllerRuntimeClass is a fleet-desired RuntimeClass row (name + handler).

func (*ControllerRuntimeClass) NormalizeDefaults added in v1.1.0

func (r *ControllerRuntimeClass) NormalizeDefaults()

NormalizeDefaults trims and lowercases fleet RuntimeClass identity fields.

type ControllerStatus

type ControllerStatus string

ControllerStatus represents the controller connection status

const (
	ControllerStatusOK                ControllerStatus = "OK"
	ControllerStatusNotConnected      ControllerStatus = "NOT_CONNECTED"
	ControllerStatusNotProvisioned    ControllerStatus = "NOT_PROVISIONED"
	ControllerStatusBrokenCertificate ControllerStatus = "BROKEN_CERTIFICATE"
	ControllerStatusBadRequest        ControllerStatus = "BAD_REQUEST"
	ControllerStatusUnauthorized      ControllerStatus = "UNAUTHORIZED"
	ControllerStatusNotFound          ControllerStatus = "NOT_FOUND"
	ControllerStatusInternalError     ControllerStatus = "INTERNAL_ERROR"
)

type DeviceMapping added in v1.1.0

type DeviceMapping struct {
	HostPath      string `json:"hostPath" yaml:"hostPath"`
	ContainerPath string `json:"containerPath" yaml:"containerPath"`
	Permissions   string `json:"permissions,omitempty" yaml:"permissions,omitempty"`
}

DeviceMapping is a host /dev device exposed into the container.

type EdgeletAPIStatus

type EdgeletAPIStatus struct {
	OpenConfigSocketsCount  int `json:"openConfigSocketsCount" yaml:"openConfigSocketsCount"`   // Number of open control/config sockets
	OpenMessageSocketsCount int `json:"openMessageSocketsCount" yaml:"openMessageSocketsCount"` // Number of open message sockets
}

EdgeletAPIStatus represents the Edgelet API status

func NewEdgeletAPIStatus

func NewEdgeletAPIStatus() *EdgeletAPIStatus

NewEdgeletAPIStatus creates a new EdgeletAPIStatus

func (*EdgeletAPIStatus) SetOpenConfigSocketsCount

func (l *EdgeletAPIStatus) SetOpenConfigSocketsCount(count int) *EdgeletAPIStatus

SetOpenConfigSocketsCount sets the open config sockets count and returns the status for chaining

type EnvVar

type EnvVar struct {
	Key   string `json:"key" yaml:"key"`
	Value string `json:"value" yaml:"value"`
}

EnvVar represents microservice environment variables

func NewEnvVar

func NewEnvVar(key, value string) *EnvVar

NewEnvVar creates a new EnvVar

func (*EnvVar) Equals

func (e *EnvVar) Equals(other *EnvVar) bool

Equals checks if two EnvVars are equal

type ErrModelFailed added in v1.1.0

type ErrModelFailed struct {
	Name   string
	Detail string
}

ErrModelFailed is returned when a catalog item names a Failed model.

func (*ErrModelFailed) Error added in v1.1.0

func (e *ErrModelFailed) Error() string

type ErrModelSourceScope added in v1.1.0

type ErrModelSourceScope struct {
	Name    string
	Want    string
	Have    string
	Missing bool
}

ErrModelSourceScope is returned when a catalog item name is missing or not allowed for this microservice (local workloads bind local models only; controller workloads bind managed models only).

func (*ErrModelSourceScope) Error added in v1.1.0

func (e *ErrModelSourceScope) Error() string

type ExecMessage

type ExecMessage struct {
	Type             byte   `json:"type" yaml:"type"` // 0: STDIN, 1: STDOUT, 2: STDERR, 3: CONTROL
	Data             []byte `json:"data" yaml:"data"`
	MicroserviceUUID string `json:"microserviceUuid" yaml:"microserviceUuid"`
	ExecID           string `json:"execId" yaml:"execId"`
	Timestamp        int64  `json:"timestamp" yaml:"timestamp"`
}

ExecMessage represents a message for exec session WebSocket communication

func NewExecMessage

func NewExecMessage(msgType byte, data []byte, microserviceUUID, execID string) *ExecMessage

NewExecMessage creates a new ExecMessage

type FieldAgentStatus

type FieldAgentStatus struct {
	ControllerStatus   ControllerStatus `json:"controllerStatus" yaml:"controllerStatus"`
	LastCommandTime    int64            `json:"lastCommandTime" yaml:"lastCommandTime"`
	ControllerVerified bool             `json:"controllerVerified" yaml:"controllerVerified"`
	ReadyToUpgrade     bool             `json:"readyToUpgrade" yaml:"readyToUpgrade"`
	ReadyToRollback    bool             `json:"readyToRollback" yaml:"readyToRollback"`
}

FieldAgentStatus represents the Field Agent status

func NewFieldAgentStatus

func NewFieldAgentStatus() *FieldAgentStatus

NewFieldAgentStatus creates a new FieldAgentStatus with default values

type Healthcheck

type Healthcheck struct {
	Test          []string `json:"test" yaml:"test"`
	Interval      *int64   `json:"interval,omitempty" yaml:"interval,omitempty"`
	Timeout       *int64   `json:"timeout,omitempty" yaml:"timeout,omitempty"`
	StartPeriod   *int64   `json:"startPeriod,omitempty" yaml:"startPeriod,omitempty"`
	StartInterval *int64   `json:"startInterval,omitempty" yaml:"startInterval,omitempty"`
	Retries       *int     `json:"retries,omitempty" yaml:"retries,omitempty"`
}

Healthcheck represents container healthcheck configuration

func NewHealthcheck

func NewHealthcheck(test []string, interval, timeout, startPeriod, startInterval *int64, retries *int) *Healthcheck

NewHealthcheck creates a new Healthcheck

func (*Healthcheck) Equals

func (h *Healthcheck) Equals(other *Healthcheck) bool

Equals checks if two Healthchecks are equal

type LocalDeployManifest

type LocalDeployManifest struct {
	APIVersion string `yaml:"apiVersion" json:"apiVersion"`
	Kind       string `yaml:"kind" json:"kind"`
	Metadata   struct {
		Name      string            `yaml:"name" json:"name"`
		Namespace string            `yaml:"namespace,omitempty" json:"namespace,omitempty"`
		Labels    map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`
	} `yaml:"metadata" json:"metadata"`
	Spec struct {
		Image     string        `yaml:"image" json:"image"`
		Registry  *int          `yaml:"registry,omitempty" json:"registry,omitempty"`
		Models    *ModelCatalog `yaml:"models,omitempty" json:"models,omitempty"`
		Container struct {
			Annotations            map[string]any    `yaml:"annotations,omitempty" json:"annotations,omitempty"`
			HostNetworkMode        bool              `yaml:"hostNetworkMode" json:"hostNetworkMode"`
			IsPrivileged           bool              `yaml:"isPrivileged" json:"isPrivileged"`
			CapAdd                 []string          `yaml:"capAdd,omitempty" json:"capAdd,omitempty"`
			CapDrop                []string          `yaml:"capDrop,omitempty" json:"capDrop,omitempty"`
			IpcMode                string            `yaml:"ipcMode,omitempty" json:"ipcMode,omitempty"`
			PidMode                string            `yaml:"pidMode,omitempty" json:"pidMode,omitempty"`
			RunAsUser              string            `yaml:"runAsUser,omitempty" json:"runAsUser,omitempty"`
			RunAsGroup             string            `yaml:"runAsGroup,omitempty" json:"runAsGroup,omitempty"`
			ReadOnlyRootFilesystem bool              `yaml:"readOnlyRootFilesystem,omitempty" json:"readOnlyRootFilesystem,omitempty"`
			Platform               string            `yaml:"platform,omitempty" json:"platform,omitempty"`
			Runtime                string            `yaml:"runtime,omitempty" json:"runtime,omitempty"`
			CDIDevices             []string          `yaml:"cdiDevices,omitempty" json:"cdiDevices,omitempty"`
			Sysctls                map[string]string `yaml:"sysctls,omitempty" json:"sysctls,omitempty"`
			Ulimits                map[string]Ulimit `yaml:"ulimits,omitempty" json:"ulimits,omitempty"`
			Devices                []DeviceMapping   `yaml:"devices,omitempty" json:"devices,omitempty"`
			Tmpfs                  []TmpfsMount      `yaml:"tmpfs,omitempty" json:"tmpfs,omitempty"`
			Volumes                []struct {
				HostDestination      string `yaml:"hostDestination" json:"hostDestination"`
				ContainerDestination string `yaml:"containerDestination" json:"containerDestination"`
				AccessMode           string `yaml:"accessMode,omitempty" json:"accessMode,omitempty"`
				Type                 string `yaml:"type,omitempty" json:"type,omitempty"`
			} `yaml:"volumes,omitempty" json:"volumes,omitempty"`
			ExtraHosts []struct {
				Name    string `yaml:"name" json:"name"`
				Address string `yaml:"address" json:"address"`
			} `yaml:"extraHosts,omitempty" json:"extraHosts,omitempty"`
			Env []struct {
				Key   string `yaml:"key" json:"key"`
				Value string `yaml:"value" json:"value"`
			} `yaml:"env,omitempty" json:"env,omitempty"`
			Ports []struct {
				Internal int    `yaml:"internal" json:"internal"`
				External int    `yaml:"external" json:"external"`
				Protocol string `yaml:"protocol,omitempty" json:"protocol,omitempty"`
			} `yaml:"ports,omitempty" json:"ports,omitempty"`
			WorkingDir        string    `yaml:"workingDir,omitempty" json:"workingDir,omitempty"`
			Entrypoint        *[]string `yaml:"entrypoint,omitempty" json:"entrypoint,omitempty"`
			Commands          *[]string `yaml:"commands,omitempty" json:"commands,omitempty"`
			CPUSetCpus        string    `yaml:"cpuSetCpus,omitempty" json:"cpuSetCpus,omitempty"`
			Cpus              *float64  `yaml:"cpus,omitempty" json:"cpus,omitempty"`
			MemoryLimit       int64     `yaml:"memoryLimit,omitempty" json:"memoryLimit,omitempty"`
			MemoryReservation *int64    `yaml:"memoryReservation,omitempty" json:"memoryReservation,omitempty"`
			MemorySwap        *int64    `yaml:"memorySwap,omitempty" json:"memorySwap,omitempty"`
			ShmSize           *int64    `yaml:"shmSize,omitempty" json:"shmSize,omitempty"`
			HealthCheck       struct {
				Test        []string `yaml:"test,omitempty" json:"test,omitempty"`
				Interval    int      `yaml:"interval,omitempty" json:"interval,omitempty"`
				Timeout     int      `yaml:"timeout,omitempty" json:"timeout,omitempty"`
				StartPeriod int      `yaml:"startPeriod,omitempty" json:"startPeriod,omitempty"`
				Retries     int      `yaml:"retries,omitempty" json:"retries,omitempty"`
			} `yaml:"healthCheck,omitempty" json:"healthCheck,omitempty"`
		} `yaml:"container,omitempty" json:"container,omitempty"`
		Schedule int            `yaml:"schedule,omitempty" json:"schedule,omitempty"`
		Config   map[string]any `yaml:"config,omitempty" json:"config,omitempty"`
	} `yaml:"spec" json:"spec"`
}

LocalDeployManifest mirrors single-microservice deploy shape used by controller deploy flows.

func (*LocalDeployManifest) ManifestImage

func (m *LocalDeployManifest) ManifestImage() string

ManifestImage returns the resolved container image from spec.image.

func (*LocalDeployManifest) Validate

func (m *LocalDeployManifest) Validate() error

func (*LocalDeployManifest) ValidateCatalogApply added in v1.1.0

func (m *LocalDeployManifest) ValidateCatalogApply(lookup ModelStatusLookup) error

ValidateCatalogApply runs Validate then rejects unknown or Failed local catalog names.

func (*LocalDeployManifest) ValidateWithModelSources added in v1.1.0

func (m *LocalDeployManifest) ValidateWithModelSources(lookup ModelSourceLookup) error

ValidateWithModelSources runs Validate then checks catalog item names against a source lookup.

type LocalDeployedMicroservice

type LocalDeployedMicroservice struct {
	LocalUUID          string
	ApplicationName    string
	MicroserviceName   string
	SourceName         string
	ManifestYAML       string
	ImageName          string
	State              string
	ContainerID        string
	DesiredState       string
	RuntimeState       string
	LastError          string
	RestartCount       int
	LastTransitionAt   int64
	LastReconcileAt    int64
	LastStartAttemptAt int64
	FailureCount       int
	DeletedAt          *int64
	Generation         int64
	ObservedGeneration int64
}

LocalDeployedMicroservice represents a microservice deployed by EdgeletAPI/CLI (not controller-managed).

func (*LocalDeployedMicroservice) IsDeleting added in v1.1.0

func (m *LocalDeployedMicroservice) IsDeleting() bool

IsDeleting reports whether a local remove is still in progress (container may still exist).

func (*LocalDeployedMicroservice) IsGone added in v1.1.0

func (m *LocalDeployedMicroservice) IsGone() bool

IsGone reports a local tombstone that should not appear in inventory or name reuse.

func (*LocalDeployedMicroservice) NormalizeDefaults

func (m *LocalDeployedMicroservice) NormalizeDefaults()

NormalizeDefaults ensures lifecycle defaults are present for local records.

type LocalModel added in v1.1.0

type LocalModel struct {
	Name               string `json:"name"`
	Source             string `json:"source,omitempty"`
	Repo               string `json:"repo"`
	Revision           string `json:"revision,omitempty"`
	RegistryID         int    `json:"registryId"`
	FilesJSON          string `json:"filesJson,omitempty"`
	Format             string `json:"format,omitempty"`
	State              string `json:"state"`
	LastError          string `json:"lastError,omitempty"`
	Generation         int64  `json:"generation"`
	ObservedGeneration int64  `json:"observedGeneration"`
	ManifestYAML       string `json:"manifestYaml,omitempty"`
	ManifestPath       string `json:"manifestPath,omitempty"`
	ContentPath        string `json:"contentPath,omitempty"`
	ResolvedRevision   string `json:"resolvedRevision,omitempty"`
	Digest             string `json:"digest,omitempty"`
	RevisionFloating   bool   `json:"revisionFloating,omitempty"`
	TotalBytes         int64  `json:"totalBytes,omitempty"`
	LastTransitionAt   int64  `json:"lastTransitionAt,omitempty"`
	LastReconcileAt    int64  `json:"lastReconcileAt,omitempty"`
	PulledAt           int64  `json:"pulledAt,omitempty"`
}

LocalModel is the persistent local Model row stored in SQLite.

func (*LocalModel) Files added in v1.1.0

func (m *LocalModel) Files() []string

Files returns the decoded spec.files list (empty slice when unset).

func (*LocalModel) NormalizeDefaults added in v1.1.0

func (m *LocalModel) NormalizeDefaults()

NormalizeDefaults applies Model row defaults used by store accessors.

func (*LocalModel) SetFiles added in v1.1.0

func (m *LocalModel) SetFiles(files []string)

SetFiles encodes spec.files as JSON for persistence.

type LocalModelManifest added in v1.1.0

type LocalModelManifest struct {
	APIVersion string `yaml:"apiVersion" json:"apiVersion"`
	Kind       string `yaml:"kind" json:"kind"`
	Metadata   struct {
		Name   string            `yaml:"name" json:"name"`
		Labels map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`
	} `yaml:"metadata" json:"metadata"`
	Spec LocalModelSpec `yaml:"spec" json:"spec"`
}

LocalModelManifest represents local Model deployment YAML.

func (*LocalModelManifest) FilesJSON added in v1.1.0

func (m *LocalModelManifest) FilesJSON() string

FilesJSON returns the spec.files list encoded for SQLite.

func (*LocalModelManifest) ToLocalModel added in v1.1.0

func (m *LocalModelManifest) ToLocalModel() *LocalModel

ToLocalModel builds a store row from a validated manifest.

func (*LocalModelManifest) Validate added in v1.1.0

func (m *LocalModelManifest) Validate() error

func (*LocalModelManifest) ValidateWithRegistry added in v1.1.0

func (m *LocalModelManifest) ValidateWithRegistry(reg *Registry) error

ValidateWithRegistry validates the Model document. When reg is non-nil (row exists), it checks id match and registry type compatibility.

type LocalModelSpec added in v1.1.0

type LocalModelSpec struct {
	Repo     string   `yaml:"repo" json:"repo"`
	Revision string   `yaml:"revision,omitempty" json:"revision,omitempty"`
	Registry int      `yaml:"registry" json:"registry"`
	Files    []string `yaml:"files,omitempty" json:"files,omitempty"`
	Format   string   `yaml:"format,omitempty" json:"format,omitempty"`
}

LocalModelSpec is the spec block of a local Model deploy document.

type LocalRegistryManifest

type LocalRegistryManifest struct {
	APIVersion string            `yaml:"apiVersion" json:"apiVersion"`
	Kind       string            `yaml:"kind" json:"kind"`
	Spec       LocalRegistrySpec `yaml:"spec" json:"spec"`
}

LocalRegistryManifest represents local registry deployment YAML.

func (*LocalRegistryManifest) CollisionWith added in v1.1.0

func (m *LocalRegistryManifest) CollisionWith(existing *Registry) error

CollisionWith reports a validate error when existing has a different (type, url).

func (*LocalRegistryManifest) ToRegistry added in v1.1.0

func (m *LocalRegistryManifest) ToRegistry(id int) *Registry

ToRegistry builds a store Registry from the validated manifest and allocated/upsert id.

func (*LocalRegistryManifest) Validate

func (m *LocalRegistryManifest) Validate() error

type LocalRegistrySpec added in v1.1.0

type LocalRegistrySpec struct {
	ID        int    `yaml:"id,omitempty" json:"id,omitempty"`
	Type      string `yaml:"type,omitempty" json:"type,omitempty"`
	URL       string `yaml:"url" json:"url"`
	UserName  string `yaml:"username,omitempty" json:"username,omitempty"`
	Password  string `yaml:"password,omitempty" json:"password,omitempty"`
	UserEmail string `yaml:"email,omitempty" json:"email,omitempty"`
	Private   bool   `yaml:"private" json:"private"`
	CA        string `yaml:"ca,omitempty" json:"ca,omitempty"`
	Insecure  bool   `yaml:"insecure" json:"insecure"`
}

LocalRegistrySpec is the spec block of a local Registry deploy document.

type LocalRuntimeClass

type LocalRuntimeClass struct {
	Name        string `json:"name"`
	Handler     string `json:"handler"`
	Source      string `json:"source,omitempty"`
	RuntimeName string `json:"runtimeName,omitempty"`
	CreatedAt   int64  `json:"createdAt,omitempty"`
	UpdatedAt   int64  `json:"updatedAt,omitempty"`
}

LocalRuntimeClass is the persistent RuntimeClass row stored in SQLite.

func (*LocalRuntimeClass) Normalize

func (r *LocalRuntimeClass) Normalize()

func (*LocalRuntimeClass) RuntimeBinaryPath

func (r *LocalRuntimeClass) RuntimeBinaryPath() string

type LocalRuntimeClassManifest

type LocalRuntimeClassManifest struct {
	APIVersion string `yaml:"apiVersion" json:"apiVersion"`
	Kind       string `yaml:"kind" json:"kind"`
	Metadata   struct {
		Name string `yaml:"name" json:"name"`
	} `yaml:"metadata" json:"metadata"`
	Handler string `yaml:"handler" json:"handler"`
}

LocalRuntimeClassManifest represents local RuntimeClass deployment YAML. RuntimeClass uses top-level fields to keep local manifests concise.

func (*LocalRuntimeClassManifest) Validate

func (m *LocalRuntimeClassManifest) Validate() error

type LogMessage

type LogMessage struct {
	Type             byte   `json:"type" yaml:"type"` // 6: LOG_LINE, 7: LOG_START, 8: LOG_STOP, 9: LOG_ERROR
	Data             []byte `json:"data" yaml:"data"`
	SessionID        string `json:"sessionId" yaml:"sessionId"`
	MicroserviceUUID string `json:"microserviceUuid,omitempty" yaml:"microserviceUuid,omitempty"` // For microservice logs
	IofogUUID        string `json:"iofogUuid,omitempty" yaml:"iofogUuid,omitempty"`               // For fog logs
	Timestamp        int64  `json:"timestamp" yaml:"timestamp"`
}

LogMessage represents a message for log session WebSocket communication

func NewLogMessage

func NewLogMessage(msgType byte, data []byte, sessionID, microserviceUUID, iofogUUID string) *LogMessage

NewLogMessage creates a new LogMessage

type Microservice

type Microservice struct {
	// Required fields
	MicroserviceUUID string `json:"microserviceUuid" yaml:"microserviceUuid"`
	ImageName        string `json:"imageName" yaml:"imageName"`

	// Optional fields
	PortMappings           []*PortMapping    `json:"portMappings,omitempty" yaml:"portMappings,omitempty"`
	Config                 *string           `json:"config,omitempty" yaml:"config,omitempty"`
	RunAsUser              *string           `json:"runAsUser,omitempty" yaml:"runAsUser,omitempty"`
	RunAsGroup             *string           `json:"runAsGroup,omitempty" yaml:"runAsGroup,omitempty"`
	Platform               *string           `json:"platform,omitempty" yaml:"platform,omitempty"`
	Runtime                *string           `json:"runtime,omitempty" yaml:"runtime,omitempty"`
	ContainerID            string            `json:"containerId" yaml:"containerId"`
	RegistryID             int               `json:"registryId" yaml:"registryId"`
	ContainerIPAddress     *string           `json:"containerIpAddress,omitempty" yaml:"containerIpAddress,omitempty"`
	Rebuild                bool              `json:"rebuild" yaml:"rebuild"`
	HostNetworkMode        bool              `json:"hostNetworkMode" yaml:"hostNetworkMode"`
	IsPrivileged           bool              `json:"isPrivileged" yaml:"isPrivileged"`
	LogSize                int64             `json:"logSize" yaml:"logSize"`
	VolumeMappings         []*VolumeMapping  `json:"volumeMappings,omitempty" yaml:"volumeMappings,omitempty"`
	IsUpdating             bool              `json:"isUpdating" yaml:"isUpdating"`
	EnvVars                []*EnvVar         `json:"envVars,omitempty" yaml:"envVars,omitempty"`
	Args                   []string          `json:"args,omitempty" yaml:"args,omitempty"`
	Entrypoint             *[]string         `json:"entrypoint,omitempty" yaml:"entrypoint,omitempty"`
	Commands               *[]string         `json:"commands,omitempty" yaml:"commands,omitempty"`
	CdiDevs                []string          `json:"cdiDevs,omitempty" yaml:"cdiDevs,omitempty"`
	Annotations            *string           `json:"annotations,omitempty" yaml:"annotations,omitempty"`
	CapAdd                 []string          `json:"capAdd,omitempty" yaml:"capAdd,omitempty"`
	CapDrop                []string          `json:"capDrop,omitempty" yaml:"capDrop,omitempty"`
	ExtraHosts             []string          `json:"extraHosts,omitempty" yaml:"extraHosts,omitempty"`
	IsRouter               bool              `json:"isRouter" yaml:"isRouter"`
	IsController           bool              `json:"isController" yaml:"isController"`
	IsSystem               bool              `json:"isSystem" yaml:"isSystem"`
	PidMode                *string           `json:"pidMode,omitempty" yaml:"pidMode,omitempty"`
	IpcMode                *string           `json:"ipcMode,omitempty" yaml:"ipcMode,omitempty"`
	MicroserviceName       string            `json:"name" yaml:"name"`
	ApplicationName        string            `json:"application" yaml:"application"`
	Labels                 map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	IsNats                 bool              `json:"isNats" yaml:"isNats"`
	Schedule               int               `json:"schedule" yaml:"schedule"`
	CPUSetCpus             *string           `json:"cpuSetCpus,omitempty" yaml:"cpuSetCpus,omitempty"`
	Cpus                   *float64          `json:"cpus,omitempty" yaml:"cpus,omitempty"`
	MemoryLimit            *int64            `json:"memoryLimit,omitempty" yaml:"memoryLimit,omitempty"`             // stored bytes; wire MiB (managed/local YAML)
	MemoryReservation      *int64            `json:"memoryReservation,omitempty" yaml:"memoryReservation,omitempty"` // stored bytes; wire MiB
	MemorySwap             *int64            `json:"memorySwap,omitempty" yaml:"memorySwap,omitempty"`               // -1 unlimited; else stored bytes
	ShmSize                *int64            `json:"shmSize,omitempty" yaml:"shmSize,omitempty"`                     // stored bytes; wire MiB
	ReadOnlyRootFilesystem bool              `json:"readOnlyRootFilesystem,omitempty" yaml:"readOnlyRootFilesystem,omitempty"`
	Sysctls                map[string]string `json:"sysctls,omitempty" yaml:"sysctls,omitempty"`
	Ulimits                map[string]Ulimit `json:"ulimits,omitempty" yaml:"ulimits,omitempty"`
	Devices                []DeviceMapping   `json:"devices,omitempty" yaml:"devices,omitempty"`
	Tmpfs                  []TmpfsMount      `json:"tmpfs,omitempty" yaml:"tmpfs,omitempty"`
	WorkingDir             *string           `json:"workingDir,omitempty" yaml:"workingDir,omitempty"`
	Models                 *ModelCatalog     `json:"models,omitempty" yaml:"models,omitempty"`
	ServiceAccount         *ServiceAccount   `json:"serviceAccount,omitempty" yaml:"serviceAccount,omitempty"`

	// Internal state fields
	Delete            bool         `json:"delete" yaml:"delete"`
	DeleteWithCleanup bool         `json:"deleteWithCleanup" yaml:"deleteWithCleanup"`
	IsStuckInRestart  bool         `json:"isStuckInRestart" yaml:"isStuckInRestart"`
	Healthcheck       *Healthcheck `json:"healthcheck,omitempty" yaml:"healthcheck,omitempty"`
	// contains filtered or unexported fields
}

Microservice represents a microservice/container configuration

func BuildMicroserviceFromLocalManifest

func BuildMicroserviceFromLocalManifest(doc *LocalDeployManifest, deploymentID, image string) *Microservice

BuildMicroserviceFromLocalManifest converts a local deploy manifest into a runtime microservice model used by the container engine.

func NewMicroservice

func NewMicroservice(microserviceUUID, imageName string) *Microservice

NewMicroservice creates a new Microservice with required fields

func (*Microservice) Equals

func (m *Microservice) Equals(other *Microservice) bool

Equals checks if two Microservices are equal based on UUID

func (*Microservice) GetIsUpdating

func (m *Microservice) GetIsUpdating() bool

IsUpdating returns whether the microservice is currently updating (thread-safe)

func (*Microservice) GetMemoryLimitMB

func (m *Microservice) GetMemoryLimitMB() *int64

GetMemoryLimitMB returns the memory limit in MiB (from stored bytes).

func (*Microservice) GetMemoryReservationMB added in v1.1.0

func (m *Microservice) GetMemoryReservationMB() *int64

GetMemoryReservationMB returns the memory reservation in MiB (from stored bytes).

func (*Microservice) GetMemorySwapMB added in v1.1.0

func (m *Microservice) GetMemorySwapMB() *int64

GetMemorySwapMB returns memory+swap total in MiB, or -1 for unlimited.

func (*Microservice) GetShmSizeMB added in v1.1.0

func (m *Microservice) GetShmSizeMB() *int64

GetShmSizeMB returns /dev/shm size in MiB (from stored bytes).

func (*Microservice) MarshalModelsJSON added in v1.1.0

func (m *Microservice) MarshalModelsJSON() (string, error)

MarshalModelsJSON encodes the catalog bind for the models column. Empty catalog becomes {}.

func (*Microservice) SetIsUpdating

func (m *Microservice) SetIsUpdating(updating bool)

SetIsUpdating sets the updating state (thread-safe)

func (*Microservice) SetMemoryLimitMB

func (m *Microservice) SetMemoryLimitMB(memoryLimitMB *int64)

SetMemoryLimitMB sets the memory limit from MiB (managed/local wire) to stored bytes.

func (*Microservice) SetMemoryReservationMB added in v1.1.0

func (m *Microservice) SetMemoryReservationMB(mb *int64)

SetMemoryReservationMB sets the memory reservation from MiB to stored bytes.

func (*Microservice) SetMemorySwapMB added in v1.1.0

func (m *Microservice) SetMemorySwapMB(mb *int64)

SetMemorySwapMB sets memory+swap from MiB (-1 stays unlimited).

func (*Microservice) SetShmSizeMB added in v1.1.0

func (m *Microservice) SetShmSizeMB(mb *int64)

SetShmSizeMB sets /dev/shm size from MiB to stored bytes.

func (*Microservice) UnmarshalModelsJSON added in v1.1.0

func (m *Microservice) UnmarshalModelsJSON(raw string) error

UnmarshalModelsJSON loads the catalog bind from the models column.

func (*Microservice) Validate

func (m *Microservice) Validate() error

Validate validates the microservice configuration

func (*Microservice) ValidateCatalogApply added in v1.1.0

func (m *Microservice) ValidateCatalogApply(requiredSource string, lookup ModelStatusLookup) error

ValidateCatalogApply runs Validate then rejects unknown or Failed catalog names for requiredSource.

func (*Microservice) ValidateWithModelSources added in v1.1.0

func (m *Microservice) ValidateWithModelSources(requiredSource string, lookup ModelSourceLookup) error

ValidateWithModelSources runs Validate then checks catalog item names against a source lookup.

type MicroserviceState

type MicroserviceState string

MicroserviceState represents the state of a microservice

const (
	MicroserviceStateQueued            MicroserviceState = "QUEUED"
	MicroserviceStatePulling           MicroserviceState = "PULLING"
	MicroserviceStateCreating          MicroserviceState = "CREATING"
	MicroserviceStateCreated           MicroserviceState = "CREATED"
	MicroserviceStateStarting          MicroserviceState = "STARTING"
	MicroserviceStateRunning           MicroserviceState = "RUNNING"
	MicroserviceStateUpdating          MicroserviceState = "UPDATING"
	MicroserviceStateRestarting        MicroserviceState = "RESTARTING"
	MicroserviceStateExiting           MicroserviceState = "EXITING"
	MicroserviceStateStuckInRestart    MicroserviceState = "STUCK_IN_RESTART"
	MicroserviceStateFailed            MicroserviceState = "FAILED"
	MicroserviceStateMarkedForDeletion MicroserviceState = "MARKED_FOR_DELETION"
	MicroserviceStateDeleting          MicroserviceState = "DELETING"
	MicroserviceStateDeleted           MicroserviceState = "DELETED"
	MicroserviceStateStopping          MicroserviceState = "STOPPING"
	MicroserviceStateStopped           MicroserviceState = "STOPPED"
	MicroserviceStateUnknown           MicroserviceState = "UNKNOWN"
)

func MicroserviceStateFromText

func MicroserviceStateFromText(value string) MicroserviceState

FromText converts a string to MicroserviceState

type MicroserviceStatus

type MicroserviceStatus struct {
	Status         MicroserviceState `json:"status" yaml:"status"`
	StartTime      int64             `json:"startTime" yaml:"startTime"`
	CPUUsage       float32           `json:"cpuUsage" yaml:"cpuUsage"`
	MemoryUsage    int64             `json:"memoryUsage" yaml:"memoryUsage"`
	ContainerID    string            `json:"containerId" yaml:"containerId"`
	PodID          string            `json:"podId,omitempty" yaml:"podId,omitempty"`
	Percentage     float32           `json:"percentage" yaml:"percentage"`
	ErrorMessage   *string           `json:"errorMessage,omitempty" yaml:"errorMessage,omitempty"`
	IPAddress      *string           `json:"ipAddress,omitempty" yaml:"ipAddress,omitempty"`
	ExecSessionIDs []string          `json:"execSessionIds,omitempty" yaml:"execSessionIds,omitempty"`
	HealthStatus   *string           `json:"healthStatus,omitempty" yaml:"healthStatus,omitempty"`
}

MicroserviceStatus represents the status of a microservice

func NewMicroserviceStatus

func NewMicroserviceStatus() *MicroserviceStatus

NewMicroserviceStatus creates a new MicroserviceStatus with UNKNOWN state

func NewMicroserviceStatusWithState

func NewMicroserviceStatusWithState(status MicroserviceState) *MicroserviceStatus

NewMicroserviceStatusWithState creates a new MicroserviceStatus with the given state

func (*MicroserviceStatus) AddExecSessionID

func (m *MicroserviceStatus) AddExecSessionID(execSessionID string)

AddExecSessionID adds an exec session ID

func (*MicroserviceStatus) ApplyPodID added in v1.1.0

func (m *MicroserviceStatus) ApplyPodID(engineName, sandboxID string)

ApplyPodID sets PodID from the current engine and optional sandbox id.

func (*MicroserviceStatus) Equals

func (m *MicroserviceStatus) Equals(other *MicroserviceStatus) bool

Equals checks if two MicroserviceStatuses are equal based on status

func (*MicroserviceStatus) GetExecSessionIDs

func (m *MicroserviceStatus) GetExecSessionIDs() []string

GetExecSessionIDs returns the exec session IDs (never nil)

func (*MicroserviceStatus) GetOperatingDuration

func (m *MicroserviceStatus) GetOperatingDuration() int64

GetOperatingDuration returns the operating duration in milliseconds

func (*MicroserviceStatus) RemoveExecSessionID

func (m *MicroserviceStatus) RemoveExecSessionID(execSessionID string)

RemoveExecSessionID removes an exec session ID

type ModelCatalog added in v1.1.0

type ModelCatalog struct {
	BindPath    string             `json:"bindPath,omitempty" yaml:"bindPath,omitempty"`
	Permissions string             `json:"permissions,omitempty" yaml:"permissions,omitempty"`
	Items       []ModelCatalogItem `json:"items,omitempty" yaml:"items,omitempty"`
}

ModelCatalog is the microservice catalog bind (bindPath + items by name).

func (*ModelCatalog) Clone added in v1.1.0

func (c *ModelCatalog) Clone() *ModelCatalog

Clone returns a shallow copy of the catalog (nil-safe).

func (*ModelCatalog) HasItems added in v1.1.0

func (c *ModelCatalog) HasItems() bool

HasItems reports whether the catalog lists at least one item.

func (*ModelCatalog) ItemContainerPath added in v1.1.0

func (c *ModelCatalog) ItemContainerPath(name string) string

ItemContainerPath is the in-container path for one catalog item: {bindPath}/{name}.

func (*ModelCatalog) NormalizeDefaults added in v1.1.0

func (c *ModelCatalog) NormalizeDefaults()

NormalizeDefaults trims fields and defaults permissions to ro when items are present.

type ModelCatalogItem added in v1.1.0

type ModelCatalogItem struct {
	Name string `json:"name" yaml:"name"`
}

ModelCatalogItem names one model whose Ready content/ is projected under bindPath.

type ModelSourceLookup added in v1.1.0

type ModelSourceLookup func(name string) (source string, exists bool, err error)

ModelSourceLookup returns the stored source for a model name. exists is false when the name is not present.

type ModelStatusInfo added in v1.1.0

type ModelStatusInfo struct {
	Source      string
	State       string
	Exists      bool
	Generation  int64
	ContentPath string
	LastError   string
}

ModelStatusInfo is the stored identity and lifecycle of one named model.

type ModelStatusLookup added in v1.1.0

type ModelStatusLookup func(name string) (ModelStatusInfo, error)

ModelStatusLookup returns stored status for a model name. Exists is false when the name is not present.

type ModuleStatus

type ModuleStatus string

ModuleStatus represents the status of a module

const (
	ModuleStatusStarting ModuleStatus = "STARTING"
	ModuleStatusRunning  ModuleStatus = "RUNNING"
	ModuleStatusStopped  ModuleStatus = "STOPPED"
	ModuleStatusWarning  ModuleStatus = "WARNING"
	ModuleStatusUnknown  ModuleStatus = "UNKNOWN"
)

type PortMapping

type PortMapping struct {
	Outside int  `json:"outside" yaml:"outside"`
	Inside  int  `json:"inside" yaml:"inside"`
	UDP     bool `json:"udp" yaml:"udp"`
}

PortMapping represents microservice port mappings

func NewPortMapping

func NewPortMapping(outside, inside int, udp bool) *PortMapping

NewPortMapping creates a new PortMapping

func (*PortMapping) CompareTo

func (p *PortMapping) CompareTo(other *PortMapping) int

CompareTo compares two PortMappings (for sorting) Returns: negative if p < other, zero if equal, positive if p > other

func (*PortMapping) Equals

func (p *PortMapping) Equals(other *PortMapping) bool

Equals checks if two PortMappings are equal

type ProcessManagerStatus

type ProcessManagerStatus struct {
	RunningMicroservicesCount int                            `json:"runningMicroservicesCount" yaml:"runningMicroservicesCount"` // Number of running microservices
	MicroservicesStatus       map[string]*MicroserviceStatus `json:"microservicesStatus" yaml:"microservicesStatus"`             // Status of each microservice
	RegistriesStatus          map[int]string                 `json:"registriesStatus" yaml:"registriesStatus"`                   // Status of each registry (registry ID -> status)
	// contains filtered or unexported fields
}

ProcessManagerStatus represents the Process Manager status

func NewProcessManagerStatus

func NewProcessManagerStatus() *ProcessManagerStatus

NewProcessManagerStatus creates a new ProcessManagerStatus

func (*ProcessManagerStatus) ClearMicroserviceStatuses

func (p *ProcessManagerStatus) ClearMicroserviceStatuses()

ClearMicroserviceStatuses clears all tracked microservice statuses and resets count.

func (*ProcessManagerStatus) GetJSONMicroservicesStatus

func (p *ProcessManagerStatus) GetJSONMicroservicesStatus() string

GetJSONMicroservicesStatus returns the microservices status as a JSON string

func (*ProcessManagerStatus) GetJSONRegistriesStatus

func (p *ProcessManagerStatus) GetJSONRegistriesStatus() string

GetJSONRegistriesStatus returns the registries status as a JSON string

func (*ProcessManagerStatus) GetMicroserviceStatus

func (p *ProcessManagerStatus) GetMicroserviceStatus(microserviceUUID string) *MicroserviceStatus

GetMicroserviceStatus gets the status of a microservice, creating it if it doesn't exist

func (*ProcessManagerStatus) GetRegistriesStatus

func (p *ProcessManagerStatus) GetRegistriesStatus() map[int]string

GetRegistriesStatus returns the registries status map

func (*ProcessManagerStatus) PruneMicroserviceStatus

func (p *ProcessManagerStatus) PruneMicroserviceStatus(predicate func(uuid string, status *MicroserviceStatus) bool)

PruneMicroserviceStatus removes entries matching predicate.

func (*ProcessManagerStatus) RemoveNotRunningMicroserviceStatus

func (p *ProcessManagerStatus) RemoveNotRunningMicroserviceStatus()

RemoveNotRunningMicroserviceStatus removes microservices that are not running

func (*ProcessManagerStatus) SetMicroservicesHealthStatus

func (p *ProcessManagerStatus) SetMicroservicesHealthStatus(microserviceUUID string, healthStatus *string) *ProcessManagerStatus

SetMicroservicesHealthStatus sets the health status for a microservice (e.g. "healthy", "unhealthy").

func (*ProcessManagerStatus) SetMicroservicesState

func (p *ProcessManagerStatus) SetMicroservicesState(microserviceUUID string, state MicroserviceState) *ProcessManagerStatus

SetMicroservicesState sets the state of a microservice and returns the status for chaining

func (*ProcessManagerStatus) SetMicroservicesStatePercentage

func (p *ProcessManagerStatus) SetMicroservicesStatePercentage(microserviceUUID string, percentage float32) *ProcessManagerStatus

SetMicroservicesStatePercentage sets the state percentage of a microservice and returns the status for chaining

func (*ProcessManagerStatus) SetMicroservicesStatus

func (p *ProcessManagerStatus) SetMicroservicesStatus(microserviceUUID string, status *MicroserviceStatus) *ProcessManagerStatus

SetMicroservicesStatus sets the status of a microservice and returns the status for chaining

func (*ProcessManagerStatus) SetMicroservicesStatusErrorMessage

func (p *ProcessManagerStatus) SetMicroservicesStatusErrorMessage(microserviceUUID string, message string) *ProcessManagerStatus

SetMicroservicesStatusErrorMessage sets the error message for a microservice and returns the status for chaining

func (*ProcessManagerStatus) SetRegistriesStatus

func (p *ProcessManagerStatus) SetRegistriesStatus(registryID int, status string) *ProcessManagerStatus

SetRegistriesStatus sets the status of a registry

func (*ProcessManagerStatus) SetRunningMicroservicesCount

func (p *ProcessManagerStatus) SetRunningMicroservicesCount(count int) *ProcessManagerStatus

SetRunningMicroservicesCount sets the running microservices count and returns the status for chaining

type ProfileConfig

type ProfileConfig struct {
	Properties map[string]string `json:"-" yaml:",inline"`
}

ProfileConfig represents a single profile's configuration Uses a map to store all properties for flexible YAML mapping

func NewProfileConfig

func NewProfileConfig() *ProfileConfig

NewProfileConfig creates a new ProfileConfig

func (*ProfileConfig) GetProperty

func (p *ProfileConfig) GetProperty(key string) string

GetProperty gets a property value

func (*ProfileConfig) MarshalYAML

func (p *ProfileConfig) MarshalYAML() (any, error)

MarshalYAML custom marshaling to output as map

func (*ProfileConfig) SetProperty

func (p *ProfileConfig) SetProperty(key, value string)

SetProperty sets a property value

func (*ProfileConfig) UnmarshalYAML

func (p *ProfileConfig) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML custom unmarshaling to handle flexible YAML structure

type RBACEnvelopeV1

type RBACEnvelopeV1 struct {
	Version      string                  `json:"version"`
	RulesByGroup map[string][]RBACRuleV1 `json:"rulesByGroup"`
}

type RBACRuleV1

type RBACRuleV1 struct {
	Resources     []string `json:"resources"`
	Verbs         []string `json:"verbs"`
	ResourceNames []string `json:"resourceNames,omitempty"`
}

func (RBACRuleV1) ToMap

func (r RBACRuleV1) ToMap() map[string]any

type Registry

type Registry struct {
	ID        int    `json:"id" yaml:"id"`
	URL       string `json:"url" yaml:"url"`
	IsPublic  bool   `json:"isPublic" yaml:"isPublic"`
	UserName  string `json:"userName,omitempty" yaml:"userName,omitempty"`
	Password  string `json:"password,omitempty" yaml:"password,omitempty"`
	UserEmail string `json:"userEmail,omitempty" yaml:"userEmail,omitempty"`
	Type      string `json:"type,omitempty" yaml:"type,omitempty"`
	CAB64     string `json:"ca,omitempty" yaml:"ca,omitempty"`
	Insecure  bool   `json:"insecure,omitempty" yaml:"insecure,omitempty"`
}

Registry represents Docker / Hugging Face registry configuration.

func BuiltInControllerRegistries added in v1.1.0

func BuiltInControllerRegistries() []*Registry

BuiltInControllerRegistries returns controller-table defaults (docker.io and from_cache). Hugging Face Hub is local-only.

func BuiltInLocalRegistries added in v1.1.0

func BuiltInLocalRegistries() []*Registry

BuiltInLocalRegistries returns the seeded local rows: public docker.io (oci), from_cache (oci), and public Hugging Face Hub (hf).

func NewRegistry

func NewRegistry(id int, url string, isPublic bool, userName, password, userEmail string) *Registry

NewRegistry creates a public or credentialed OCI registry. Type is oci, extra CA is empty, and insecure is false. Use RegistryBuilder when type, ca, or insecure must be set.

func (*Registry) Equals

func (r *Registry) Equals(other *Registry) bool

Equals checks if two Registries are equal

func (*Registry) NormalizeDefaults added in v1.1.0

func (r *Registry) NormalizeDefaults()

NormalizeDefaults applies Registry type default (oci) and trims identity fields.

func (*Registry) NormalizedType added in v1.1.0

func (r *Registry) NormalizedType() string

NormalizedType returns the effective registry type (oci when empty).

type RegistryBuilder

type RegistryBuilder struct {
	// contains filtered or unexported fields
}

RegistryBuilder is a builder for creating Registry instances

func NewRegistryBuilder

func NewRegistryBuilder() *RegistryBuilder

NewRegistryBuilder creates a new RegistryBuilder

func (*RegistryBuilder) Build

func (b *RegistryBuilder) Build() *Registry

Build creates a Registry from the builder

func (*RegistryBuilder) SetCAB64 added in v1.1.0

func (b *RegistryBuilder) SetCAB64(caB64 string) *RegistryBuilder

SetCAB64 sets the optional base64 PEM CA bundle.

func (*RegistryBuilder) SetID

func (b *RegistryBuilder) SetID(id int) *RegistryBuilder

SetID sets the registry ID

func (*RegistryBuilder) SetInsecure added in v1.1.0

func (b *RegistryBuilder) SetInsecure(insecure bool) *RegistryBuilder

SetInsecure sets whether HTTP / skipped TLS verify is allowed.

func (*RegistryBuilder) SetIsPublic

func (b *RegistryBuilder) SetIsPublic(isPublic bool) *RegistryBuilder

SetIsPublic sets whether the registry is public

func (*RegistryBuilder) SetPassword

func (b *RegistryBuilder) SetPassword(password string) *RegistryBuilder

SetPassword sets the registry password

func (*RegistryBuilder) SetType added in v1.1.0

func (b *RegistryBuilder) SetType(registryType string) *RegistryBuilder

SetType sets the registry type (oci or hf).

func (*RegistryBuilder) SetURL

func (b *RegistryBuilder) SetURL(url string) *RegistryBuilder

SetURL sets the registry URL

func (*RegistryBuilder) SetUserEmail

func (b *RegistryBuilder) SetUserEmail(userEmail string) *RegistryBuilder

SetUserEmail sets the registry user email

func (*RegistryBuilder) SetUserName

func (b *RegistryBuilder) SetUserName(userName string) *RegistryBuilder

SetUserName sets the registry username

type ResourceConsumptionManagerStatus

type ResourceConsumptionManagerStatus struct {
	AgentCPUPercent        float64 `json:"agentCpuPercent" yaml:"agentCpuPercent"`
	AgentMemoryMiB         float64 `json:"agentMemoryMiB" yaml:"agentMemoryMiB"`
	RuntimeCPUPercent      float64 `json:"runtimeCpuPercent" yaml:"runtimeCpuPercent"`
	RuntimeMemoryMiB       float64 `json:"runtimeMemoryMiB" yaml:"runtimeMemoryMiB"`
	RuntimeAvailable       bool    `json:"runtimeAvailable" yaml:"runtimeAvailable"`
	RuntimeDegraded        bool    `json:"runtimeDegraded" yaml:"runtimeDegraded"`
	RuntimeTracked         bool    `json:"runtimeTracked" yaml:"runtimeTracked"`
	RuntimePIDCount        int     `json:"runtimePidCount" yaml:"runtimePidCount"`
	EdgeletTotalCPUPercent float64 `json:"edgeletTotalCpuPercent" yaml:"edgeletTotalCpuPercent"`
	EdgeletTotalMemoryMiB  float64 `json:"edgeletTotalMemoryMiB" yaml:"edgeletTotalMemoryMiB"`

	MemoryUsage     float64 `json:"memoryUsage" yaml:"memoryUsage"`         // Edgelet stack memory in MiB (alias of EdgeletTotalMemoryMiB)
	DiskUsage       float64 `json:"diskUsage" yaml:"diskUsage"`             // Disk usage in GiB
	CPUUsage        float64 `json:"cpuUsage" yaml:"cpuUsage"`               // Edgelet stack CPU percent (alias of EdgeletTotalCPUPercent)
	MemoryViolation bool    `json:"memoryViolation" yaml:"memoryViolation"` // Whether memory limit is violated
	DiskViolation   bool    `json:"diskViolation" yaml:"diskViolation"`     // Whether disk limit is violated
	CPUViolation    bool    `json:"cpuViolation" yaml:"cpuViolation"`       // Whether CPU limit is violated
	AvailableMemory int64   `json:"availableMemory" yaml:"availableMemory"` // System available memory in bytes
	TotalCPU        float64 `json:"totalCpu" yaml:"totalCpu"`               // Host CPU usage percentage
	AvailableDisk   int64   `json:"availableDisk" yaml:"availableDisk"`     // System available disk space in bytes
	TotalDiskSpace  int64   `json:"totalDiskSpace" yaml:"totalDiskSpace"`   // Total system disk space in bytes
}

ResourceConsumptionManagerStatus represents the Resource Consumption Manager status. CPUUsage and MemoryUsage are edgelet stack totals (control plane + embedded runtime when available).

func NewResourceConsumptionManagerStatus

func NewResourceConsumptionManagerStatus() *ResourceConsumptionManagerStatus

NewResourceConsumptionManagerStatus creates a new ResourceConsumptionManagerStatus

func (*ResourceConsumptionManagerStatus) SetAvailableDisk

func (r *ResourceConsumptionManagerStatus) SetAvailableDisk(availableDisk int64) *ResourceConsumptionManagerStatus

SetAvailableDisk sets the available disk space and returns the status for chaining

func (*ResourceConsumptionManagerStatus) SetAvailableMemory

func (r *ResourceConsumptionManagerStatus) SetAvailableMemory(availableMemory int64) *ResourceConsumptionManagerStatus

SetAvailableMemory sets the available memory and returns the status for chaining

func (*ResourceConsumptionManagerStatus) SetCPUUsage

SetCPUUsage sets the CPU usage and returns the status for chaining

func (*ResourceConsumptionManagerStatus) SetCPUViolation

SetCPUViolation sets the CPU violation flag and returns the status for chaining

func (*ResourceConsumptionManagerStatus) SetDiskUsage

SetDiskUsage sets the disk usage and returns the status for chaining

func (*ResourceConsumptionManagerStatus) SetDiskViolation

SetDiskViolation sets the disk violation flag and returns the status for chaining

func (*ResourceConsumptionManagerStatus) SetMemoryUsage

SetMemoryUsage sets the memory usage and returns the status for chaining

func (*ResourceConsumptionManagerStatus) SetMemoryViolation

SetMemoryViolation sets the memory violation flag and returns the status for chaining

func (*ResourceConsumptionManagerStatus) SetTotalCPU

SetTotalCPU sets the total CPU usage and returns the status for chaining

func (*ResourceConsumptionManagerStatus) SetTotalDiskSpace

func (r *ResourceConsumptionManagerStatus) SetTotalDiskSpace(totalDiskSpace int64) *ResourceConsumptionManagerStatus

SetTotalDiskSpace sets the total disk space and returns the status for chaining

type Route

type Route struct {
	Receivers []string `json:"receivers" yaml:"receivers"`
}

Route represents microservice routings

func NewRoute

func NewRoute() *Route

NewRoute creates a new Route with empty receivers list

func (*Route) Equals

func (r *Route) Equals(other *Route) bool

Equals checks if two Routes are equal

func (*Route) SetReceivers

func (r *Route) SetReceivers(receivers []string)

SetReceivers sets the receivers list and sorts it

type RuntimeClassStatus added in v1.1.0

type RuntimeClassStatus struct {
	Name    string `json:"name"`
	Handler string `json:"handler"`
	Source  string `json:"source"`
}

RuntimeClassStatus is one applied RuntimeClass on fog and local status.

func (RuntimeClassStatus) Display added in v1.1.0

func (r RuntimeClassStatus) Display() string

Display renders the class as "name (handler, source)" for human status output.

type SSHProxyManagerStatus

type SSHProxyManagerStatus struct {
	ProxyStatus map[string]any `json:"proxyStatus" yaml:"proxyStatus"` // Proxy status information
}

SSHProxyManagerStatus represents the SSH Proxy Manager status

func NewSSHProxyManagerStatus

func NewSSHProxyManagerStatus() *SSHProxyManagerStatus

NewSSHProxyManagerStatus creates a new SSHProxyManagerStatus

func (*SSHProxyManagerStatus) GetJSONProxyStatus

func (s *SSHProxyManagerStatus) GetJSONProxyStatus() string

GetJSONProxyStatus returns the proxy status as a JSON string

func (*SSHProxyManagerStatus) SetConnectionStatus

func (s *SSHProxyManagerStatus) SetConnectionStatus(status string) *SSHProxyManagerStatus

SetConnectionStatus sets the connection status

func (*SSHProxyManagerStatus) SetErrorMessage

func (s *SSHProxyManagerStatus) SetErrorMessage(errMsg string) *SSHProxyManagerStatus

SetErrorMessage sets the error message

func (*SSHProxyManagerStatus) SetProxyConfig

func (s *SSHProxyManagerStatus) SetProxyConfig(username, host string, remotePort, localPort int) *SSHProxyManagerStatus

SetProxyConfig sets the proxy configuration

func (*SSHProxyManagerStatus) SetProxyStatus

func (s *SSHProxyManagerStatus) SetProxyStatus(status map[string]any) *SSHProxyManagerStatus

SetProxyStatus sets the proxy status and returns the status for chaining

type ServiceAccount

type ServiceAccount struct {
	Name    string                `json:"name" yaml:"name"`
	RoleRef ServiceAccountRoleRef `json:"roleRef" yaml:"roleRef"`
	Rules   []ServiceAccountRule  `json:"rules" yaml:"rules"`
}

func (*ServiceAccount) CanonicalRBACV1

func (sa *ServiceAccount) CanonicalRBACV1() RBACEnvelopeV1

type ServiceAccountRoleRef

type ServiceAccountRoleRef struct {
	Kind string `json:"kind" yaml:"kind"`
	Name string `json:"name" yaml:"name"`
}

type ServiceAccountRule

type ServiceAccountRule struct {
	APIGroups     []string `json:"apiGroups" yaml:"apiGroups"`
	Resources     []string `json:"resources" yaml:"resources"`
	Verbs         []string `json:"verbs" yaml:"verbs"`
	ResourceNames []string `json:"resourceNames,omitempty" yaml:"resourceNames,omitempty"`
}

func (ServiceAccountRule) ToRBACRuleV1

func (r ServiceAccountRule) ToRBACRuleV1() RBACRuleV1

type ServiceAccountToken

type ServiceAccountToken struct {
	ID                 string
	TokenUse           string
	PrincipalType      string
	Subject            string
	MicroserviceUUID   string
	ApplicationName    string
	ServiceAccountName string
	RoleRefKind        string
	RoleRefName        string
	RBACVersion        string
	RulesByGroupJSON   string
	ClaimsJSON         string
	Issuer             string
	Audience           string
	Alg                string
	JTI                string
	TokenSHA256        string
	IssuedAt           int64
	NotBefore          int64
	ExpiresAt          int64
	RevokedAt          *int64
	RotatedFromJTI     string
}

ServiceAccountToken represents persisted token metadata for EdgeletAPI v3.

type StatusReporterStatus

type StatusReporterStatus struct {
	SystemTime int64 `json:"systemTime" yaml:"systemTime"`
	LastUpdate int64 `json:"lastUpdate" yaml:"lastUpdate"`
}

StatusReporterStatus represents the Status Reporter status

func NewStatusReporterStatus

func NewStatusReporterStatus() *StatusReporterStatus

NewStatusReporterStatus creates a new StatusReporterStatus with current time

func NewStatusReporterStatusWithTimes

func NewStatusReporterStatusWithTimes(systemTime, lastUpdate int64) *StatusReporterStatus

NewStatusReporterStatusWithTimes creates a new StatusReporterStatus with specified times

func (*StatusReporterStatus) SetLastUpdate

func (s *StatusReporterStatus) SetLastUpdate(lastUpdate int64) *StatusReporterStatus

SetLastUpdate sets the last update time and returns the status for chaining

func (*StatusReporterStatus) SetSystemTime

func (s *StatusReporterStatus) SetSystemTime(systemTime int64) *StatusReporterStatus

SetSystemTime sets the system time and returns the status for chaining

type SupervisorStatus

type SupervisorStatus struct {
	DaemonStatus      ModuleStatus   `json:"daemonStatus" yaml:"daemonStatus"`           // Daemon status
	ModulesStatus     []ModuleStatus `json:"modulesStatus" yaml:"modulesStatus"`         // Status of each module
	DaemonLastStart   int64          `json:"daemonLastStart" yaml:"daemonLastStart"`     // Timestamp of last start
	OperationDuration int64          `json:"operationDuration" yaml:"operationDuration"` // Operating duration in milliseconds
	WarningMessage    string         `json:"warningMessage" yaml:"warningMessage"`       // Warning message
}

SupervisorStatus represents the Supervisor status

func NewSupervisorStatus

func NewSupervisorStatus(numModules int) *SupervisorStatus

NewSupervisorStatus creates a new SupervisorStatus with default values

func (*SupervisorStatus) GetModuleStatus

func (s *SupervisorStatus) GetModuleStatus(moduleIndex int) ModuleStatus

GetModuleStatus gets the status of a module

func (*SupervisorStatus) GetOperationDuration

func (s *SupervisorStatus) GetOperationDuration() int64

GetOperationDuration returns the operation duration (current time - last start)

func (*SupervisorStatus) SetDaemonLastStart

func (s *SupervisorStatus) SetDaemonLastStart(timestamp int64) *SupervisorStatus

SetDaemonLastStart sets the daemon last start time and returns the status for chaining

func (*SupervisorStatus) SetDaemonStatus

func (s *SupervisorStatus) SetDaemonStatus(status ModuleStatus) *SupervisorStatus

SetDaemonStatus sets the daemon status and returns the status for chaining

func (*SupervisorStatus) SetModuleStatus

func (s *SupervisorStatus) SetModuleStatus(moduleIndex int, status ModuleStatus) *SupervisorStatus

SetModuleStatus sets the status of a module and returns the status for chaining

func (*SupervisorStatus) SetOperationDuration

func (s *SupervisorStatus) SetOperationDuration(duration int64) *SupervisorStatus

SetOperationDuration sets the operation duration and returns the status for chaining

func (*SupervisorStatus) SetWarningMessage

func (s *SupervisorStatus) SetWarningMessage(message string) *SupervisorStatus

SetWarningMessage sets the warning message and returns the status for chaining

type TmpfsMount added in v1.1.0

type TmpfsMount struct {
	ContainerPath string `json:"containerPath" yaml:"containerPath"`
	Size          *int64 `json:"size,omitempty" yaml:"size,omitempty"`
	Mode          string `json:"mode,omitempty" yaml:"mode,omitempty"`
}

TmpfsMount is an in-memory filesystem mount inside the container. Size is MiB.

type Ulimit added in v1.1.0

type Ulimit struct {
	Soft int64 `json:"soft" yaml:"soft"`
	Hard int64 `json:"hard" yaml:"hard"`
}

Ulimit is a soft/hard resource limit. -1 means unlimited.

func (*Ulimit) UnmarshalJSON added in v1.1.0

func (u *Ulimit) UnmarshalJSON(data []byte) error

UnmarshalJSON rejects scalar ulimit values; only {soft,hard} is accepted.

func (*Ulimit) UnmarshalYAML added in v1.1.0

func (u *Ulimit) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML rejects scalar ulimit values; only {soft,hard} is accepted.

type ValidationError

type ValidationError struct {
	Field   string
	Message string
}

ValidationError represents a validation error with field information

func (*ValidationError) Error

func (e *ValidationError) Error() string

type VolumeMapping

type VolumeMapping struct {
	HostDestination      string            `json:"hostDestination" yaml:"hostDestination"`
	ContainerDestination string            `json:"containerDestination" yaml:"containerDestination"`
	AccessMode           string            `json:"accessMode" yaml:"accessMode"`
	Type                 VolumeMappingType `json:"type" yaml:"type"`
}

VolumeMapping represents microservice volume mappings for Docker run options

func NewVolumeMapping

func NewVolumeMapping(hostDestination, containerDestination, accessMode string, volumeType VolumeMappingType) *VolumeMapping

NewVolumeMapping creates a new VolumeMapping

func (*VolumeMapping) Equals

func (v *VolumeMapping) Equals(other *VolumeMapping) bool

Equals checks if two VolumeMappings are equal

type VolumeMappingType

type VolumeMappingType string

VolumeMappingType represents the type of volume mapping

const (
	VolumeMappingTypeVolume      VolumeMappingType = "VOLUME"
	VolumeMappingTypeBind        VolumeMappingType = "BIND"
	VolumeMappingTypeVolumeMount VolumeMappingType = "VOLUME_MOUNT"
)

type VolumeMountManagerStatus

type VolumeMountManagerStatus struct {
	ActiveMounts int64 `json:"activeMounts" yaml:"activeMounts"` // Number of active volume mounts
	LastUpdate   int64 `json:"lastUpdate" yaml:"lastUpdate"`     // Timestamp of last update
}

VolumeMountManagerStatus represents the Volume Mount Manager status

func NewVolumeMountManagerStatus

func NewVolumeMountManagerStatus() *VolumeMountManagerStatus

NewVolumeMountManagerStatus creates a new VolumeMountManagerStatus

func (*VolumeMountManagerStatus) SetActiveMounts

func (v *VolumeMountManagerStatus) SetActiveMounts(count int64) *VolumeMountManagerStatus

SetActiveMounts sets the active mounts count and returns the status for chaining

func (*VolumeMountManagerStatus) SetLastUpdate

func (v *VolumeMountManagerStatus) SetLastUpdate(timestamp int64) *VolumeMountManagerStatus

SetLastUpdate sets the last update time and returns the status for chaining

type YamlConfig

type YamlConfig struct {
	CurrentProfile string                    `json:"currentProfile" yaml:"currentProfile"`
	Profiles       map[string]*ProfileConfig `json:"profiles" yaml:"profiles"`
}

YamlConfig represents the root YAML configuration structure

func NewYamlConfig

func NewYamlConfig() *YamlConfig

NewYamlConfig creates a new YamlConfig

func (*YamlConfig) GetProfile

func (y *YamlConfig) GetProfile(name string) *ProfileConfig

GetProfile gets a profile by name

Jump to

Keyboard shortcuts

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