libvirtn

package
v0.4.83 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BRIDGE = BridgeMgr{
	Bridges: make([]Bridge, 0, 32),
}

Functions

func AddHyperListener

func AddHyperListener(listen HyperListener)

Types

type Bridge

type Bridge struct {
	Name string `json:"name"`
	Type string `json:"type"` // bridge, ovs etc.
}

type BridgeMgr

type BridgeMgr struct {
	Bridges []Bridge `json:"bridge"`
}

func (*BridgeMgr) List

func (br *BridgeMgr) List() []Bridge

type BridgeXML added in v0.4.83

type BridgeXML struct {
	XMLName xml.Name `xml:"bridge" json:"-"`
	Name    string   `xml:"name,attr" json:"name"`
	Stp     string   `xml:"stp,attr,omitempty" json:"stp,omitempty"`     // on,off
	Delay   string   `xml:"delay,attr,omitempty" json:"delay,omitempty"` // 0-32
}

type DHCP

type DHCP struct {
	libvirt.NetworkDHCPLease
}

type DHCPRangeXML added in v0.4.83

type DHCPRangeXML struct {
	XMLName xml.Name `xml:"range" json:"-"`
	Start   string   `xml:"start,attr,omitempty" json:"start,omitempty"`
	End     string   `xml:"end,attr,omitempty" json:"end,omitempty"`
}

type DHCPXML added in v0.4.83

type DHCPXML struct {
	XMLName xml.Name     `xml:"dhcp" json:"-"`
	Range   DHCPRangeXML `xml:"range" json:"range"`
}

type ForwardXML added in v0.4.83

type ForwardXML struct {
	XMLName xml.Name `xml:"forward" json:"-"`
	Mode    string   `xml:"mode,attr" json:"mode"`
}

type HyperListener

type HyperListener struct {
	Opened func(Conn *libvirt.Connect) error
	Closed func(Conn *libvirt.Connect) error
}

type HyperVisor

type HyperVisor struct {
	Name     string
	Conn     *libvirt.Connect
	Listener []HyperListener
}

func GetHyper

func GetHyper() (*HyperVisor, error)

func SetHyper

func SetHyper(name string) (*HyperVisor, error)

func (*HyperVisor) AddListener

func (h *HyperVisor) AddListener(listen HyperListener)

func (*HyperVisor) Close

func (h *HyperVisor) Close()

func (*HyperVisor) ListAllNetworks added in v0.2.23

func (h *HyperVisor) ListAllNetworks() ([]Network, error)

func (*HyperVisor) LookupNetwork added in v0.4.83

func (h *HyperVisor) LookupNetwork(name string) (*Network, error)

name: uuid, name

func (*HyperVisor) NetworkDefineXML added in v0.4.83

func (h *HyperVisor) NetworkDefineXML(xml string) (*Network, error)

func (*HyperVisor) Open

func (h *HyperVisor) Open() error

type IPv4XML added in v0.4.83

type IPv4XML struct {
	XMLName xml.Name `xml:"ip" json:"-"`
	Address string   `xml:"address,attr" json:"address"`
	Prefix  string   `xml:"prefix,attr" json:"prefix"`
	Netmask string   `xml:"netmask,attr" json:"netmask"`
	DHCP    *DHCPXML `xml:"dhcp,omitempty" json:"dhcp,omitempty"`
}

type Network

type Network struct {
	libvirt.Network
}

func ListNetworks added in v0.2.23

func ListNetworks() ([]Network, error)

func NewNetworkFromVir added in v0.2.23

func NewNetworkFromVir(net *libvirt.Network) *Network

type NetworkXML added in v0.4.83

type NetworkXML struct {
	XMLName xml.Name    `xml:"network" json:"-"`
	Name    string      `xml:"name" json:"name"`
	UUID    string      `xml:"uuid" json:"uuid"`
	Forward *ForwardXML `xml:"forward,omitempty" json:"forward"`
	IPv4    *IPv4XML    `xml:"ip,omitempty" json:"ipv4"`
	Bridge  BridgeXML   `xml:"bridge" json:"bridge"`
}

func NewNetworkXMLFromNet added in v0.4.83

func NewNetworkXMLFromNet(net *Network) *NetworkXML

func (*NetworkXML) Decode added in v0.4.83

func (net *NetworkXML) Decode(xmlData string) error

func (*NetworkXML) Encode added in v0.4.83

func (net *NetworkXML) Encode() string

Jump to

Keyboard shortcuts

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