Documentation
¶
Overview ¶
Package spdk provides Go bindings for SPDK
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Controller ¶
Controller struct mirrors C.struct_ctrlr_t and describes a NVMe controller.
TODO: populate implicitly using inner member: +inner C.struct_ctrlr_t
type DeviceHealth ¶
type DeviceHealth struct {
Temp uint32
TempWarnTime uint32
TempCritTime uint32
CtrlBusyTime uint64
PowerCycles uint64
PowerOnHours uint64
UnsafeShutdowns uint64
MediaErrors uint64
ErrorLogEntries uint64
TempWarn bool
AvailSpareWarn bool
ReliabilityWarn bool
ReadOnlyWarn bool
VolatileWarn bool
CtrlrPciAddr string
}
DeviceHealth struct mirrors C.struct_dev_health_t and describes the raw SPDK device health stats of a controller (NVMe SSD).
type Env ¶
type Env struct{}
Env is a simple ENV implementation.
func (*Env) InitSPDKEnv ¶
InitSPDKEnv initializes the SPDK environment.
SPDK relies on an abstraction around the local environment named env that handles memory allocation and PCI device operations. The library must be initialized first.
type NVME ¶
type NVME interface {
// Discover NVMe controllers and namespaces, and device health info
Discover() ([]Controller, []Namespace, []DeviceHealth, error)
// Format NVMe controller namespaces
Format(ctrlrPciAddr string) ([]Controller, []Namespace, error)
// Cleanup NVMe object references
Cleanup()
}
NVME is the interface that provides SPDK NVMe functionality.
type Namespace ¶
Namespace struct mirrors C.struct_ns_t and describes a NVMe Namespace tied to a controller.
TODO: populate implicitly using inner member: +inner C.struct_ns_t
type Nvme ¶
type Nvme struct{}
Nvme is an NVME interface implementation.
func (*Nvme) Cleanup ¶
func (n *Nvme) Cleanup()
Cleanup unlinks and detaches any controllers or namespaces, as well as cleans up optional device health information.
func (*Nvme) Discover ¶
func (n *Nvme) Discover() ([]Controller, []Namespace, []DeviceHealth, error)
Discover calls C.nvme_discover which returns pointers to single linked list of ctrlr_t, ns_t and dev_health_t structs. These are converted to slices of Controller, Namespace and DeviceHealth structs.