Documentation
¶
Index ¶
- type Interface
- type InterfaceMock
- type Option
- func WithDeviceIDStrategy(strategy string) Option
- func WithDriverRoot(root string) Option
- func WithEnabled(enabled bool) Option
- func WithGdsEnabled(enabled bool) Option
- func WithMofedEnabled(enabled bool) Option
- func WithNvidiaCTKPath(path string) Option
- func WithNvml(nvml nvml.Interface) Option
- func WithTargetDriverRoot(root string) Option
- func WithVendor(vendor string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
Interface provides the API to the 'cdi' package
func NewNullHandler ¶
func NewNullHandler() Interface
NewNullHandler returns an instance of the 'cdi' interface that can be used when CDI specs are not required.
type InterfaceMock ¶
type InterfaceMock struct {
// CreateSpecFileFunc mocks the CreateSpecFile method.
CreateSpecFileFunc func() error
// QualifiedNameFunc mocks the QualifiedName method.
QualifiedNameFunc func(s1 string, s2 string) string
// contains filtered or unexported fields
}
InterfaceMock is a mock implementation of Interface.
func TestSomethingThatUsesInterface(t *testing.T) {
// make and configure a mocked Interface
mockedInterface := &InterfaceMock{
CreateSpecFileFunc: func() error {
panic("mock out the CreateSpecFile method")
},
QualifiedNameFunc: func(s1 string, s2 string) string {
panic("mock out the QualifiedName method")
},
}
// use mockedInterface in code that requires Interface
// and then make assertions.
}
func (*InterfaceMock) CreateSpecFile ¶
func (mock *InterfaceMock) CreateSpecFile() error
CreateSpecFile calls CreateSpecFileFunc.
func (*InterfaceMock) CreateSpecFileCalls ¶
func (mock *InterfaceMock) CreateSpecFileCalls() []struct { }
CreateSpecFileCalls gets all the calls that were made to CreateSpecFile. Check the length with:
len(mockedInterface.CreateSpecFileCalls())
func (*InterfaceMock) QualifiedName ¶
func (mock *InterfaceMock) QualifiedName(s1 string, s2 string) string
QualifiedName calls QualifiedNameFunc.
func (*InterfaceMock) QualifiedNameCalls ¶
func (mock *InterfaceMock) QualifiedNameCalls() []struct { S1 string S2 string }
QualifiedNameCalls gets all the calls that were made to QualifiedName. Check the length with:
len(mockedInterface.QualifiedNameCalls())
type Option ¶
type Option func(*cdiHandler)
Option defines a function for passing options to the New() call
func WithDeviceIDStrategy ¶
WithDeviceIDStrategy provides an Option to set the device ID strategy used by the 'cdi' interface
func WithDriverRoot ¶
WithDriverRoot provides an Option to set the driver root used by the 'cdi' interface
func WithEnabled ¶
WithEnabled provides an Option to set the enabled flag used by the 'cdi' interface
func WithGdsEnabled ¶
WithGdsEnabled provides and option to set whether a GDS CDI spec should be generated
func WithMofedEnabled ¶
WithMofedEnabled provides and option to set whether a MOFED CDI spec should be generated
func WithNvidiaCTKPath ¶
WithNvidiaCTKPath provides an Option to set the nvidia-ctk path used by the 'cdi' interface
func WithTargetDriverRoot ¶
WithTargetDriverRoot provides an Option to set the target driver root used by the 'cdi' interface
func WithVendor ¶
WithVendor provides an Option to set the vendor used by the 'cdi' interface