Documentation
¶
Overview ¶
Package infoutilmock provides a hand-rolled fake for the windowsInfoUtil interface used in tests. It replaces the previous gomock-generated mock so that nerdctl does not depend on go.uber.org/mock.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeWindowsInfoUtil ¶ added in v2.3.2
type FakeWindowsInfoUtil struct {
RtlGetVersionFunc func() *windows.OsVersionInfoEx
GetRegistryStringValueFunc func(key registry.Key, path string, name string) (string, error)
GetRegistryIntValueFunc func(key registry.Key, path string, name string) (int, error)
}
FakeWindowsInfoUtil is a configurable test double for the windowsInfoUtil interface. Tests assign the function fields to control behavior per call.
func NewFakeWindowsInfoUtil ¶ added in v2.3.2
func NewFakeWindowsInfoUtil() *FakeWindowsInfoUtil
NewFakeWindowsInfoUtil returns an empty fake. Callers populate the function fields they need for a given test.
func (*FakeWindowsInfoUtil) GetRegistryIntValue ¶ added in v2.3.2
func (f *FakeWindowsInfoUtil) GetRegistryIntValue(key registry.Key, path string, name string) (int, error)
GetRegistryIntValue calls the configured function, or returns (0, nil) if unset.
func (*FakeWindowsInfoUtil) GetRegistryStringValue ¶ added in v2.3.2
func (f *FakeWindowsInfoUtil) GetRegistryStringValue(key registry.Key, path string, name string) (string, error)
GetRegistryStringValue calls the configured function, or returns ("", nil) if unset.
func (*FakeWindowsInfoUtil) RtlGetVersion ¶ added in v2.3.2
func (f *FakeWindowsInfoUtil) RtlGetVersion() *windows.OsVersionInfoEx
RtlGetVersion calls the configured function, or returns nil if unset.