Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/digitalocean/go-libvirt
/ functions
Functions
1,030 in github.com/digitalocean/go-libvirt
⨍
Functions
1,030
◇
Types & classes
969
↓ 462 callers
Method
requestStream
requestStream performs a libvirt RPC request. The `out` and `in` parameters are optional, and should be nil when RPC endpoints don't return a stream.
rpc.go:266
↓ 382 callers
Function
encode
encode XDR encodes the provided data.
rpc.go:369
↓ 365 callers
Method
Decode
(*Decoder, reflect.Value)
internal/go-xdr/xdr2/decode.go:91
↓ 80 callers
Method
Error
(s string)
internal/lvgen/y.go:277
↓ 53 callers
Method
Disconnect
Disconnect shuts down communication with the libvirt server and closes the underlying net.Conn.
libvirt.go:320
↓ 53 callers
Function
NewWithDialer
NewWithDialer configures a new Libvirt object that can be used to perform RPCs via libvirt's socket. The actual connection will not be established un
libvirt.go:841
↓ 52 callers
Method
Connect
Connect establishes communication with the libvirt server. The underlying libvirt socket connection will be created via the dialer. Since the connecti
libvirt.go:314
↓ 38 callers
Method
Write
Write writes the contents of p to w. When the contents of p would cause the writer to exceed the maximum allowed size of the fixed writer, the writer
internal/go-xdr/xdr2/fixedIO_test.go:36
↓ 36 callers
Function
New
New creates a new mock Libvirt server.
libvirttest/libvirt.go:595
↓ 28 callers
Method
reply
reply automatically injects the correct serial number into the provided response buffer.
libvirttest/libvirt.go:716
↓ 25 callers
Function
unmarshalError
unmarshalError creates an error given a set of arguments and will copy byte slices into the Value field since they might otherwise be changed from fro
internal/go-xdr/xdr2/error.go:111
↓ 17 callers
Method
String
String returns the ErrorCode as a human-readable name.
internal/go-xdr/xdr2/error.go:79
↓ 17 callers
Function
testDialer
(t *testing.T)
libvirt_integration_test.go:485
↓ 15 callers
Function
testExpectedURet
testExpectedURet is a convenience method to test an expected number of bytes read and error for an unmarshal.
internal/go-xdr/xdr2/decode_test.go:69
↓ 14 callers
Method
Len
Len will return the current count of events in the internal queue for a stream. It does this by sending a message to the stream's process() loop, whic
internal/event/stream.go:71
↓ 14 callers
Method
lookup
lookup returns a domain as seen by libvirt.
libvirt.go:782
↓ 12 callers
Method
Bytes
Bytes returns the bytes already written to the fixed writer.
internal/go-xdr/xdr2/fixedIO_test.go:49
↓ 12 callers
Function
marshalError
marshalError creates an error given a set of arguments and will copy byte slices into the Value field since they might otherwise be changed from from
internal/go-xdr/xdr2/error.go:165
↓ 11 callers
Function
NewStream
NewStream configures a new Event Stream. Incoming events are appended to a queue, which is then relayed to the listening client. Client behavior will
internal/event/stream.go:51
↓ 11 callers
Method
next
next returns the rune at the current location, and advances to the next rune in the input.
internal/lvgen/lvlexer.go:146
↓ 10 callers
Method
Shutdown
Shutdown gracefully terminates Stream processing, releasing all internal resources. Events which have not yet been received by the client will be drop
internal/event/stream.go:92
↓ 9 callers
Method
DecodeUint
DecodeUint treats the next 4 bytes as an XDR encoded unsigned integer and returns the result as a uint32 along with the number of bytes actually read.
internal/go-xdr/xdr2/decode.go:146
↓ 9 callers
Method
EncodeUint
EncodeUint writes the XDR encoded representation of the passed 32-bit unsigned integer to the encapsulated writer and returns the number of bytes writ
internal/go-xdr/xdr2/encode.go:122
↓ 8 callers
Function
Unmarshal
* Unmarshal parses XDR-encoded data into the value pointed to by v reading from reader r and returning the total number of bytes read. An addressable
internal/go-xdr/xdr2/decode.go:77
↓ 8 callers
Method
addStream
addStream configures the routing for an event stream.
rpc.go:187
↓ 7 callers
Method
DecodeFixedOpaque
RFC Section 4.8 - Quadruple-Precision Floating Point 128-bit quadruple-precision floating point Not Implemented DecodeFixedOpaque treats the next 'si
internal/go-xdr/xdr2/decode.go:322
↓ 7 callers
Method
Dial
()
socket/socket.go:61
↓ 7 callers
Method
Recv
Recv returns the next available event from the Stream's queue.
internal/event/stream.go:80
↓ 7 callers
Method
StoragePool
StoragePool returns the storage pool associated with the provided name. An error is returned if the requested storage pool is not found. Deprecated:
libvirt.go:586
↓ 7 callers
Method
backup
backup moves back one character, but can only be called once per next() call.
internal/lvgen/lvlexer.go:167
↓ 7 callers
Method
decode
decode is the main workhorse for unmarshalling via reflection. It uses the passed reflection value to choose the XDR primitives to decode from the en
internal/go-xdr/xdr2/decode.go:665
↓ 7 callers
Function
yyTokname
(c int)
internal/lvgen/y.go:301
↓ 6 callers
Method
DecodeString
DecodeString treats the next bytes as a variable length XDR encoded string and returns the result as a string along with the number of bytes actually
internal/go-xdr/xdr2/decode.go:391
↓ 6 callers
Method
Disconnected
Disconnected allows callers to detect if the underlying connection to libvirt has been closed. If the returned channel is closed, then the connection
libvirt.go:350
↓ 6 callers
Method
DomainLookupByName
DomainLookupByName is the go wrapper for REMOTE_PROC_DOMAIN_LOOKUP_BY_NAME.
remote_protocol.gen.go:5091
↓ 6 callers
Method
EncodeFixedOpaque
RFC Section 4.8 - Quadruple-Precision Floating Point 128-bit quadruple-precision floating point Not Implemented EncodeFixedOpaque treats the passed b
internal/go-xdr/xdr2/encode.go:282
↓ 6 callers
Method
encode
encode is the main workhorse for marshalling via reflection. It uses the passed reflection value to choose the XDR primitives to encode into the enca
internal/go-xdr/xdr2/encode.go:553
↓ 6 callers
Method
register
register configures a method response callback
rpc.go:225
↓ 5 callers
Method
SendPacket
SendPacket sends a packet to libvirt on the socket connection.
socket/socket.go:296
↓ 5 callers
Function
constNameTransform
constNameTransform changes an upcased, snake-style name like REMOTE_PROTOCOL_VERSION to a comfortable Go name like ProtocolVersion. It also tries to u
internal/lvgen/generate.go:299
↓ 5 callers
Function
identifierTransform
(name string)
internal/lvgen/generate.go:325
↓ 4 callers
Method
ConnectToURI
ConnectToURI establishes communication with the specified libvirt driver The underlying libvirt socket connection will be created via the dialer. Sinc
libvirt.go:286
↓ 4 callers
Method
Decode
Decode operates identically to the Unmarshal function with the exception of using the reader associated with the Decoder as the source of XDR-encoded
internal/go-xdr/xdr2/decode.go:853
↓ 4 callers
Method
DecodeInt
DecodeInt treats the next 4 bytes as an XDR encoded integer and returns the result as an int32 along with the number of bytes actually read. An Unmar
internal/go-xdr/xdr2/decode.go:124
↓ 4 callers
Method
EncodeInt
EncodeInt writes the XDR encoded representation of the passed 32-bit signed integer to the encapsulated writer and returns the number of bytes written
internal/go-xdr/xdr2/encode.go:95
↓ 4 callers
Function
New
New configures a new Libvirt RPC connection. This function only remains to retain backwards compatability. When Libvirt's Connect function is called,
libvirt.go:865
↓ 4 callers
Function
NewDecl
NewDecl returns a new declaration struct.
internal/lvgen/generate.go:138
↓ 4 callers
Function
TstDecode
TstDecode creates a new Decoder for the passed reader and returns the internal decode function on the Decoder.
internal/go-xdr/xdr2/internal_test.go:40
↓ 4 callers
Function
addDecl
addDecl adds a declaration to the current container.
internal/lvgen/generate.go:810
↓ 4 callers
Method
emit
emit returns a token to the parser.
internal/lvgen/lvlexer.go:117
↓ 4 callers
Function
newFixedWriter
newFixedWriter returns a new io.Writer that will error once more bytes than the specified max have been written.
internal/go-xdr/xdr2/fixedIO_test.go:55
↓ 4 callers
Function
testExpectedMRet
testExpectedMRet is a convenience method to test an expected number of bytes written and error for a marshal.
internal/go-xdr/xdr2/encode_test.go:31
↓ 3 callers
Method
DecodeBool
DecodeBool treats the next 4 bytes as an XDR encoded boolean value and returns the result as a bool along with the number of bytes actually read. An
internal/go-xdr/xdr2/decode.go:194
↓ 3 callers
Method
Domains
Domains returns a list of all domains managed by libvirt. Deprecated: use ConnectListAllDomains instead.
libvirt.go:368
↓ 3 callers
Method
EncodeBool
EncodeBool writes the XDR encoded representation of the passed boolean to the encapsulated writer and returns the number of bytes written. A MarshalE
internal/go-xdr/xdr2/encode.go:168
↓ 3 callers
Method
EncodeString
EncodeString writes the XDR encoded representation of the passed string to the encapsulated writer and returns the number of bytes written. Character
internal/go-xdr/xdr2/encode.go:348
↓ 3 callers
Method
EncodeUhyper
EncodeUhyper writes the XDR encoded representation of the passed 64-bit unsigned integer to the encapsulated writer and returns the number of bytes wr
internal/go-xdr/xdr2/encode.go:217
↓ 3 callers
Method
GetCallbackID
()
internal/event/event.go:19
↓ 3 callers
Method
IsConnected
IsConnected indicates whether or not there is currently a connection to libvirtd.
libvirt.go:356
↓ 3 callers
Method
Parse
(yyLexer)
internal/lvgen/y.go:281
↓ 3 callers
Method
Password
Password adds the password auth method to the allowed list.
socket/dialers/gossh.go:224
↓ 3 callers
Method
Push
Push appends a new event to the queue.
internal/event/stream.go:85
↓ 3 callers
Method
Run
Run executes the given QAPI command against a domain's QEMU instance. For a list of available QAPI commands, see: http://git.qemu.org/?p=qemu.git;a=b
libvirt.go:531
↓ 3 callers
Method
Shutdown
Shutdown shuts down a domain. Note that the guest OS may ignore the request. If flags is set to 0 then the hypervisor will choose the method of shutdo
libvirt.go:677
↓ 3 callers
Method
StoragePoolRefresh
StoragePoolRefresh is the go wrapper for REMOTE_PROC_STORAGE_POOL_REFRESH.
remote_protocol.gen.go:6839
↓ 3 callers
Method
StoragePools
StoragePools returns a list of defined storage pools. Pools are filtered by the provided flags. See StoragePools*. Deprecated: use ConnectListAllStor
libvirt.go:594
↓ 3 callers
Function
checkCapabilities
(t *testing.T, l *Libvirt)
libvirt_integration_test.go:80
↓ 3 callers
Function
decodeError
decodeError extracts an error message from the provider buffer.
rpc.go:377
↓ 3 callers
Method
deregister
deregister destroys a method response callback. It is the responsibility of the caller to manage locking (l.cmux) during this call.
rpc.go:234
↓ 3 callers
Method
empty
Since it's possible to have an embedded struct definition, this implements a stack to keep track of the current structure.
internal/lvgen/generate.go:201
↓ 3 callers
Method
encodeFixedArray
encodeFixedArray writes the XDR encoded representation of each element in the passed array represented by the reflection value to the encapsulated wri
internal/go-xdr/xdr2/encode.go:372
↓ 3 callers
Method
errorf
errorf is used by the lexer to report errors. It inserts an ERROR token into the items channel, and sets the state to nil, which stops the lexer's sta
internal/lvgen/lvlexer.go:139
↓ 3 callers
Function
eventDecoder
eventDecoder decodes an event from a xdr buffer.
rpc.go:405
↓ 3 callers
Function
fromSnakeToCamel
fromSnakeToCamel transmutes a snake-cased string to a camel-cased one. All runes that follow an underscore are up-cased, and the underscores themselve
internal/lvgen/generate.go:364
↓ 3 callers
Method
getResponse
(c chan response)
rpc.go:350
↓ 3 callers
Method
ignore
ignore discards the current text from start to pos.
internal/lvgen/lvlexer.go:162
↓ 3 callers
Method
indirect
indirect dereferences pointers until it reaches a non-pointer. This allows transparent encoding through arbitrary levels of indirection.
internal/go-xdr/xdr2/encode.go:626
↓ 3 callers
Method
indirect
indirect dereferences pointers allocating them as needed until it reaches a non-pointer. This allows transparent decoding through arbitrary levels of
internal/go-xdr/xdr2/decode.go:829
↓ 3 callers
Method
isDisconnected
isDisconnected is a non-blocking function to query whether a connection is disconnected or not.
socket/socket.go:191
↓ 3 callers
Function
parseNumber
parseNumber makes sure that a parsed numerical value can be parsed to a 64- bit integer.
internal/lvgen/generate.go:695
↓ 3 callers
Method
removeAllStreams
removeAllStreams deletes all event streams. This is meant to be used to clean up only once the underlying connection to libvirt is disconnected and t
rpc.go:214
↓ 3 callers
Method
removeStream
removeStream deletes an event stream. The caller should first notify libvirt to stop sending events for this stream. Subsequent calls to removeStream
rpc.go:197
↓ 3 callers
Method
request
request performs a libvirt RPC request. returns response returned by server. if response is not OK, decodes error from it and returns it.
rpc.go:260
↓ 3 callers
Method
serial
serial provides atomic access to the next sequential request serial number.
rpc.go:169
↓ 3 callers
Function
testConn
(t *testing.T)
libvirt_integration_test.go:495
↓ 3 callers
Function
yyStatname
(s int)
internal/lvgen/y.go:310
↓ 2 callers
Function
AddCase
AddCase is called when the parser finishes parsing a case.
internal/lvgen/generate.go:797
↓ 2 callers
Function
AddProcEnumVal
AddProcEnumVal adds a procedure enum to our list of remote procedures which we will later generate code for. These declarations look like enums, but h
internal/lvgen/generate.go:639
↓ 2 callers
Function
AddVariableArray
AddVariableArray is called by the parser to add a variable-length array. Variable-length arrays are prefixed with a 32-bit unsigned length, and may al
internal/lvgen/generate.go:843
↓ 2 callers
Method
Agent
Agent adds the ssh agent auth method to the allowed list.
socket/dialers/gossh.go:190
↓ 2 callers
Method
ConnectDomainEventCallbackRegisterAny
ConnectDomainEventCallbackRegisterAny is the go wrapper for REMOTE_PROC_CONNECT_DOMAIN_EVENT_CALLBACK_REGISTER_ANY.
remote_protocol.gen.go:13873
↓ 2 callers
Method
ConnectListAllDomains
ConnectListAllDomains is the go wrapper for REMOTE_PROC_CONNECT_LIST_ALL_DOMAINS.
remote_protocol.gen.go:12494
↓ 2 callers
Method
DecodeDouble
DecodeDouble treats the next 8 bytes as an XDR encoded double-precision floating point and returns the result as a float64 along with the number of by
internal/go-xdr/xdr2/decode.go:291
↓ 2 callers
Method
DecodeFloat
DecodeFloat treats the next 4 bytes as an XDR encoded floating point and returns the result as a float32 along with the number of bytes actually read.
internal/go-xdr/xdr2/decode.go:268
↓ 2 callers
Method
DecodeHyper
DecodeHyper treats the next 8 bytes as an XDR encoded hyper value and returns the result as an int64 along with the number of bytes actually read. A
internal/go-xdr/xdr2/decode.go:219
↓ 2 callers
Method
DecodeUhyper
DecodeUhyper treats the next 8 bytes as an XDR encoded unsigned hyper value and returns the result as a uint64 along with the number of bytes actual
internal/go-xdr/xdr2/decode.go:244
↓ 2 callers
Method
EncodeDouble
EncodeDouble writes the XDR encoded representation of the passed 64-bit (double-precision) floating point to the encapsulated writer and returns the n
internal/go-xdr/xdr2/encode.go:263
↓ 2 callers
Method
EncodeFloat
EncodeFloat writes the XDR encoded representation of the passed 32-bit (single-precision) floating point to the encapsulated writer and returns the nu
internal/go-xdr/xdr2/encode.go:248
↓ 2 callers
Method
EncodeHyper
EncodeHyper writes the XDR encoded representation of the passed 64-bit signed integer to the encapsulated writer and returns the number of bytes writt
internal/go-xdr/xdr2/encode.go:186
↓ 2 callers
Function
IsNotFound
IsNotFound detects libvirt's ERR_NO_DOMAIN.
rpc.go:70
next →
1–100 of 1,030, ranked by callers