Help us shape the future of Go! Take the 2026 Go Developer Survey

runtimeinventory

package
v0.55.8 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0, Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package runtimeinventory defines the dependency-free, secret-free Go wire model for reading Kombify runtime inventory.

Authority

The canonical Inventory schema in Techstack owns this model. This package owns its generated Go type identity and stable JSON field names.

Non-authority

This package does not own server identity, lifecycle transitions, desired state, lease state, provider operations, cleanup evidence, freshness policy, authorization, pagination behavior, or access-link derivation. Techstack is the production authority for those decisions and projections.

Side effects

The package contains data transfer objects only. It performs no I/O and has no side effects.

Persistence

The package does not persist inventory or cursor state.

Concurrency

Values contain no synchronization. Treat DTOs as immutable after publication and do not concurrently mutate shared slices or pointed-to timestamps.

Secrets

These DTOs intentionally expose no metadata bags, credential references, provider credentials, tokens, SSH material, route IDs, endpoint references, commands, or logs. Producers must sanitize all strings and access URLs before constructing a value.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessServiceLink struct {
	ServiceID   string `json:"service_id"`
	ServiceName string `json:"service_name"`
	URL         string `json:"url"`
	Mode        string `json:"mode"`
	Health      string `json:"health"`
}

AccessServiceLink is a reachable service link in a server access context.

type Addresses

type Addresses struct {
	PublicIPs  []string `json:"public_ips"`
	PrivateIPs []string `json:"private_ips"`
	LocalIPs   []string `json:"local_ips"`
	Domains    []string `json:"domains"`
}

Addresses contains sanitized network addresses and DNS names.

type Availability

type Availability struct {
	State      string `json:"state"`
	ReasonCode string `json:"reason_code,omitempty"`
}

Availability reports whether a sanitized access context is currently usable.

type Channel

type Channel struct {
	Type       string     `json:"type"`
	Role       string     `json:"role"`
	State      string     `json:"state"`
	ObservedAt *time.Time `json:"observed_at,omitempty"`
}

Channel is sanitized connection-channel state without an endpoint reference.

type CleanupProjection

type CleanupProjection struct {
	State                   string     `json:"state"`
	ProviderAbsenceVerified bool       `json:"provider_absence_verified"`
	VerifiedAt              *time.Time `json:"verified_at,omitempty"`
}

CleanupProjection reports evidence-qualified provider cleanup state.

type DesiredProjection

type DesiredProjection struct {
	State      string     `json:"state"`
	ReasonCode string     `json:"reason_code,omitempty"`
	ChangedAt  *time.Time `json:"changed_at,omitempty"`
}

DesiredProjection is the user-owned desired-state read projection.

type Freshness

type Freshness struct {
	State             string `json:"state"`
	AgeSeconds        *int64 `json:"age_seconds,omitempty"`
	StaleAfterSeconds int64  `json:"stale_after_seconds"`
	ReasonCode        string `json:"reason_code,omitempty"`
}

Freshness qualifies an observation using the owning authority's freshness policy.

type LeaseProjection

type LeaseProjection struct {
	ID    string `json:"id,omitempty"`
	State string `json:"state"`
}

LeaseProjection contains only an opaque runtime-lease identity and state.

type LifecycleProjection

type LifecycleProjection struct {
	State      string     `json:"state"`
	ReasonCode string     `json:"reason_code,omitempty"`
	ChangedAt  *time.Time `json:"changed_at,omitempty"`
}

LifecycleProjection is the control-plane lifecycle read projection.

type ObservedState

type ObservedState struct {
	State      string     `json:"state"`
	ReasonCode string     `json:"reason_code,omitempty"`
	ChangedAt  *time.Time `json:"changed_at,omitempty"`
	ObservedAt *time.Time `json:"observed_at,omitempty"`
}

ObservedState is a freshness-qualified runtime observation.

type Platform

type Platform struct {
	OS        string `json:"os,omitempty"`
	OSVersion string `json:"os_version,omitempty"`
	Arch      string `json:"arch,omitempty"`
}

Platform contains sanitized operating-system and architecture labels.

type ResourceMetric

type ResourceMetric struct {
	Status string   `json:"status"`
	Value  *float64 `json:"value,omitempty"`
	Unit   string   `json:"unit,omitempty"`
}

ResourceMetric is one heartbeat-observed resource figure. Status is ok with a value, stale when the heartbeat is outside the freshness window, or unknown when the server has not reported the figure.

type ResourceMetrics

type ResourceMetrics struct {
	CPUPercent    ResourceMetric `json:"cpu_percent"`
	MemoryPercent ResourceMetric `json:"memory_percent"`
	DiskPercent   ResourceMetric `json:"disk_percent"`
	UptimeSeconds ResourceMetric `json:"uptime_seconds"`
}

ResourceMetrics carries the freshness-qualified resource figures of one server.

type Server

type Server struct {
	ID                string              `json:"id"`
	StackID           string              `json:"stack_id,omitempty"`
	Name              string              `json:"name"`
	ObservedAt        *time.Time          `json:"observed_at"`
	Freshness         Freshness           `json:"freshness"`
	InventoryRevision int64               `json:"inventory_revision"`
	Addresses         Addresses           `json:"addresses"`
	Platform          Platform            `json:"platform"`
	StackKit          StackKit            `json:"stackkit"`
	Provider          string              `json:"provider,omitempty"`
	Lifecycle         LifecycleProjection `json:"lifecycle"`
	Desired           DesiredProjection   `json:"desired"`
	Lease             LeaseProjection     `json:"lease"`
	Cleanup           CleanupProjection   `json:"cleanup"`
	Connection        ObservedState       `json:"connection"`
	Health            ObservedState       `json:"health"`
	Metrics           ResourceMetrics     `json:"metrics"`
}

Server is the canonical secret-free runtime-server read model.

type ServerAccessContext

type ServerAccessContext struct {
	ServerID          string              `json:"server_id"`
	ObservedAt        *time.Time          `json:"observed_at"`
	Freshness         Freshness           `json:"freshness"`
	InventoryRevision int64               `json:"inventory_revision"`
	Availability      Availability        `json:"availability"`
	Connection        ObservedState       `json:"connection"`
	Addresses         Addresses           `json:"addresses"`
	Channels          []Channel           `json:"channels"`
	ServiceLinks      []AccessServiceLink `json:"service_links"`
}

ServerAccessContext contains sanitized connection and service-link data for an authorized operator.

type ServerHealth

type ServerHealth struct {
	ServerID          string          `json:"server_id"`
	ObservedAt        *time.Time      `json:"observed_at"`
	Freshness         Freshness       `json:"freshness"`
	InventoryRevision int64           `json:"inventory_revision"`
	Connection        ObservedState   `json:"connection"`
	Health            ObservedState   `json:"health"`
	Metrics           ResourceMetrics `json:"metrics"`
}

ServerHealth is the compact health projection for one server.

type ServerList

type ServerList struct {
	ObservedAt        time.Time `json:"observed_at"`
	Freshness         Freshness `json:"freshness"`
	InventoryRevision int64     `json:"inventory_revision"`
	CollectionCursor  string    `json:"collection_cursor"`
	NextCursor        string    `json:"next_cursor,omitempty"`
	PageSize          int       `json:"page_size"`
	Servers           []Server  `json:"servers"`
}

ServerList is one bounded server-collection page.

type Service

type Service struct {
	ID                string        `json:"id"`
	StackID           string        `json:"stack_id"`
	ServerID          string        `json:"server_id"`
	Key               string        `json:"key"`
	Name              string        `json:"name"`
	ManagementState   string        `json:"management_state,omitempty"`
	DesiredState      string        `json:"desired_state"`
	ObservedState     string        `json:"observed_state"`
	ObservedAt        *time.Time    `json:"observed_at"`
	Freshness         Freshness     `json:"freshness"`
	InventoryRevision int64         `json:"inventory_revision"`
	Health            ObservedState `json:"health"`
	StackKit          StackKit      `json:"stackkit"`
	Links             []ServiceLink `json:"links"`
	AllowedActions    []string      `json:"allowed_actions"`
	EvidenceRef       string        `json:"evidence_ref,omitempty"`
	Source            string        `json:"source"`
}

Service is the canonical secret-free runtime-service read model. ManagementState reports definition ownership: managed for a declared target, observed for discovery without one. An omitted value is unreported. It is independent of desired state, observed state, and health.

type ServiceLink struct {
	URL  string `json:"url"`
	Mode string `json:"mode"`
}

ServiceLink is a sanitized HTTP(S) access link without query or fragment secrets.

type ServiceList

type ServiceList struct {
	ObservedAt        time.Time `json:"observed_at"`
	Freshness         Freshness `json:"freshness"`
	InventoryRevision int64     `json:"inventory_revision"`
	CollectionCursor  string    `json:"collection_cursor"`
	NextCursor        string    `json:"next_cursor,omitempty"`
	PageSize          int       `json:"page_size"`
	Services          []Service `json:"services"`
}

ServiceList is one bounded service-collection page.

type StackKit

type StackKit struct {
	Name    string `json:"name,omitempty"`
	Version string `json:"version,omitempty"`
	Variant string `json:"variant,omitempty"`
}

StackKit identifies the observed StackKit without configuration or secrets.

Jump to

Keyboard shortcuts

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