Documentation ¶
Index ¶
- Constants
- func IsDown(domState libvirt.DomainState) bool
- func IsPaused(domState libvirt.DomainState) bool
- type Connection
- type LibvirtConnection
- func (l *LibvirtConnection) Close() (int, error)
- func (l *LibvirtConnection) DomainDefineXML(xml string) (dom VirDomain, err error)
- func (l *LibvirtConnection) DomainEventLifecycleRegister(callback libvirt.DomainEventLifecycleCallback) (err error)
- func (l *LibvirtConnection) ListAllDomains(flags libvirt.ConnectListAllDomainsFlags) ([]VirDomain, error)
- func (l *LibvirtConnection) ListAllSecrets(flags libvirt.ConnectListAllSecretsFlags) ([]VirSecret, error)
- func (l *LibvirtConnection) ListSecrets() (secrets []string, err error)
- func (l *LibvirtConnection) LookupDomainByName(name string) (dom VirDomain, err error)
- func (l *LibvirtConnection) LookupSecretByUUIDString(uuid string) (secret VirSecret, err error)
- func (l *LibvirtConnection) LookupSecretByUsage(usageType libvirt.SecretUsageType, usageID string) (secret VirSecret, err error)
- func (l *LibvirtConnection) NewStream(flags libvirt.StreamFlags) (Stream, error)
- func (l *LibvirtConnection) SecretDefineXML(xml string) (secret VirSecret, err error)
- type MockConnection
- func (_m *MockConnection) Close() (int, error)
- func (_m *MockConnection) DomainDefineXML(xml string) (VirDomain, error)
- func (_m *MockConnection) DomainEventLifecycleRegister(callback libvirt_go.DomainEventLifecycleCallback) error
- func (_m *MockConnection) EXPECT() *_MockConnectionRecorder
- func (_m *MockConnection) ListAllDomains(flags libvirt_go.ConnectListAllDomainsFlags) ([]VirDomain, error)
- func (_m *MockConnection) ListAllSecrets(flags libvirt_go.ConnectListAllSecretsFlags) ([]VirSecret, error)
- func (_m *MockConnection) ListSecrets() ([]string, error)
- func (_m *MockConnection) LookupDomainByName(name string) (VirDomain, error)
- func (_m *MockConnection) LookupSecretByUUIDString(uuid string) (VirSecret, error)
- func (_m *MockConnection) LookupSecretByUsage(usageType libvirt_go.SecretUsageType, usageID string) (VirSecret, error)
- func (_m *MockConnection) NewStream(flags libvirt_go.StreamFlags) (Stream, error)
- func (_m *MockConnection) SecretDefineXML(xml string) (VirSecret, error)
- type MockStream
- type MockVirDomain
- func (_m *MockVirDomain) Create() error
- func (_m *MockVirDomain) Destroy() error
- func (_m *MockVirDomain) EXPECT() *_MockVirDomainRecorder
- func (_m *MockVirDomain) Free() error
- func (_m *MockVirDomain) GetName() (string, error)
- func (_m *MockVirDomain) GetState() (libvirt_go.DomainState, int, error)
- func (_m *MockVirDomain) GetUUIDString() (string, error)
- func (_m *MockVirDomain) GetXMLDesc(flags libvirt_go.DomainXMLFlags) (string, error)
- func (_m *MockVirDomain) OpenConsole(devname string, stream *libvirt_go.Stream, flags libvirt_go.DomainConsoleFlags) error
- func (_m *MockVirDomain) Resume() error
- func (_m *MockVirDomain) Undefine() error
- type MockVirSecret
- func (_m *MockVirSecret) EXPECT() *_MockVirSecretRecorder
- func (_m *MockVirSecret) Free() error
- func (_m *MockVirSecret) GetUUIDString() (string, error)
- func (_m *MockVirSecret) GetUsageID() (string, error)
- func (_m *MockVirSecret) GetXMLDesc(flags uint32) (string, error)
- func (_m *MockVirSecret) SetValue(value []byte, flags uint32) error
- func (_m *MockVirSecret) Undefine() error
- type Stream
- type VirDomain
- type VirSecret
- type VirStream
Constants ¶
View Source
const ConnectionInterval = 10 * time.Second
View Source
const ConnectionTimeout = 15 * time.Second
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Connection ¶
type Connection interface { LookupDomainByName(name string) (VirDomain, error) DomainDefineXML(xml string) (VirDomain, error) Close() (int, error) DomainEventLifecycleRegister(callback libvirt.DomainEventLifecycleCallback) error ListAllDomains(flags libvirt.ConnectListAllDomainsFlags) ([]VirDomain, error) NewStream(flags libvirt.StreamFlags) (Stream, error) LookupSecretByUsage(usageType libvirt.SecretUsageType, usageID string) (VirSecret, error) SecretDefineXML(xml string) (VirSecret, error) ListSecrets() ([]string, error) LookupSecretByUUIDString(uuid string) (VirSecret, error) ListAllSecrets(flags libvirt.ConnectListAllSecretsFlags) ([]VirSecret, error) }
TODO: Should we handle libvirt connection errors transparent or panic?
func NewConnection ¶
type LibvirtConnection ¶
type LibvirtConnection struct { Connect *libvirt.Connect // contains filtered or unexported fields }
func (*LibvirtConnection) Close ¶
func (l *LibvirtConnection) Close() (int, error)
func (*LibvirtConnection) DomainDefineXML ¶
func (l *LibvirtConnection) DomainDefineXML(xml string) (dom VirDomain, err error)
func (*LibvirtConnection) DomainEventLifecycleRegister ¶
func (l *LibvirtConnection) DomainEventLifecycleRegister(callback libvirt.DomainEventLifecycleCallback) (err error)
func (*LibvirtConnection) ListAllDomains ¶
func (l *LibvirtConnection) ListAllDomains(flags libvirt.ConnectListAllDomainsFlags) ([]VirDomain, error)
func (*LibvirtConnection) ListAllSecrets ¶
func (l *LibvirtConnection) ListAllSecrets(flags libvirt.ConnectListAllSecretsFlags) ([]VirSecret, error)
func (*LibvirtConnection) ListSecrets ¶
func (l *LibvirtConnection) ListSecrets() (secrets []string, err error)
func (*LibvirtConnection) LookupDomainByName ¶
func (l *LibvirtConnection) LookupDomainByName(name string) (dom VirDomain, err error)
func (*LibvirtConnection) LookupSecretByUUIDString ¶
func (l *LibvirtConnection) LookupSecretByUUIDString(uuid string) (secret VirSecret, err error)
func (*LibvirtConnection) LookupSecretByUsage ¶
func (l *LibvirtConnection) LookupSecretByUsage(usageType libvirt.SecretUsageType, usageID string) (secret VirSecret, err error)
func (*LibvirtConnection) NewStream ¶
func (l *LibvirtConnection) NewStream(flags libvirt.StreamFlags) (Stream, error)
func (*LibvirtConnection) SecretDefineXML ¶
func (l *LibvirtConnection) SecretDefineXML(xml string) (secret VirSecret, err error)
type MockConnection ¶
type MockConnection struct {
// contains filtered or unexported fields
}
Mock of Connection interface
func NewMockConnection ¶
func NewMockConnection(ctrl *gomock.Controller) *MockConnection
func (*MockConnection) Close ¶
func (_m *MockConnection) Close() (int, error)
func (*MockConnection) DomainDefineXML ¶
func (_m *MockConnection) DomainDefineXML(xml string) (VirDomain, error)
func (*MockConnection) DomainEventLifecycleRegister ¶
func (_m *MockConnection) DomainEventLifecycleRegister(callback libvirt_go.DomainEventLifecycleCallback) error
func (*MockConnection) EXPECT ¶
func (_m *MockConnection) EXPECT() *_MockConnectionRecorder
func (*MockConnection) ListAllDomains ¶
func (_m *MockConnection) ListAllDomains(flags libvirt_go.ConnectListAllDomainsFlags) ([]VirDomain, error)
func (*MockConnection) ListAllSecrets ¶
func (_m *MockConnection) ListAllSecrets(flags libvirt_go.ConnectListAllSecretsFlags) ([]VirSecret, error)
func (*MockConnection) ListSecrets ¶
func (_m *MockConnection) ListSecrets() ([]string, error)
func (*MockConnection) LookupDomainByName ¶
func (_m *MockConnection) LookupDomainByName(name string) (VirDomain, error)
func (*MockConnection) LookupSecretByUUIDString ¶
func (_m *MockConnection) LookupSecretByUUIDString(uuid string) (VirSecret, error)
func (*MockConnection) LookupSecretByUsage ¶
func (_m *MockConnection) LookupSecretByUsage(usageType libvirt_go.SecretUsageType, usageID string) (VirSecret, error)
func (*MockConnection) NewStream ¶
func (_m *MockConnection) NewStream(flags libvirt_go.StreamFlags) (Stream, error)
func (*MockConnection) SecretDefineXML ¶
func (_m *MockConnection) SecretDefineXML(xml string) (VirSecret, error)
type MockStream ¶
type MockStream struct {
// contains filtered or unexported fields
}
Mock of Stream interface
func NewMockStream ¶
func NewMockStream(ctrl *gomock.Controller) *MockStream
func (*MockStream) Close ¶
func (_m *MockStream) Close() error
func (*MockStream) EXPECT ¶
func (_m *MockStream) EXPECT() *_MockStreamRecorder
func (*MockStream) UnderlyingStream ¶
func (_m *MockStream) UnderlyingStream() *libvirt_go.Stream
type MockVirDomain ¶
type MockVirDomain struct {
// contains filtered or unexported fields
}
Mock of VirDomain interface
func NewMockVirDomain ¶
func NewMockVirDomain(ctrl *gomock.Controller) *MockVirDomain
func (*MockVirDomain) Create ¶
func (_m *MockVirDomain) Create() error
func (*MockVirDomain) Destroy ¶
func (_m *MockVirDomain) Destroy() error
func (*MockVirDomain) EXPECT ¶
func (_m *MockVirDomain) EXPECT() *_MockVirDomainRecorder
func (*MockVirDomain) Free ¶
func (_m *MockVirDomain) Free() error
func (*MockVirDomain) GetName ¶
func (_m *MockVirDomain) GetName() (string, error)
func (*MockVirDomain) GetState ¶
func (_m *MockVirDomain) GetState() (libvirt_go.DomainState, int, error)
func (*MockVirDomain) GetUUIDString ¶
func (_m *MockVirDomain) GetUUIDString() (string, error)
func (*MockVirDomain) GetXMLDesc ¶
func (_m *MockVirDomain) GetXMLDesc(flags libvirt_go.DomainXMLFlags) (string, error)
func (*MockVirDomain) OpenConsole ¶
func (_m *MockVirDomain) OpenConsole(devname string, stream *libvirt_go.Stream, flags libvirt_go.DomainConsoleFlags) error
func (*MockVirDomain) Resume ¶
func (_m *MockVirDomain) Resume() error
func (*MockVirDomain) Undefine ¶
func (_m *MockVirDomain) Undefine() error
type MockVirSecret ¶
type MockVirSecret struct {
// contains filtered or unexported fields
}
Mock of VirSecret interface
func NewMockVirSecret ¶
func NewMockVirSecret(ctrl *gomock.Controller) *MockVirSecret
func (*MockVirSecret) EXPECT ¶
func (_m *MockVirSecret) EXPECT() *_MockVirSecretRecorder
func (*MockVirSecret) Free ¶
func (_m *MockVirSecret) Free() error
func (*MockVirSecret) GetUUIDString ¶
func (_m *MockVirSecret) GetUUIDString() (string, error)
func (*MockVirSecret) GetUsageID ¶
func (_m *MockVirSecret) GetUsageID() (string, error)
func (*MockVirSecret) GetXMLDesc ¶
func (_m *MockVirSecret) GetXMLDesc(flags uint32) (string, error)
func (*MockVirSecret) SetValue ¶
func (_m *MockVirSecret) SetValue(value []byte, flags uint32) error
func (*MockVirSecret) Undefine ¶
func (_m *MockVirSecret) Undefine() error
type Stream ¶
type Stream interface { io.ReadWriteCloser UnderlyingStream() *libvirt.Stream }
type VirDomain ¶
type VirDomain interface { GetState() (libvirt.DomainState, int, error) Create() error Resume() error Destroy() error GetName() (string, error) GetUUIDString() (string, error) GetXMLDesc(flags libvirt.DomainXMLFlags) (string, error) Undefine() error OpenConsole(devname string, stream *libvirt.Stream, flags libvirt.DomainConsoleFlags) error Free() error }
type VirStream ¶
type VirStream struct {
*libvirt.Stream
}
func (*VirStream) Close ¶
Close the stream and free its resources. Since closing a stream involves multiple calls with errors, the first error occurred will be returned. The stream will always be freed.
func (*VirStream) UnderlyingStream ¶
func (s *VirStream) UnderlyingStream() *libvirt.Stream
Click to show internal directories.
Click to hide internal directories.