Documentation
¶
Overview ¶
Package microvm provides the root module's thin UDS adapter for microvmd. It deliberately duplicates only the versioned JSON wire shapes and does not import the nested runtime module.
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) Bind(ctx context.Context, request server.PlacementBindRequest) (server.PlacementBinding, error)
- func (c *Client) DaemonInfo(ctx context.Context) (DaemonInfo, error)
- func (c *Client) Delete(ctx context.Context, sess *session.Session) error
- func (c *Client) DeleteGeneration(ctx context.Context, claim GenerationBinding) (DeleteResult, error)
- func (c *Client) DeletePlacement(ctx context.Context, request server.PlacementDeleteRequest) (server.PlacementDeleteResult, error)
- func (c *Client) Fork(ctx context.Context, base tool.Environment, label string) (tool.Environment, func() error, string, error)
- func (c *Client) Inventory(ctx context.Context, owner string, requests ...InventoryRequest) (InventoryPage, error)
- func (c *Client) LifecycleMetrics(ctx context.Context) (LifecycleMetrics, error)
- func (c *Client) Merge(ctx context.Context, child, parent tool.Environment) error
- func (c *Client) Reattach(ctx context.Context, request server.PlacementReattachRequest) (server.PlacementBinding, error)
- func (c *Client) ShutdownDaemon(ctx context.Context, expected DaemonInfo) error
- type DaemonInfo
- type DeleteResult
- type GenerationBinding
- type GenerationHealth
- type InventoryEntry
- type InventoryPage
- type InventoryRequest
- type LifecycleMetrics
Constants ¶
const ( // DaemonProtocolVersion is the exact local management protocol spoken by this client. DaemonProtocolVersion uint16 = 4 )
Variables ¶
var (
)
ErrRepositoryLogicalRootUnavailable is returned when an authenticated guest cannot attach the prepared repository worktree. It carries no daemon detail.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client speaks the authenticated local management protocol. Authentication is performed by microvmd from kernel peer credentials before it decodes a frame.
func NewPlacementProvider ¶
func NewPlacementProvider(endpoint, sourceCheckout, profile string, scope server.PlacementScope, readiness func(context.Context) error) (*Client, error)
NewPlacementProvider constructs a deployment-owned microVM default placement.
func (*Client) Bind ¶
func (c *Client) Bind(ctx context.Context, request server.PlacementBindRequest) (server.PlacementBinding, error)
Bind provisions either the trusted deployment default or explicit no-FS attenuation.
func (*Client) DaemonInfo ¶
func (c *Client) DaemonInfo(ctx context.Context) (DaemonInfo, error)
DaemonInfo queries the serving process over the kernel-authenticated Unix socket.
func (*Client) DeleteGeneration ¶
func (c *Client) DeleteGeneration(ctx context.Context, claim GenerationBinding) (DeleteResult, error)
DeleteGeneration permanently deletes one exact owner/session/ref/generation binding.
func (*Client) DeletePlacement ¶
func (c *Client) DeletePlacement(ctx context.Context, request server.PlacementDeleteRequest) (server.PlacementDeleteResult, error)
DeletePlacement removes one exact schedule-owned logical attachment. The server receives only whether dirty state was retained; daemon paths stay private to the adapter.
func (*Client) Fork ¶
func (c *Client) Fork(ctx context.Context, base tool.Environment, label string) (tool.Environment, func() error, string, error)
Fork asks microvmd to create a complete isolated child generation.
func (*Client) Inventory ¶
func (c *Client) Inventory(ctx context.Context, owner string, requests ...InventoryRequest) (InventoryPage, error)
Inventory retrieves one bounded inventory page visible to owner.
func (*Client) LifecycleMetrics ¶
func (c *Client) LifecycleMetrics(ctx context.Context) (LifecycleMetrics, error)
LifecycleMetrics retrieves the current daemon lifecycle counters without binding the request to one environment generation.
func (*Client) Reattach ¶
func (c *Client) Reattach(ctx context.Context, request server.PlacementReattachRequest) (server.PlacementBinding, error)
Reattach restores only the exact persisted microVM generation.
func (*Client) ShutdownDaemon ¶
func (c *Client) ShutdownDaemon(ctx context.Context, expected DaemonInfo) error
ShutdownDaemon asks the exact authenticated daemon identity to stop gracefully. It is an internal manager operation, not a placement or user administration API.
type DaemonInfo ¶
type DaemonInfo struct {
ProtocolVersion uint16 `json:"protocol_version"`
ReleaseIdentity string `json:"release_identity"`
BinaryIdentity string `json:"binary_identity"`
ConfigDigest string `json:"config_digest"`
PolicyRevision string `json:"policy_revision"`
Profiles []string `json:"profiles"`
Socket string `json:"socket"`
}
DaemonInfo is the authenticated identity of the process serving the configured socket.
func (DaemonInfo) Equal ¶
func (d DaemonInfo) Equal(other DaemonInfo) bool
Equal reports an exact daemon compatibility match.
type DeleteResult ¶
type DeleteResult struct {
WorktreePath string `json:"worktree_path"`
WorktreeRetained bool `json:"worktree_retained"`
}
DeleteResult reports clean removal or the retained dirty worktree.
type GenerationBinding ¶
type GenerationBinding struct {
Owner string `json:"owner"`
SessionID string `json:"session_id"`
EnvironmentID string `json:"environment_id"`
Ref string `json:"ref"`
Generation uint32 `json:"generation"`
}
GenerationBinding binds a destructive operation to one exact owner generation.
type GenerationHealth ¶
type GenerationHealth string
GenerationHealth is microvmd's bounded operator health classification.
const ( // GenerationHealthy means the daemon verified the exact live runtime identity. GenerationHealthy GenerationHealth = "healthy" // GenerationStale means the durable generation is not currently reattachable. GenerationStale GenerationHealth = "stale" // GenerationError means the runtime health probe itself failed. GenerationError GenerationHealth = "error" )
type InventoryEntry ¶
type InventoryEntry struct {
Owner string `json:"owner"`
SessionID string `json:"session_id"`
EnvironmentID string `json:"environment_id"`
Ref string `json:"ref"`
WorktreePath string `json:"worktree_path"`
Generation uint32 `json:"generation"`
State string `json:"state"`
Health GenerationHealth `json:"health"`
Error string `json:"error,omitempty"`
}
InventoryEntry is one owner-filtered exact daemon generation.
type InventoryPage ¶
type InventoryPage struct {
Entries []InventoryEntry `json:"entries"`
Continuation string `json:"continuation,omitempty"`
}
InventoryPage carries one bounded inventory page and its opaque continuation.
type InventoryRequest ¶
type InventoryRequest struct {
PageSize int `json:"page_size,omitempty"`
Continuation string `json:"continuation,omitempty"`
}
InventoryRequest asks for one bounded owner-scoped page.
type LifecycleMetrics ¶
type LifecycleMetrics struct {
EgressDenials uint64
}
LifecycleMetrics is the bounded operator snapshot exposed by microvmd. The root adapter projects only counters needed by host-side operational checks.