Documentation ¶
Index ¶
- Constants
- Variables
- func CheckIfFileExists(filepath string) (bool, error)
- func ClearNetworkConfiguration() (bool, error)
- func ConvertStringToIPAddress(address string) net.IP
- func ConvertStringToIPNet(address string) (*net.IPNet, error)
- func CreateDirectory(dirPath string) error
- func GenerateAddress(subnet *net.IPNet, hostID net.IP) net.IP
- func GetLastRebootTime() (time.Time, error)
- func GetOSDetails() (map[string]string, error)
- func GetOSInfo() string
- func GetProcessNameByID(pidstr string) (string, error)
- func GetProcessSupport() error
- func KillProcessByName(processName string) error
- func PrintDependencyPackageDetails()
- func ReadFileByLines(filename string) ([]string, error)
- func ReplaceFile(source, destination string) error
- func SetOutboundSNAT(subnet string) error
- func SetSdnRemoteArpMacAddress() error
- type AddressFamily
- type ExecClient
Constants ¶
const ( // CNMRuntimePath is the path where CNM state files are stored. CNMRuntimePath = "/var/lib/azure-network/" // CNIRuntimePath is the path where CNI state files are stored. CNIRuntimePath = "/var/run/" // CNILockPath is the path where CNI lock files are stored. CNILockPath = "/var/run/azure-vnet/" // CNIStateFilePath is the path to the CNI state file CNIStateFilePath = "/var/run/azure-vnet.json" // CNIBinaryPath is the path to the CNI binary CNIBinaryPath = "/opt/cni/bin/azure-vnet" // CNSRuntimePath is the path where CNS state files are stored. CNSRuntimePath = "/var/run/" // CNI runtime path on a Kubernetes cluster K8SCNIRuntimePath = "/opt/cni/bin" // Network configuration file path on a Kubernetes cluster K8SNetConfigPath = "/etc/cni/net.d" // NPMRuntimePath is the path where NPM logging files are stored. NPMRuntimePath = "/var/run/" // DNCRuntimePath is the path where DNC logging files are stored. DNCRuntimePath = "/var/run/" )
Variables ¶
var ErrMockExec = errors.New("mock exec error")
ErrMockExec - mock exec error
Functions ¶
func CheckIfFileExists ¶
func ClearNetworkConfiguration ¶ added in v1.0.16
ClearNetworkConfiguration clears the azure-vnet.json contents. This will be called only when reboot is detected - This is windows specific
func ConvertStringToIPAddress ¶
ConvertStringToIPAddress converts the given IP address string to a net.IP object. The input string can be in regular dotted notation or CIDR notation.
func ConvertStringToIPNet ¶
ConvertStringToIPNet converts the given IP address string to a net.IPNet object.
func CreateDirectory ¶
func GenerateAddress ¶
GenerateAddress generates an IP address from the given network and host ID.
func GetLastRebootTime ¶ added in v1.0.0
GetLastRebootTime returns the last time the system rebooted.
func GetOSDetails ¶
func GetProcessNameByID ¶
func GetProcessSupport ¶
func GetProcessSupport() error
func KillProcessByName ¶ added in v1.0.18
func PrintDependencyPackageDetails ¶
func PrintDependencyPackageDetails()
func ReadFileByLines ¶
ReadFileByLines reads file line by line and return array of lines.
func ReplaceFile ¶
func SetOutboundSNAT ¶
func SetSdnRemoteArpMacAddress ¶
func SetSdnRemoteArpMacAddress() error
SetSdnRemoteArpMacAddress sets the regkey for SDNRemoteArpMacAddress needed for multitenancy This operation is specific to windows OS
Types ¶
type AddressFamily ¶
type AddressFamily int
AddressFamily specifies a protocol address family number.
const ( AfUnspec AddressFamily = 0 AfINET AddressFamily = 0x2 AfINET6 AddressFamily = 0xa )
func GetAddressFamily ¶
func GetAddressFamily(address *net.IP) AddressFamily
GetAddressFamily returns the address family of an IP address.
type ExecClient ¶
func NewExecClient ¶
func NewExecClient() ExecClient
func NewMockExecClient ¶
func NewMockExecClient(returnErr bool) ExecClient