Documentation
¶
Index ¶
- Variables
- func AddHyperListener(listen HyperListener)
- func ListLeases() (map[string]DHCPLease, error)
- type Bridge
- type BridgeMgr
- type BridgeXML
- type DHCPLease
- type DHCPRangeXML
- type DHCPXML
- type ForwardXML
- type HyperListener
- type HyperVisor
- func (h *HyperVisor) AddListener(listen HyperListener)
- func (h *HyperVisor) Close()
- func (h *HyperVisor) GetLeases() map[string]DHCPLease
- func (h *HyperVisor) ListAllNetworks() ([]Network, error)
- func (h *HyperVisor) LookupLeases(uuid string) ([]DHCPLease, error)
- func (h *HyperVisor) LookupNetwork(name string) (*Network, error)
- func (h *HyperVisor) LoopForever()
- func (h *HyperVisor) NetworkDefineXML(xml string) (*Network, error)
- func (h *HyperVisor) Open() error
- func (h *HyperVisor) OpenNotSafe() error
- func (h *HyperVisor) SyncLeases() error
- type IPv4XML
- type Network
- type NetworkXML
- type VirtualPortXML
Constants ¶
This section is empty.
Variables ¶
View Source
var BRIDGE = BridgeMgr{ Bridges: make([]Bridge, 0, 32), }
View Source
var (
NetworkAll = libvirt.CONNECT_LIST_NETWORKS_ACTIVE | libvirt.CONNECT_LIST_NETWORKS_INACTIVE
)
Functions ¶
func AddHyperListener ¶
func AddHyperListener(listen HyperListener)
func ListLeases ¶
Types ¶
type DHCPLease ¶
type DHCPLease struct { Type int `json:"type"` Mac string `json:"mac"` IPAddr string `json:"ipAddr"` Prefix uint `json:"prefix"` Hostname string `json:"hostname"` }
func LookupLeases ¶
type DHCPRangeXML ¶
type DHCPXML ¶
type DHCPXML struct { XMLName xml.Name `xml:"dhcp" json:"-"` Range []DHCPRangeXML `xml:"range" json:"range"` }
type ForwardXML ¶
type HyperListener ¶
type HyperVisor ¶
type HyperVisor struct { Name string Conn *libvirt.Connect Listener []HyperListener Lock sync.RWMutex Ticker *time.Ticker Done chan bool Leases map[string]DHCPLease }
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) GetLeases ¶
func (h *HyperVisor) GetLeases() map[string]DHCPLease
func (*HyperVisor) ListAllNetworks ¶
func (h *HyperVisor) ListAllNetworks() ([]Network, error)
func (*HyperVisor) LookupLeases ¶
func (h *HyperVisor) LookupLeases(uuid string) ([]DHCPLease, error)
func (*HyperVisor) LookupNetwork ¶
func (h *HyperVisor) LookupNetwork(name string) (*Network, error)
name: uuid, name
func (*HyperVisor) LoopForever ¶
func (h *HyperVisor) LoopForever()
func (*HyperVisor) NetworkDefineXML ¶
func (h *HyperVisor) NetworkDefineXML(xml string) (*Network, error)
func (*HyperVisor) Open ¶
func (h *HyperVisor) Open() error
func (*HyperVisor) OpenNotSafe ¶
func (h *HyperVisor) OpenNotSafe() error
func (*HyperVisor) SyncLeases ¶
func (h *HyperVisor) SyncLeases() error
type Network ¶
type Network struct {
libvirt.Network
}
func ListNetworks ¶
func LookupNetwork ¶
func NewNetworkFromVir ¶
func NewNetworkFromVir(net *libvirt.Network) *Network
type NetworkXML ¶
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"` VirtualPort *VirtualPortXML `xml:"virtualport" json:"virtualport"` }
func NewNetworkXMLFromNet ¶
func NewNetworkXMLFromNet(net *Network) *NetworkXML
type VirtualPortXML ¶
Click to show internal directories.
Click to hide internal directories.