Пример #1
0
// Free releases the secret handle. The underlying secret continues to exist.
func (sec Secret) Free() error {
	sec.log.Println("freeing secret...")
	cRet := C.virSecretFree(sec.virSecret)
	ret := int(cRet)

	if ret == -1 {
		err := LastError()
		sec.log.Printf("an error occurred: %v\n", err)
		return err
	}

	sec.log.Println("secret freed")

	return nil
}
Пример #2
0
func cleanupSecret(secret *Secret) {
	C.virSecretFree(secret.cptr)
}
Пример #3
0
func (s *VirSecret) Free() error {
	if result := C.virSecretFree(s.ptr); result != 0 {
		return errors.New(GetLastError())
	}
	return nil
}