diff --git a/internal/node/nodeproxy.go b/internal/node/nodeproxy.go index 8479d0fb..675ff4c0 100644 --- a/internal/node/nodeproxy.go +++ b/internal/node/nodeproxy.go @@ -4,6 +4,7 @@ import ( "log/slog" "github.com/nats-io/nats-server/v2/server" + "github.com/nats-io/nats.go" ) // Use this proxy object with extreme care, as it exposes @@ -38,6 +39,43 @@ func (n *NodeProxy) InternalNATS() *server.Server { return n.n.natsint } +func (n *NodeProxy) InternalNATSConn() *nats.Conn { + return n.n.ncint +} + func (n *NodeProxy) Telemetry() *Telemetry { return n.n.telemetry } + +type MachineManagerProxy struct { + m *MachineManager +} + +func NewMachineManagerProxyWith(manager *MachineManager) *MachineManagerProxy { + return &MachineManagerProxy{m: manager} +} + +func (m *MachineManagerProxy) Log() *slog.Logger { + return m.m.log +} + +func (m *MachineManagerProxy) NodeConfiguration() *NodeConfiguration { + return m.m.config +} + +func (m *MachineManagerProxy) InternalNATSConn() *nats.Conn { + return m.m.ncInternal +} + +func (m *MachineManagerProxy) Telemetry() *Telemetry { + return m.m.t +} + +func (m *MachineManagerProxy) VMs() map[string]*runningFirecracker { + return m.m.allVms +} + +func (m *MachineManagerProxy) PoolVMs() chan *runningFirecracker { + return m.m.warmVms +} +