Dobby
3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
|
Public Types | |
enum class | BusType { NoneBus , SystemBus , AIPrivateBus , AIPublicBus } |
The type of dbus to call methods on / emit signals. | |
Public Member Functions | |
virtual std::shared_ptr< AI_IPC::IAsyncReplyGetter > | ipcInvokeMethod (const BusType &bus, const AI_IPC::Method &method, const AI_IPC::VariantList &args, int timeoutMs=-1) const =0 |
Wrappers around the IPC services in the Dobby daemon. More... | |
virtual bool | ipcInvokeMethod (const BusType &bus, const AI_IPC::Method &method, const AI_IPC::VariantList &args, AI_IPC::VariantList &replyArgs) const =0 |
Invokes the ipc method. More... | |
virtual bool | ipcEmitSignal (const BusType &bus, const AI_IPC::Signal &signal, const AI_IPC::VariantList &args) const =0 |
Sends out a signal over dbus. More... | |
virtual bool | ipcServiceAvailable (const BusType &bus, const std::string &serviceName) const =0 |
Queries if the given service is available on the bus. More... | |
virtual int | ipcRegisterServiceHandler (const BusType &bus, const std::string &serviceName, const std::function< void(bool)> &handlerFunc)=0 |
Registers a callback function that will be called when the given service is added or removed from the bus. More... | |
virtual int | ipcRegisterSignalHandler (const BusType &bus, const AI_IPC::Signal &signal, const AI_IPC::SignalHandler &handlerFunc)=0 |
Registers a callback function that will be called when the given signal is received on the bus. More... | |
virtual void | ipcUnregisterHandler (const BusType &bus, int handlerId)=0 |
Unregisters either a service or signal handler. More... | |
virtual std::string | ipcDbusAddress (const BusType &bus) const =0 |
Returns complete address to the dbus daemon. More... | |
virtual std::string | ipcDbusSocketPath (const BusType &bus) const =0 |
Returns just the path to the socket for the dbus daemon. More... | |
|
pure virtual |
Returns complete address to the dbus daemon.
[in] | bus | The bus to get the socket path for. |
Implemented in DobbyIPCUtils.
|
pure virtual |
Returns just the path to the socket for the dbus daemon.
[in] | bus | The bus to get the socket path for. |
Implemented in DobbyIPCUtils.
|
pure virtual |
Sends out a signal over dbus.
This is a pure wrapper around the IpcService::emitSignal function.
[in] | bus | The bus to emit the signal on. |
[in] | signal | The signal details. |
[in] | args | The signal args. |
Implemented in DobbyIPCUtils.
|
pure virtual |
Invokes the ipc method.
This is a pure wrapper around the IpcService::invokeMethod function.
[in] | bus | The bus call the method on. |
[in] | method | The method to call. |
[in] | args | The method args |
[out] | replyArgs | The reply. |
Implemented in DobbyIPCUtils.
|
pure virtual |
Wrappers around the IPC services in the Dobby daemon.
We provide these as wrappers so that hooks don't have to spin up their own connections to a particular bus, instead they can use the service threads already created inside the Dobby daemon.
TODO: flesh out a bit more
Implemented in DobbyIPCUtils.
|
pure virtual |
Registers a callback function that will be called when the given service is added or removed from the bus.
This in turn is useful for hooks to manage situations where the daemon they are talking to has crashed / restarted.
Case in point is the Jumper hook, it wants to know if the daemon has crashed so it doesn't block container startup by trying to talk to a nonexisting daemon. And likewise it wants to know when it's arrived back so it can re-create any state stored in the daemon.
To remove the handler call ipcUnregisterHandler with the handler id returned by this function.
[in] | bus | The bus to watch the service on. |
[in] | serviceName | The name of the service to look out for. |
[in] | handlerFunc | Callback function called when the service is added or removed. If added the argument supplied will be true, if removed it will be false. |
Implemented in DobbyIPCUtils.
|
pure virtual |
Registers a callback function that will be called when the given signal is received on the bus.
This is a pure wrapper around the IpcService.registerSignalHandler function.
[in] | bus | The bus to watch for the signal on. |
[in] | signal | The signal details to watch for. |
[in] | handlerFunc | Callback function called when the signal is received. |
Implemented in DobbyIPCUtils.
|
pure virtual |
Queries if the given service is available on the bus.
This is a pure wrapper around the IpcService::serviceAvailable function.
[in] | bus | The bus to check. |
[in] | serviceName | The service to query. |
Implemented in DobbyIPCUtils.
|
pure virtual |
Unregisters either a service or signal handler.
[in] | bus | The bus to remove the handler for. |
[in] | handlerId | The integer handler id returned by the register function. |
Implemented in DobbyIPCUtils.