infoutilmock

package
v2.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Rendered for windows/amd64

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.

Jump to

Keyboard shortcuts

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