Documentation
¶
Index ¶
- Constants
- func Assign[T any](dst **T, src *T)
- func BoolPtr(b bool) *bool
- func CreateAlpineInterfaces(requestConfig []api.NetworkInterface, mountPoint string) error
- func CreateChannelDir(hostname string) (string, error)
- func CreateNetplanInterfaces(requestConfig []api.NetworkInterface, mountPoint string) error
- func DeepCopy[T any](src T) (T, error)
- func DerefStrPtr(ptr *string) string
- func GenerateRandomMAC() (net.HardwareAddr, error)
- func Int64PtrConvMB(i uint64) *int64
- func Int64PtrInt32(i uint64) *int32
- func IntPtrInt(i int) *int
- func IntPtrInt32(i int) *int32
- func IntPtrInt64(i int) *int64
- func MountVolume(v api.Volume) (string, string, error)
- func NameserverForDNSListenAddr(dnsListenAddr string) string
- func OrDefault[T any](p *T, d T) T
- func PatchStruct(dst, src interface{})
- func RemoveChannelDir(hostname string) error
- func SetDebugMode(enabled bool)
- func SetupAlpineLinux(spec api.Server) error
- func SetupHostBridge() bool
- func SetupLinux(spec api.Server) error
- func SetupLocalResolver(dnsListenAddr string) error
- func StringPtr(s string) *string
- func TimePtr(t time.Time) *time.Time
- func UnMountVolume(v api.Volume, mountPoint string, nbdDevice string) error
- type Bridge
- type BridgeParameters
- type Ethernet
- type Nameserver
- type NetplanConfig
- type Network
- type Route
Constants ¶
const LOOP_CTL_GET_FREE = 0x4C82
LOOP_CTL_GET_FREE は新しい空きループデバイスを取得するための定数 通常、Linuxカーネルでは 0x4C82 です
Variables ¶
This section is empty.
Functions ¶
func CreateAlpineInterfaces ¶ added in v0.23.0
func CreateAlpineInterfaces(requestConfig []api.NetworkInterface, mountPoint string) error
func CreateChannelDir ¶ added in v0.9.1
ホストのチャネル用ディレクトリを作成
func CreateNetplanInterfaces ¶ added in v0.9.1
func CreateNetplanInterfaces(requestConfig []api.NetworkInterface, mountPoint string) error
NICの設定
func DeepCopy ¶ added in v0.9.1
DeepCopy performs a deep copy of a generic type T using JSON serialization.
func DerefStrPtr ¶ added in v0.14.1
DerefStrPtr returns the string value if ptr is not nil, otherwise "".
func GenerateRandomMAC ¶ added in v0.9.1
func GenerateRandomMAC() (net.HardwareAddr, error)
GenerateRandomMAC はランダムなMACアドレスを生成します
func Int64PtrConvMB ¶ added in v0.9.1
func Int64PtrInt32 ¶ added in v0.9.1
func IntPtrInt32 ¶ added in v0.9.1
func IntPtrInt64 ¶ added in v0.9.1
func NameserverForDNSListenAddr ¶ added in v0.21.0
NameserverForDNSListenAddr extracts the nameserver IP from a dns_listen_addr string (host:port). "0.0.0.0" and "" are normalized to "127.0.0.1".
func PatchStruct ¶ added in v0.9.1
func PatchStruct(dst, src interface{})
src の非ゼロ値フィールドだけを dst にコピーする dst と src は同じ型であることを想定
func RemoveChannelDir ¶ added in v0.9.1
ホストのチャネル用ディレクトリを削除
func SetDebugMode ¶ added in v0.24.0
func SetDebugMode(enabled bool)
SetDebugMode toggles debug-only prints in pkg/util.
func SetupAlpineLinux ¶ added in v0.23.0
func SetupHostBridge ¶ added in v0.15.1
func SetupHostBridge() bool
SetupHostBridge checks and configures host bridge for marmot Returns true if bridge was successfully set up, false otherwise
func SetupLinux ¶ added in v0.9.1
func SetupLocalResolver ¶ added in v0.15.3
SetupLocalResolver disables systemd-resolved and rewrites /etc/resolv.conf for marmot internal DNS. If /etc/resolv.conf already has a nameserver entry that matches the IP derived from dnsListenAddr, it skips the rewrite entirely.
Types ¶
type Bridge ¶ added in v0.24.0
type Bridge struct {
Interfaces []string `yaml:"interfaces,omitempty"`
Addresses []string `yaml:"addresses,omitempty"`
DHCP4 bool `yaml:"dhcp4"`
DHCP6 bool `yaml:"dhcp6"`
Routes []Route `yaml:"routes,omitempty"`
Nameservers Nameserver `yaml:"nameservers,omitempty"`
Parameters BridgeParameters `yaml:"parameters,omitempty"`
}
type BridgeParameters ¶ added in v0.24.0
type BridgeParameters struct {
STP bool `yaml:"stp"`
}
type Ethernet ¶ added in v0.9.1
type Ethernet struct {
Addresses []string `yaml:"addresses,omitempty"`
DHCP4 bool `yaml:"dhcp4"`
DHCP6 bool `yaml:"dhcp6"`
Routes []Route `yaml:"routes,omitempty"`
Nameservers Nameserver `yaml:"nameservers,omitempty"`
}
type Nameserver ¶ added in v0.9.1
type NetplanConfig ¶ added in v0.9.1
type NetplanConfig struct {
Network Network `yaml:"network"`
}
NetplanConfig は Netplan のルート構造体