util

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(name string, arg []string) (string, error)

Command executes command and returns output

func ConcatStrings added in v1.9.0

func ConcatStrings(ss ...string) string

ConcatStrings use bytes.buffer to concatenate string variable

func GetCurPath

func GetCurPath() string

GetCurPath returns filepath

func GetHostname added in v1.8.0

func GetHostname() string

GetHostname returns a reasonable hostname

func GetLocalIP

func GetLocalIP(hostName string) (string, error)

func GetResourceID added in v1.16.0

func GetResourceID(namespace, name string) string

GetResourceID return resource ID

func SpliceErrors added in v1.3.0

func SpliceErrors(errors []error) string

func ValidateNodeIP

func ValidateNodeIP(nodeIP net.IP) error

ValidateNodeIP validates given node IP belongs to the current host

Types

type DummyDeviceManager added in v1.17.0

type DummyDeviceManager struct {
	netlink.Handle
}

func NewDummyDeviceManager added in v1.17.0

func NewDummyDeviceManager() *DummyDeviceManager

func (*DummyDeviceManager) DeleteDummyDevice added in v1.17.0

func (d *DummyDeviceManager) DeleteDummyDevice(devName string) error

DeleteDummyDevice delete dummy device.

func (*DummyDeviceManager) EnsureAddressBind added in v1.17.0

func (d *DummyDeviceManager) EnsureAddressBind(address, devName string) (bool, error)

EnsureAddressBind checks if address is bound to the interface, if not, binds it. If the address is already bound, return true.

func (*DummyDeviceManager) EnsureDummyDevice added in v1.17.0

func (d *DummyDeviceManager) EnsureDummyDevice(devName string) (bool, error)

EnsureDummyDevice ensure dummy device exist

func (*DummyDeviceManager) ListBindAddress added in v1.17.0

func (d *DummyDeviceManager) ListBindAddress(devName string) ([]string, error)

ListBindAddress list all IP addresses which are bound in a given interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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