Documentation
¶
Index ¶
- Constants
- func CheckAgentCompatibility(agent AgentCompatibility, requirements CompatibilityRequirements) error
- func CheckOrchestratorCompatibility(agent AgentCompatibility, serverVersion string) error
- func DeterministicMAC(resourceID string) (string, error)
- func ErrorCode(err error) string
- func GuestAddress(prefix netip.Prefix, offset int) (netip.Addr, error)
- func LinuxStaticNetworkBootstrapScript(ip string, prefixLength int, gateway, mac string, dns []string) (string, error)
- func LinuxStaticNetworkConfig(ip string, prefixLength int, gateway, mac string, dns []string) (string, error)
- func NormalizeHostAlias(value string) (string, error)
- func NormalizeHumanPrefix(value string) string
- func ParseDNSServers(data string) ([]string, error)
- func PhysicalName(humanPrefix, immutableID string, maxLength int) (string, error)
- func PrivateGateway(prefix netip.Prefix) netip.Addr
- func PrivateSubnet(index int) (netip.Prefix, error)
- func SubnetIndexFromCIDR(cidr string) (int, error)
- func ValidateBootstrapPolicy(requirement string, natEnabled, knownNetworkBootstrap, domainJoin bool, ...) error
- func ValidatePhysicalName(value string, maxLength int) error
- func WindowsStaticNetworkScript(ip string, prefixLength int, gateway, mac string, dns []string) (string, error)
- type AgentCompatibility
- type ApplianceClient
- type ApplianceRPCClient
- func (c *ApplianceRPCClient) CheckReadiness(ctx context.Context, orchestratorID string) (ApplianceReadiness, error)
- func (c *ApplianceRPCClient) ConfigureStatic(ctx context.Context, orchestratorID string, config appliance.StaticConfig, ...) (ApplianceSnapshot, error)
- func (c *ApplianceRPCClient) GetRelayStats(ctx context.Context, orchestratorID, relayID string) (appliance.RelayStats, error)
- func (c *ApplianceRPCClient) InspectApplianceState(ctx context.Context, orchestratorID string) (ApplianceSnapshot, error)
- func (c *ApplianceRPCClient) ValidateRelay(ctx context.Context, orchestratorID, relayID string, probeTarget bool) (RelayValidation, error)
- type ApplianceReadiness
- type ApplianceSnapshot
- type Capability
- type CompatibilityError
- type CompatibilityRequirements
- type DomainError
- type HostIdentityChangedError
- type HostReference
- type NetworkID
- type NetworkPhysicalNames
- type OperationID
- type OrchestratorID
- type OrchestratorPhysicalNames
- type PhysicalHostID
- type PhysicalHostIdentity
- type ProtocolRange
- type ReachableService
- type RelayID
- type RelayValidation
- type RouteConflictObservation
- type RouteObservation
- type VMID
- type VMPhysicalNames
Constants ¶
View Source
const ( CapabilityApplianceV1 Capability = "isolated.appliance.v1" CapabilityNetworkV1 Capability = "isolated.network.v1" CapabilityRelayV1 Capability = "isolated.relay.v1" CapabilityNATV1 Capability = "isolated.nat.v1" CapabilityStatsV1 Capability = "isolated.stats.v1" CapabilityStaticConfigV1 Capability = "isolated.static-config.v1" MinimumProtocolVersion uint32 = 3 MaximumProtocolVersion uint32 = 3 )
View Source
const ( BootstrapNetworkNone = "none" BootstrapNetworkPreStaged = "pre_staged" BootstrapNetworkNAT = "nat_enabled" )
View Source
const ( MaxPhysicalNameLength = 63 MaxWindowsNodeNameLength = 15 )
View Source
const ( PrivateNetworkPrefixBits = 26 PrivateSubnetCount = 1 << (PrivateNetworkPrefixBits - 20) FirstGuestAddressOffset = 10 LastGuestAddressOffset = 62 MaxNetworksPerOrchestrator = 16 MaxVMsPerOrchestrator = 100 )
View Source
const ( MinimumApplianceSchema uint32 = 5 MaximumApplianceSchema uint32 = 5 )
View Source
const PhysicalHostIdentityVersion = "lablink-physical-host/v1"
View Source
const ShortIDLength = 12
Variables ¶
This section is empty.
Functions ¶
func CheckAgentCompatibility ¶
func CheckAgentCompatibility( agent AgentCompatibility, requirements CompatibilityRequirements, ) error
func CheckOrchestratorCompatibility ¶
func CheckOrchestratorCompatibility(agent AgentCompatibility, serverVersion string) error
func DeterministicMAC ¶
func NormalizeHostAlias ¶
func NormalizeHumanPrefix ¶
func ParseDNSServers ¶
func PhysicalName ¶
func SubnetIndexFromCIDR ¶
func ValidateBootstrapPolicy ¶
func ValidateBootstrapPolicy( requirement string, natEnabled, knownNetworkBootstrap, domainJoin bool, services []ReachableService, ) error
func ValidatePhysicalName ¶
Types ¶
type AgentCompatibility ¶
type ApplianceClient ¶
type ApplianceClient interface {
CheckReadiness(context.Context, string) (ApplianceReadiness, error)
InspectApplianceState(context.Context, string) (ApplianceSnapshot, error)
ConfigureStatic(
context.Context,
string,
appliance.StaticConfig,
[]appliance.RetiredNAT,
) (ApplianceSnapshot, error)
GetRelayStats(context.Context, string, string) (appliance.RelayStats, error)
ValidateRelay(context.Context, string, string, bool) (RelayValidation, error)
}
type ApplianceRPCClient ¶
type ApplianceRPCClient struct {
// contains filtered or unexported fields
}
func NewApplianceClient ¶
func NewApplianceClient( reg *registry.Registry, pool *agentclient.Pool, serverVersion string, ) *ApplianceRPCClient
func NewApplianceRPCClient ¶
func NewApplianceRPCClient( reg applianceNodeRegistry, pool applianceClientPool, serverVersion string, ) *ApplianceRPCClient
func (*ApplianceRPCClient) CheckReadiness ¶
func (c *ApplianceRPCClient) CheckReadiness( ctx context.Context, orchestratorID string, ) (ApplianceReadiness, error)
func (*ApplianceRPCClient) ConfigureStatic ¶
func (c *ApplianceRPCClient) ConfigureStatic( ctx context.Context, orchestratorID string, config appliance.StaticConfig, retire []appliance.RetiredNAT, ) (ApplianceSnapshot, error)
func (*ApplianceRPCClient) GetRelayStats ¶
func (c *ApplianceRPCClient) GetRelayStats( ctx context.Context, orchestratorID, relayID string, ) (appliance.RelayStats, error)
func (*ApplianceRPCClient) InspectApplianceState ¶
func (c *ApplianceRPCClient) InspectApplianceState( ctx context.Context, orchestratorID string, ) (ApplianceSnapshot, error)
func (*ApplianceRPCClient) ValidateRelay ¶
func (c *ApplianceRPCClient) ValidateRelay( ctx context.Context, orchestratorID, relayID string, probeTarget bool, ) (RelayValidation, error)
type ApplianceReadiness ¶
type ApplianceSnapshot ¶
type Capability ¶
type Capability string
func RequiredOrchestratorCapabilities ¶
func RequiredOrchestratorCapabilities() []Capability
type CompatibilityError ¶
type CompatibilityError struct {
Code string
Node string
AgentVersion string
ServerVersion string
MissingCapabilities []Capability
ProtocolVersion uint32
SupportedProtocol ProtocolRange
}
func (*CompatibilityError) Error ¶
func (e *CompatibilityError) Error() string
type CompatibilityRequirements ¶
type CompatibilityRequirements struct {
Capabilities []Capability
ProtocolRange ProtocolRange
ServerVersion string
}
func OrchestratorCompatibilityRequirements ¶
func OrchestratorCompatibilityRequirements(serverVersion string) CompatibilityRequirements
func (CompatibilityRequirements) Validate ¶
func (r CompatibilityRequirements) Validate() error
type DomainError ¶
func (*DomainError) Error ¶
func (e *DomainError) Error() string
type HostIdentityChangedError ¶
type HostIdentityChangedError struct {
Alias string
Expected PhysicalHostID
Observed PhysicalHostID
}
func (*HostIdentityChangedError) Error ¶
func (e *HostIdentityChangedError) Error() string
type HostReference ¶
type HostReference struct {
Alias string
PhysicalID PhysicalHostID
}
func NewHostReference ¶
func NewHostReference(alias string, physicalID PhysicalHostID) (HostReference, error)
func (HostReference) CanonicalKey ¶
func (r HostReference) CanonicalKey() string
func (HostReference) SamePhysicalHost ¶
func (r HostReference) SamePhysicalHost(other HostReference) bool
func (HostReference) Validate ¶
func (r HostReference) Validate() error
func (HostReference) VerifyObserved ¶
func (r HostReference) VerifyObserved(observed PhysicalHostID) error
type NetworkPhysicalNames ¶
func NetworkNames ¶
func NetworkNames(id NetworkID) (NetworkPhysicalNames, error)
type OperationID ¶
type OperationID string
func NewOperationID ¶
func NewOperationID() (OperationID, error)
func ParseOperationID ¶
func ParseOperationID(value string) (OperationID, error)
func (OperationID) Short ¶
func (id OperationID) Short() string
func (OperationID) String ¶
func (id OperationID) String() string
func (OperationID) Validate ¶
func (id OperationID) Validate() error
type OrchestratorID ¶
type OrchestratorID string
func NewOrchestratorID ¶
func NewOrchestratorID() (OrchestratorID, error)
func ParseOrchestratorID ¶
func ParseOrchestratorID(value string) (OrchestratorID, error)
func (OrchestratorID) Short ¶
func (id OrchestratorID) Short() string
func (OrchestratorID) String ¶
func (id OrchestratorID) String() string
func (OrchestratorID) Validate ¶
func (id OrchestratorID) Validate() error
type OrchestratorPhysicalNames ¶
func OrchestratorNames ¶
func OrchestratorNames(id OrchestratorID) (OrchestratorPhysicalNames, error)
type PhysicalHostID ¶
type PhysicalHostID string
func ParsePhysicalHostID ¶
func ParsePhysicalHostID(value string) (PhysicalHostID, error)
func (PhysicalHostID) String ¶
func (id PhysicalHostID) String() string
func (PhysicalHostID) Validate ¶
func (id PhysicalHostID) Validate() error
type PhysicalHostIdentity ¶
type PhysicalHostIdentity struct {
MachineGUID string
SMBIOSUUID string
ID PhysicalHostID
}
func DerivePhysicalHostIdentity ¶
func DerivePhysicalHostIdentity(machineGUID, smbiosUUID string) (PhysicalHostIdentity, error)
type ProtocolRange ¶
func (ProtocolRange) Contains ¶
func (r ProtocolRange) Contains(version uint32) bool
func (ProtocolRange) Validate ¶
func (r ProtocolRange) Validate() error
type ReachableService ¶
type RelayValidation ¶
type RouteConflictObservation ¶
type RouteConflictObservation struct {
Candidate netip.Prefix
Route RouteObservation
}
func FindPrivateRouteConflicts ¶
func FindPrivateRouteConflicts( candidate netip.Prefix, routes []RouteObservation, ) []RouteConflictObservation
type RouteObservation ¶
type VMPhysicalNames ¶
func VMNames ¶
func VMNames(id VMID) (VMPhysicalNames, error)
Click to show internal directories.
Click to hide internal directories.