util

package
v0.0.0-...-0cfeddc Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultFactory

type DefaultFactory struct{}

func NewFactory

func NewFactory() *DefaultFactory

func (*DefaultFactory) GetNetworkInterfaceIP

func (f *DefaultFactory) GetNetworkInterfaceIP(namePrefix string) (string, error)

GetNetworkInterfaceIP returns the IP address of the first local network interface whose name starts with namePrefix

func (*DefaultFactory) ScanInt

func (f *DefaultFactory) ScanInt() (int, error)

Read stdin up to the next space and convert to an int.

type Factory

type Factory interface {
	ScanInt() (int, error)
	GetNetworkInterfaceIP(string) (string, error)
}

type TestFactory

type TestFactory struct {
	ScanIntImpl func() (int, error)
}

func NewTestFactory

func NewTestFactory() *TestFactory

func (*TestFactory) ScanInt

func (f *TestFactory) ScanInt() (int, error)

Jump to

Keyboard shortcuts

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