summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Maiocchi <dmaiocchi@suse.com>2017-11-10 19:07:52 +0100
committerDario Maiocchi <dmaiocchi@suse.com>2017-11-16 11:26:28 +0100
commit965ea1ccfdd98a4811af0f652c4b6e9c79052e90 (patch)
treef874768d7c7ca036721b9e5861cf573911c5c672
parentb79acdd0924791aa424e37497128619a0f481f05 (diff)
downloadterraform-provider-libvirt-965ea1ccfdd98a4811af0f652c4b6e9c79052e90.tar
terraform-provider-libvirt-965ea1ccfdd98a4811af0f652c4b6e9c79052e90.tar.gz
comment on exported function should Start with
name of the function
-rw-r--r--libvirt/cloudinit_def.go3
-rw-r--r--libvirt/libvirt_interfaces.go2
-rw-r--r--libvirt/network_def.go2
-rw-r--r--libvirt/pool_sync.go6
-rw-r--r--libvirt/utils.go4
-rw-r--r--libvirt/utils_net.go2
6 files changed, 10 insertions, 9 deletions
diff --git a/libvirt/cloudinit_def.go b/libvirt/cloudinit_def.go
index 37f4afb4..2c08c2be 100644
--- a/libvirt/cloudinit_def.go
+++ b/libvirt/cloudinit_def.go
@@ -19,8 +19,9 @@ import (
"gopkg.in/yaml.v2"
)
-// names of the files expected by cloud-init
+// USERDATA is the name of file expected by cloud-init
const USERDATA string = "user-data"
+// METADATA is the name of file expected by cloud-init
const METADATA string = "meta-data"
type CloudInitUserData struct {
diff --git a/libvirt/libvirt_interfaces.go b/libvirt/libvirt_interfaces.go
index 77449034..4c2b4fcd 100644
--- a/libvirt/libvirt_interfaces.go
+++ b/libvirt/libvirt_interfaces.go
@@ -2,7 +2,7 @@ package libvirt
import "github.com/libvirt/libvirt-go"
-// Interface used to expose a libvirt.Domain
+// LibVirtDomain Interface used to expose a libvirt.Domain
// Used to allow testing
type LibVirtDomain interface {
QemuAgentCommand(command string, timeout libvirt.DomainQemuAgentCommandTimeout, flags uint32) (string, error)
diff --git a/libvirt/network_def.go b/libvirt/network_def.go
index dcfa7eb0..e62bdfc2 100644
--- a/libvirt/network_def.go
+++ b/libvirt/network_def.go
@@ -7,7 +7,7 @@ import (
"github.com/libvirt/libvirt-go-xml"
)
-// Check if the network has a DHCP server managed by libvirt
+// HasDHCP Check if the network has a DHCP server managed by libvirt
func HasDHCP(net libvirtxml.Network) bool {
if net.Forward != nil {
if net.Forward.Mode == "nat" || net.Forward.Mode == "route" || net.Forward.Mode == "" {
diff --git a/libvirt/pool_sync.go b/libvirt/pool_sync.go
index 8c53ac05..5349b6fe 100644
--- a/libvirt/pool_sync.go
+++ b/libvirt/pool_sync.go
@@ -13,7 +13,7 @@ type LibVirtPoolSync struct {
internalMutex sync.Mutex
}
-// Allocate a new instance of LibVirtPoolSync
+// NewLibVirtPoolSync Allocate a new instance of LibVirtPoolSync
func NewLibVirtPoolSync() LibVirtPoolSync {
pool := LibVirtPoolSync{}
pool.PoolLocks = make(map[string]*sync.Mutex)
@@ -21,7 +21,7 @@ func NewLibVirtPoolSync() LibVirtPoolSync {
return pool
}
-// Acquire a lock for the specified pool
+// AcquireLock Acquire a lock for the specified pool
func (ps LibVirtPoolSync) AcquireLock(pool string) {
ps.internalMutex.Lock()
defer ps.internalMutex.Unlock()
@@ -35,7 +35,7 @@ func (ps LibVirtPoolSync) AcquireLock(pool string) {
lock.Lock()
}
-// Release the look for the specified pool
+// ReleaseLock Release the look for the specified pool
func (ps LibVirtPoolSync) ReleaseLock(pool string) {
ps.internalMutex.Lock()
defer ps.internalMutex.Unlock()
diff --git a/libvirt/utils.go b/libvirt/utils.go
index 0851fb8f..a0dea21c 100644
--- a/libvirt/utils.go
+++ b/libvirt/utils.go
@@ -29,7 +29,7 @@ func DiskLetterForIndex(i int) string {
var WAIT_SLEEP_INTERVAL time.Duration = 1 * time.Second
var WAIT_TIMEOUT time.Duration = 5 * time.Minute
-// wait for success and timeout after 5 minutes.
+// WaitForSuccess wait for success and timeout after 5 minutes.
func WaitForSuccess(errorMessage string, f func() error) error {
start := time.Now()
for {
@@ -57,7 +57,7 @@ func xmlMarshallIndented(b interface{}) (string, error) {
return buf.String(), nil
}
-// Remove the volume identified by `key` from libvirt
+// RemoveVolume Remove the volume identified by `key` from libvirt
func RemoveVolume(virConn *libvirt.Connect, key string) error {
volume, err := virConn.LookupStorageVolByKey(key)
if err != nil {
diff --git a/libvirt/utils_net.go b/libvirt/utils_net.go
index efb0d725..8cadcc9a 100644
--- a/libvirt/utils_net.go
+++ b/libvirt/utils_net.go
@@ -55,7 +55,7 @@ func FreeNetworkInterface(basename string) (string, error) {
return "", fmt.Errorf("could not obtain a free network interface")
}
-// Calculates the first and last IP addresses in an IPNet
+// NetworkRange Calculates the first and last IP addresses in an IPNet
func NetworkRange(network *net.IPNet) (net.IP, net.IP) {
netIP := network.IP.To4()
lastIP := net.IPv4(0, 0, 0, 0).To4()