network

package
v0.0.0-...-e749f68 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface struct {
	Alias          string                  `json:"alias,omitempty"`
	Type           InterfaceType           `json:"type"`
	AddressingMode InterfaceAddressingMode `json:"addressing_mode"`
	Address        *netip.Prefix           `json:"address,omitempty"`
	HardwareDevice *string                 `json:"hardware_device,omitempty"`
	// TODO fix Validator for int pointers with min=0,max=4094
	VlanID        *uint     `json:"vlan_id,omitempty"`
	VlanParent    *string   `json:"vlan_parent,omitempty"`
	BondMembers   *[]string `json:"bond_members,omitempty"`
	BridgeMembers *[]string `json:"bridge_members,omitempty"`
	Comment       string    `json:"comment,omitempty"`
}

type InterfaceAddressingMode

type InterfaceAddressingMode int
const (
	None InterfaceAddressingMode = iota
	Static
	Dhcp
)

func (*InterfaceAddressingMode) FromString

func (InterfaceAddressingMode) MarshalJSON

func (t InterfaceAddressingMode) MarshalJSON() ([]byte, error)

func (InterfaceAddressingMode) String

func (t InterfaceAddressingMode) String() string

func (*InterfaceAddressingMode) UnmarshalJSON

func (t *InterfaceAddressingMode) UnmarshalJSON(b []byte) error

type InterfaceType

type InterfaceType int
const (
	Hardware InterfaceType = iota
	Vlan
	Bond
	Bridge
)

func (*InterfaceType) FromString

func (t *InterfaceType) FromString(input string) InterfaceType

func (InterfaceType) MarshalJSON

func (t InterfaceType) MarshalJSON() ([]byte, error)

func (InterfaceType) String

func (t InterfaceType) String() string

func (*InterfaceType) UnmarshalJSON

func (t *InterfaceType) UnmarshalJSON(b []byte) error

type Network

type Network struct {
	Interfaces   map[string]Interface `json:"interfaces"`
	StaticRoutes []StaticRoute        `json:"static_routes"`
}

type StaticRoute

type StaticRoute struct {
	Name        string       `json:"name,omitempty"`
	Interface   string       `json:"interface,omitempty"`
	Gateway     netip.Addr   `json:"gateway,omitempty"`
	Destination netip.Prefix `json:"destination,omitempty"`
	Metric      uint         `json:"metric,omitempty"`
}

Jump to

Keyboard shortcuts

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