mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-05 07:45:27 -04:00
qemu-metadata-api: allow building without cgo dependencies for linting
This commit is contained in:
parent
15d51c3a3f
commit
78085cba68
8 changed files with 119 additions and 36 deletions
33
hack/qemu-metadata-api/virtwrapper/virtwrapper_cross.go
Normal file
33
hack/qemu-metadata-api/virtwrapper/virtwrapper_cross.go
Normal file
|
@ -0,0 +1,33 @@
|
|||
//go:build !cgo
|
||||
|
||||
/*
|
||||
Copyright (c) Edgeless Systems GmbH
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package virtwrapper
|
||||
|
||||
import "errors"
|
||||
|
||||
// Connect wraps a libvirt connection.
|
||||
type Connect struct{}
|
||||
|
||||
// LookupNetworkByName looks up a network by name.
|
||||
// This function errors if CGO is disabled.
|
||||
func (c *Connect) LookupNetworkByName(_ string) (*Network, error) {
|
||||
return nil, errors.New("using virtwrapper requires building with CGO")
|
||||
}
|
||||
|
||||
// Network wraps a libvirt network.
|
||||
type Network struct{}
|
||||
|
||||
// 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")
|
||||
}
|
||||
|
||||
// Free the network resource.
|
||||
// This function does nothing if CGO is disabled.
|
||||
func (n *Network) Free() {}
|
Loading…
Add table
Add a link
Reference in a new issue