mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-04 23:35:11 -04:00
bazel: allow "bazel test" to work without cgo dependencies
This commit is contained in:
parent
de863aece0
commit
1f12541a36
10 changed files with 154 additions and 130 deletions
|
@ -20,14 +20,21 @@ func (c *Connect) LookupNetworkByName(_ string) (*Network, error) {
|
|||
}
|
||||
|
||||
// Network wraps a libvirt network.
|
||||
type Network struct{}
|
||||
type Network struct {
|
||||
Net Net
|
||||
}
|
||||
|
||||
// GetDHCPLeases returns the underlying DHCP leases.
|
||||
// This function errors if CGO is disabled.
|
||||
func (n *Network) GetDHCPLeases() ([]NetworkDHCPLease, error) {
|
||||
return nil, errors.New("using virtwrapper requires building with CGO")
|
||||
return n.Net.GetDHCPLeases()
|
||||
}
|
||||
|
||||
// Free the network resource.
|
||||
// This function does nothing if CGO is disabled.
|
||||
func (n *Network) Free() {}
|
||||
|
||||
// Net is a libvirt Network.
|
||||
type Net interface {
|
||||
GetDHCPLeases() ([]NetworkDHCPLease, error)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue