Documentation ¶
Overview ¶
Package spdk provides Go bindings for SPDK
Package spdk provides Go bindings for SPDK
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( FaultUnknown = spdkFault( code.SpdkUnknown, "unknown SPDK bindings error", "", ) FaultCtrlrNoHealth = spdkFault( code.SpdkCtrlrNoHealth, "NVMe controller details are missing health statistics", "", ) )
Functions ¶
func FaultBindingRetNull ¶
Types ¶
type Env ¶
type Env interface { InitSPDKEnv(logging.Logger, *EnvOptions) error FiniSPDKEnv(logging.Logger, *EnvOptions) }
Env is the interface that provides SPDK environment management.
type EnvImpl ¶
type EnvImpl struct{}
EnvImpl is a an implementation of the Env interface.
func (*EnvImpl) FiniSPDKEnv ¶
func (ei *EnvImpl) FiniSPDKEnv(log logging.Logger, opts *EnvOptions)
FiniSPDKEnv initializes the SPDK environment.
func (*EnvImpl) InitSPDKEnv ¶
func (ei *EnvImpl) InitSPDKEnv(log logging.Logger, opts *EnvOptions) error
InitSPDKEnv initializes the SPDK environment.
type EnvOptions ¶
type EnvOptions struct { PCIAllowList *hardware.PCIAddressSet // restrict SPDK device access EnableVMD bool // flag if VMD functionality should be enabled }
EnvOptions describe parameters to be used when initializing a processes SPDK environment.
type FormatResult ¶
FormatResult struct mirrors C.struct_wipe_res_t and describes the results of a format operation on an NVMe controller namespace.
type MockEnvCfg ¶
type MockEnvCfg struct {
InitErr error
}
MockEnvCfg controls the behavior of the MockEnvImpl.
type MockEnvImpl ¶
type MockEnvImpl struct { sync.RWMutex Cfg MockEnvCfg InitCalls []*EnvOptions FiniCalls []*EnvOptions }
MockEnvImpl is a mock implementation of the Env interface.
func (*MockEnvImpl) FiniSPDKEnv ¶
func (e *MockEnvImpl) FiniSPDKEnv(log logging.Logger, opts *EnvOptions)
FiniSPDKEnv finalizes the SPDK environment.
func (*MockEnvImpl) InitSPDKEnv ¶
func (e *MockEnvImpl) InitSPDKEnv(log logging.Logger, opts *EnvOptions) error
InitSPDKEnv initializes the SPDK environment.
type MockNvmeCfg ¶
type MockNvmeCfg struct { DiscoverCtrlrs storage.NvmeControllers DiscoverErr error FormatRes []*FormatResult FormatErr error UpdateErr error }
MockNvmeCfg controls the behavior of the MockNvmeImpl.
type MockNvmeImpl ¶
type MockNvmeImpl struct {
Cfg MockNvmeCfg
}
MockNvmeImpl is an implementation of the Nvme interface.
func (*MockNvmeImpl) Discover ¶
func (n *MockNvmeImpl) Discover(log logging.Logger) (storage.NvmeControllers, error)
Discover NVMe devices, including NVMe devices behind VMDs if enabled, accessible by SPDK on a given host.
func (*MockNvmeImpl) Format ¶
func (n *MockNvmeImpl) Format(log logging.Logger) ([]*FormatResult, error)
Format device at given pci address, destructive operation!
type Nvme ¶
type Nvme interface { // Discover NVMe controllers and namespaces, and device health info Discover(logging.Logger) (storage.NvmeControllers, error) // Format NVMe controller namespaces Format(logging.Logger) ([]*FormatResult, error) // Update updates the firmware on a specific PCI address and slot Update(log logging.Logger, ctrlrPciAddr string, path string, slot int32) error }
Nvme is the interface that provides SPDK NVMe functionality.