nvos

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultNVOSPort = 22

DefaultNVOSPort is the default SSH port.

Variables

This section is empty.

Functions

This section is empty.

Types

type NVOS

type NVOS struct {
	MAC        net.HardwareAddr       `json:"mac"`
	IP         net.IP                 `json:"ip"`
	Port       int                    `json:"port"` // Custom port (0 = default 22)
	Credential *credential.Credential `json:"credential"`
}

NVOS represents the NV-Switch Operating System subsystem of an NV-Switch tray. It has its own MAC address, IP address, port, and credentials for SSH access.

func New

func New(mac string, ip string, cred *credential.Credential) (*NVOS, error)

New creates a new NVOS instance by parsing MAC and IP from strings.

func NewFromAddr

func NewFromAddr(mac net.HardwareAddr, ip net.IP, cred *credential.Credential) (*NVOS, error)

NewFromAddr creates a new NVOS instance from native net types.

func (*NVOS) GetCredential

func (n *NVOS) GetCredential() *credential.Credential

GetCredential returns the NVOS credential or nil.

func (*NVOS) GetIP

func (n *NVOS) GetIP() net.IP

GetIP returns the NVOS IP address.

func (*NVOS) GetMAC

func (n *NVOS) GetMAC() net.HardwareAddr

GetMAC returns the NVOS MAC address.

func (*NVOS) GetPort

func (n *NVOS) GetPort() int

GetPort returns the effective port (custom or default 22).

func (*NVOS) SetCredential

func (n *NVOS) SetCredential(cred *credential.Credential)

SetCredential sets the NVOS credential.

func (*NVOS) SetIP

func (n *NVOS) SetIP(ip string) error

SetIP sets the NVOS IP address.

func (*NVOS) SetPort

func (n *NVOS) SetPort(port int)

SetPort sets a custom port for NVOS access.

Jump to

Keyboard shortcuts

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