Documentation
¶
Index ¶
- Constants
- type Dialer
- type Header
- type Router
- type Socket
- func (s *Socket) Connect() error
- func (s *Socket) Disconnect() error
- func (s *Socket) Disconnected() <-chan struct{}
- func (s *Socket) SendPacket(serial int32, proc uint32, program uint32, payload []byte, typ uint32, ...) error
- func (s *Socket) SendStream(serial int32, proc uint32, program uint32, stream io.Reader, abort chan bool) error
Constants ¶
View Source
const ( // StatusOK is always set for method calls or events. // For replies it indicates successful completion of the method. // For streams it indicates confirmation of the end of file on the stream. StatusOK = iota // StatusError for replies indicates that the method call failed // and error information is being returned. For streams this indicates // that not all data was sent and the stream has aborted. StatusError // StatusContinue is only used for streams. // This indicates that further data packets will be following. StatusContinue )
request and response statuses
View Source
const ( // Call is used when making calls to the remote server. Call = iota // Reply indicates a server reply. Reply // Message is an asynchronous notification. Message // Stream represents a stream data packet. Stream // CallWithFDs is used by a client to indicate the request has // arguments with file descriptors. CallWithFDs // ReplyWithFDs is used by a server to indicate the request has // arguments with file descriptors. ReplyWithFDs )
request and response types
View Source
const ( // B - byte B = 1 // KiB - kibibyte KiB = 1024 * B // MiB - mebibyte MiB = 1024 * KiB )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct { // Program identifier Program uint32 // Program version Version uint32 // Remote procedure identifier Procedure uint32 // Call type, e.g., Reply Type uint32 // Call serial number Serial int32 // Request status, e.g., StatusOK Status uint32 }
Header is a libvirt rpc packet header
type Socket ¶
type Socket struct {
// contains filtered or unexported fields
}
Socket represents a libvirt Socket and its connection state
func (*Socket) Connect ¶
Connect uses the dialer provided on creation to establish underlying physical connection to the desired libvirt.
func (*Socket) Disconnect ¶
Disconnect closes the Socket connection to libvirt and waits for the reader gorouting to shut down.
func (*Socket) Disconnected ¶
func (s *Socket) Disconnected() <-chan struct{}
Disconnected returns a channel that will be closed once the current connection is closed. This can happen due to an explicit call to Disconnect from the client, or due to non-temporary Read or Write errors encountered.
Click to show internal directories.
Click to hide internal directories.