util

package
v1.23.0-cx Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

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

func ConcatStrings(ss ...string) string

ConcatStrings use bytes.buffer to concatenate string variable

func GetCurPath

func GetCurPath() string

GetCurPath returns filepath

func GetHostname

func GetHostname() string

GetHostname returns a reasonable hostname

func GetLocalIP

func GetLocalIP(hostName string) (string, error)

func GetNamespacedName

func GetNamespacedName(resourceID string) (string, string, error)

GetNamespacedName return namespaced name

func GetResourceID

func GetResourceID(namespace, name string) string

GetResourceID return resource ID

func SpliceErrors

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

type DummyDeviceManager struct {
	netlink.Handle
}

func NewDummyDeviceManager

func NewDummyDeviceManager() *DummyDeviceManager

func (*DummyDeviceManager) DeleteDummyDevice

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

DeleteDummyDevice delete dummy device.

func (*DummyDeviceManager) EnsureAddressBind

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

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

EnsureDummyDevice ensure dummy device exist

func (*DummyDeviceManager) ListBindAddress

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