Documentation
¶
Overview ¶
Package mounts is the VM side of dynamic share mounts. An operator (e.g. a teacher) publishes a ShareMount on the event bus — to one VM, or via control-plane fan-out to a whole class of student VMs — and each VM applies it: mount on action "" / "mount", tear down on "unmount".
State is pushed whole and applied idempotently (replace-by-ID), so a missed message self-heals on the next publish — the same model pkg/mesh uses for WireGuard membership.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleMessage ¶
HandleMessage decodes a published mount update and applies it. Pure aside from the injected apply, so the decode/validate path is testable without a broker or a kernel.
Types ¶
type ApplyFunc ¶
type ApplyFunc func(pod.ShareMount) error
ApplyFunc mounts or unmounts one share according to spec.Action. The real implementation drives the CubeFS FUSE client (Linux); tests inject a stub.
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
Subscriber listens for this VM's share-mount updates and applies each one.
func NewSubscriber ¶
NewSubscriber builds a Subscriber for vmID that applies updates via apply.
func (*Subscriber) Start ¶
func (s *Subscriber) Start() (*nats.Subscription, error)
Start subscribes to the VM's mounts subject. The returned subscription is live until unsubscribed or the connection drops.