apis

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2025 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// rdmaNetnsModeShared and rdmaNetnsModeExclusive define the RDMA subsystem
	// network namespace mode. An RDMA device can only be assigned to a network
	// namespace when the RDMA subsystem is set to an "exclusive" network
	// namespace mode. When the subsystem is set to "shared" mode, an attempt to
	// assign an RDMA device to a network namespace will result in failure.
	// Additionally, "If there are active network namespaces and if one or more
	// RDMA devices exist, changing mode from shared to exclusive returns error
	// code EBUSY."
	//
	// Ref. https://man7.org/linux/man-pages/man8/rdma-system.8.html
	RdmaNetnsModeShared    = "shared"
	RdmaNetnsModeExclusive = "exclusive"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type InterfaceConfig

type InterfaceConfig struct {
	Name         string   `json:"name,omitempty"`         // Logical name of the interface (e.g., "eth0", "enp0s3")
	Addresses    []string `json:"addresses,omitempty"`    // IP addresses and their CIDR masks
	MTU          int32    `json:"mtu,omitempty"`          // Maximum Transmission Unit, optional
	HardwareAddr string   `json:"hardwareAddr,omitempty"` // Read-only: Current hardware address (might be useful for GET)
}

InterfaceConfig represents the configuration for a single network interface.

type NetworkConfig

type NetworkConfig struct {
	Interface InterfaceConfig `json:"interface"` // Changed to a slice to support multiple interfaces
	Routes    []RouteConfig   `json:"routes"`
}

NetworkConfig represents the desired state of all network interfaces and their associated routes.

func ValidateConfig

func ValidateConfig(raw *runtime.RawExtension) (*NetworkConfig, error)

ValidateConfig validates the data in a runtime.RawExtension against the OpenAPI schema.

type RouteConfig

type RouteConfig struct {
	Destination string `json:"destination,omitempty"` // e.g., "0.0.0.0/0" for default, "10.0.0.0/8"
	Gateway     string `json:"gateway,omitempty"`     // The "gateway" address, e.g., "192.168.1.1"
	Source      string `json:"source,omitempty"`      // Optional source address for policy routing
	Scope       uint8  `json:"scope,omitempty"`       // Optional scope of the route, only Link (253) or Universe (0) allowed
}

RouteConfig represents a network route configuration.

Jump to

Keyboard shortcuts

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