isolatedstate

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentSchemaVersion = 1

Variables

This section is empty.

Functions

func DefaultDBPath

func DefaultDBPath() string

Types

type GuestOS

type GuestOS string
const (
	GuestWindows GuestOS = "windows"
	GuestLinux   GuestOS = "linux"
)

type IsolatedVM

type IsolatedVM struct {
	ID              string
	OrchestratorID  string
	NetworkID       string
	DisplayName     string
	HyperVName      string
	HyperVVMID      *string
	HyperVAdapterID *string
	NodeName        string
	GuestOS         GuestOS
	ProfileName     string
	IPv4            string
	MAC             string
	PrefixLength    int
	GatewayIPv4     string
	DNSServersJSON  string
	StorageRoot     string
	VMPath          string
	VHDPath         string
	LifecycleState  VMLifecycleState
	CreatedAt       UnixSeconds
	UpdatedAt       UnixSeconds
	RetiredAt       *UnixSeconds
}

type NATAllocation

type NATAllocation struct {
	VMID           string
	OrchestratorID string
	State          NATState
	ConntrackMark  int64
	UpdatedAt      UnixSeconds
}

type NATState

type NATState string
const (
	NATEnabled  NATState = "enabled"
	NATDisabled NATState = "disabled"
)

type NetworkLifecycleState

type NetworkLifecycleState string
const (
	NetworkCreating NetworkLifecycleState = "creating"
	NetworkReady    NetworkLifecycleState = "ready"
	NetworkDegraded NetworkLifecycleState = "degraded"
	NetworkDeleting NetworkLifecycleState = "deleting"
	NetworkDeleted  NetworkLifecycleState = "deleted"
)

type Orchestrator

type Orchestrator struct {
	ID              string
	DisplayName     string
	PhysicalHostID  string
	HostNode        string
	HyperVName      string
	HyperVVMID      *string
	NodeName        string
	ProfileName     string
	MainVSwitch     string
	MainMAC         *string
	MainIP          *string
	AgentPort       int
	ApplianceSchema int
	LifecycleState  OrchestratorLifecycleState
	HealthState     string
	MaxNetworks     int
	MaxVMs          int
	CreatedAt       UnixSeconds
	UpdatedAt       UnixSeconds
	LastSeenAt      *UnixSeconds
}

type OrchestratorLifecycleState

type OrchestratorLifecycleState string
const (
	OrchestratorCreating OrchestratorLifecycleState = "creating"
	OrchestratorReady    OrchestratorLifecycleState = "ready"
	OrchestratorDegraded OrchestratorLifecycleState = "degraded"
	OrchestratorDeleting OrchestratorLifecycleState = "deleting"
	OrchestratorDeleted  OrchestratorLifecycleState = "deleted"
)

type PrivateNetwork

type PrivateNetwork struct {
	ID                    string
	OrchestratorID        string
	DisplayName           string
	HyperVSwitchName      string
	HyperVSwitchGUID      *string
	OrchestratorAdapterID *string
	SubnetIndex           int
	CIDR                  string
	GatewayIPv4           string
	OrchestratorMAC       string
	DNSServersJSON        string
	LifecycleState        NetworkLifecycleState
	CreatedAt             UnixSeconds
	UpdatedAt             UnixSeconds
	RetiredAt             *UnixSeconds
}

type RelayAllocation

type RelayAllocation struct {
	ID             string
	VMID           string
	OrchestratorID string
	ListenPort     int
	TargetIPv4     string
	TargetPort     int
	LifecycleState RelayLifecycleState
	CreatedAt      UnixSeconds
	UpdatedAt      UnixSeconds
	RetiredAt      *UnixSeconds
}

type RelayLifecycleState

type RelayLifecycleState string
const (
	RelayReady    RelayLifecycleState = "ready"
	RelayDegraded RelayLifecycleState = "degraded"
	RelayRemoving RelayLifecycleState = "removing"
	RelayRemoved  RelayLifecycleState = "removed"
)

type Store

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

func Open

func Open(path string) (*Store, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) CountActiveVMs

func (s *Store) CountActiveVMs(ctx context.Context, networkID string) (int, error)

func (*Store) GetNAT

func (s *Store) GetNAT(ctx context.Context, vmID string) (NATAllocation, error)

func (*Store) GetNetwork

func (s *Store) GetNetwork(ctx context.Context, id string) (PrivateNetwork, error)

func (*Store) GetOrchestrator

func (s *Store) GetOrchestrator(ctx context.Context, id string) (Orchestrator, error)

func (*Store) GetRelay

func (s *Store) GetRelay(ctx context.Context, id string) (RelayAllocation, error)

func (*Store) GetRelayForVM

func (s *Store) GetRelayForVM(ctx context.Context, id string) (RelayAllocation, error)

func (*Store) GetVM

func (s *Store) GetVM(ctx context.Context, id string) (IsolatedVM, error)

func (*Store) ListNAT

func (s *Store) ListNAT(ctx context.Context, orchestratorID, networkID, state string) ([]NATAllocation, error)

func (*Store) ListNetworks

func (s *Store) ListNetworks(ctx context.Context, orchestratorID string) ([]PrivateNetwork, error)

func (*Store) ListOrchestrators

func (s *Store) ListOrchestrators(ctx context.Context, host string) ([]Orchestrator, error)

func (*Store) ListRelays

func (s *Store) ListRelays(ctx context.Context, orchestratorID, vmID string) ([]RelayAllocation, error)

func (*Store) ListVMs

func (s *Store) ListVMs(ctx context.Context, orchestratorID, networkID string) ([]IsolatedVM, error)

func (*Store) Path

func (s *Store) Path() string

func (*Store) PutNAT

func (s *Store) PutNAT(ctx context.Context, v NATAllocation) error

func (*Store) PutNetwork

func (s *Store) PutNetwork(ctx context.Context, v PrivateNetwork) error

func (*Store) PutOrchestrator

func (s *Store) PutOrchestrator(ctx context.Context, v Orchestrator) error

func (*Store) PutRelay

func (s *Store) PutRelay(ctx context.Context, v RelayAllocation) error

func (*Store) PutVM

func (s *Store) PutVM(ctx context.Context, v IsolatedVM) error

func (*Store) QueryContext

func (s *Store) QueryContext(
	ctx context.Context,
	query string,
	args ...any,
) (*sql.Rows, error)

func (*Store) SchemaVersion

func (s *Store) SchemaVersion(ctx context.Context) (int, error)

type UnixSeconds

type UnixSeconds int64

type VMLifecycleState

type VMLifecycleState string
const (
	VMCreating     VMLifecycleState = "creating"
	VMProvisioning VMLifecycleState = "provisioning"
	VMReady        VMLifecycleState = "ready"
	VMDegraded     VMLifecycleState = "degraded"
	VMDeleting     VMLifecycleState = "deleting"
	VMDeleted      VMLifecycleState = "deleted"
)

Jump to

Keyboard shortcuts

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