connectors

package
v0.0.0-...-8bf450a Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TypeUnknown represents an unknown storage connector.
	TypeUnknown string = "unknown"

	// TypeNVME represents an NVMe/TCP storage connector.
	TypeNVME string = "nvme"

	// TypeSDC represents Dell SDC storage connector.
	TypeSDC string = "sdc"

	// TypeISCSI represents an iSCSI storage connector.
	TypeISCSI string = "iscsi"
)
View Source
const (
	// NVMeDefaultDiscoveryPort is the default port number for NVMe/TCP discovery
	// controller.
	NVMeDefaultDiscoveryPort = "8009"

	// NVMeDefaultTransportPort is the default port number for NVMe/TCP I/O
	// controller.
	NVMeDefaultTransportPort = "4420"
)
View Source
const (
	// ISCSIDefaultPort is the default port number for iSCSI targets.
	ISCSIDefaultPort = "3260"
)
View Source
const (
	// SDCDevicePath represents the SDC device once the respective kernel module is loaded.
	SDCDevicePath = "/dev/scini"
)
View Source
const SubtypeNVMESubsys = "nvme subsystem"

SubtypeNVMESubsys defines an NVMe subsystem type (from https://github.com/linux-nvme/libnvme/blob/97886cb68d238ccbbed804a275851f63e490b22f/src/nvme/fabrics.c#L99).

Variables

View Source
var ErrNotSupported = errors.New("Not supported")

ErrNotSupported is the "Not supported" error.

Functions

func GetSupportedVersions

func GetSupportedVersions(connectorTypes []string) []string

GetSupportedVersions returns the versions for the given connector types ignoring those that produce an error when version is being retrieved (e.g. due to a missing required tools).

Types

type Connector

type Connector interface {
	Type() string
	Version() (string, error)
	QualifiedName() (string, error)
	LoadModules() error
	Connect(ctx context.Context, targetQN string, targetAddrs ...string) (revert.Hook, error)
	Disconnect(targetQN string) error
	Discover(ctx context.Context, targetAddresses ...string) ([]any, error)
	GetDiskDevicePath(diskPathFilter block.DevicePathFilterFunc) (string, error)
	WaitDiskDevicePath(ctx context.Context, diskPathFilter block.DevicePathFilterFunc) (string, error)
	WaitDiskDeviceResize(ctx context.Context, diskPath string, newSizeBytes int64) error
	RemoveDiskDevice(ctx context.Context, devicePath string) error
	// contains filtered or unexported methods
}

Connector represents a storage connector that handles connections through appropriate storage subsystem.

func NewConnector

func NewConnector(connectorType string, serverUUID string) (Connector, error)

NewConnector instantiates a new connector of the given type. The caller needs to ensure connector type is validated before calling this function, as common (empty) connector is returned for unknown type.

type ISCSIDiscoveryLogRecord

type ISCSIDiscoveryLogRecord struct {
	Address        string
	PortalGroupTag string
	IQN            string
}

ISCSIDiscoveryLogRecord represents an ISCSI discovery entry.

type NVMeDiscoveryLogRecord

type NVMeDiscoveryLogRecord struct {
	TransportType              string `json:"trtype"`
	AddressFamily              string `json:"adrfam"`
	TransportAddress           string `json:"traddr"`
	TransportServiceIdentifier string `json:"trsvcid"`
	SubType                    string `json:"subtype"`
	SubNQN                     string `json:"subnqn"`
}

NVMeDiscoveryLogRecord represents an NVMe discovery entry.

Jump to

Keyboard shortcuts

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