mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 14:26:23 -04:00
Document exported funcs,types,interfaces and enable check. (#475)
* Include EXC0014 and fix issues. * Include EXC0012 and fix issues. Signed-off-by: Fabian Kammel <fk@edgeless.systems> Co-authored-by: Otto Bittner <cobittner@posteo.net>
This commit is contained in:
parent
c9873f2bfb
commit
0d12e37c96
74 changed files with 337 additions and 78 deletions
|
@ -8,10 +8,12 @@ package virtwrapper
|
|||
|
||||
import "libvirt.org/go/libvirt"
|
||||
|
||||
// Connect wraps a libvirt connection.
|
||||
type Connect struct {
|
||||
Conn *libvirt.Connect
|
||||
}
|
||||
|
||||
// LookupNetworkByName looks up a network by name.
|
||||
func (c *Connect) LookupNetworkByName(name string) (*Network, error) {
|
||||
net, err := c.Conn.LookupNetworkByName(name)
|
||||
if err != nil {
|
||||
|
@ -20,14 +22,17 @@ func (c *Connect) LookupNetworkByName(name string) (*Network, error) {
|
|||
return &Network{Net: net}, nil
|
||||
}
|
||||
|
||||
// Network wraps a libvirt network.
|
||||
type Network struct {
|
||||
Net virNetwork
|
||||
}
|
||||
|
||||
// GetDHCPLeases returns the underlying DHCP leases.
|
||||
func (n *Network) GetDHCPLeases() ([]libvirt.NetworkDHCPLease, error) {
|
||||
return n.Net.GetDHCPLeases()
|
||||
}
|
||||
|
||||
// Free the network resource.
|
||||
func (n *Network) Free() {
|
||||
_ = n.Net.Free()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue