Documentation ¶
Overview ¶
Package qmpmsg defines types used to marshal and umarshal QMP messages.
Index ¶
Constants ¶
const ( UnknownMessage = 0 ReponseMessage = 1 EventMessage = 2 )
Message types.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
Data holds raw QMP message data as bytes.
func (*Data) UnmarshalJSON ¶
UnmarshalJSON copies the given JSON bytes to m.
type Error ¶
Error holds a QMP error returned by a command.
type Event ¶
type Event struct { Event string `json:"event"` Data Data `json:"data,omitempty"` Timestamp Timestamp `json:"timestamp"` }
Event holds an asynchronous event.
type ID ¶
ID uniquely identifies a machina QMP request by combining a random 64-bit client identifier with a message sequence number.
func (ID) MarshalText ¶
MarshalText marshals the ID as text.
func (*ID) UnmarshalJSON ¶
UnmarshalJSON attempts to interpret the given JSON data as a machina message ID encoded in a JSON string.
The function always returns a nil error, even if the data does not contain a machina message ID. This is done in case qemu broadcasts responses meant for other clients that use a different message ID format.
type Timestamp ¶
Timestamp is a time value that can be umarshaled from a QMP timestamp value encoded in a JSON object.
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON unmarshals a QMP timestamp from the given JSON object data.