Conn is a connection to systemds dbus endpoint.
type Conn struct {
// contains filtered or unexported fields
}
func New() (*Conn, error)
New establishes a connection to the system bus and authenticates. Note: systemd-importd will be activated via D-Bus, we don't need to check service status.
func (c *Conn) CancelTransfer(transfer_id uint32) error
CancelTransfer will cancel an ongoing import, export or download operations.
func (c *Conn) Connected() bool
Connected returns whether conn is connected
func (c *Conn) ExportRaw( local_name string, f *os.File, format string, ) (*Transfer, error)
ExportRaw exports a raw image from systemd-importd.
func (c *Conn) ExportTar( local_name string, f *os.File, format string, ) (*Transfer, error)
ExportTar exports a tar from systemd-importd.
func (c *Conn) ImportRaw( f *os.File, local_name string, force, read_only bool, ) (*Transfer, error)
ImportRaw imports a raw image into systemd-importd.
func (c *Conn) ImportTar( f *os.File, local_name string, force, read_only bool, ) (*Transfer, error)
ImportTar imports a tar into systemd-importd.
func (c *Conn) ListTransfers() ([]TransferStatus, error)
ListTransfers will list ongoing import, export or download operations.
func (c *Conn) PullRaw( url, local_name, verify_mode string, force bool, ) (*Transfer, error)
PullRaw pulls a raw image into systemd-importd.
func (c *Conn) PullTar( url, local_name, verify_mode string, force bool, ) (*Transfer, error)
PullTar pulls a tar into systemd-importd.
Transfer is an object in dbus for an import, export or download operation.
type Transfer struct { Id uint32 // The numeric transfer ID of the transfer object Path dbus.ObjectPath // The dbus objectPath for the transfer }
TransferStatus is the status for an import, export or download operation.
type TransferStatus struct { Id uint32 // The numeric transfer ID of the transfer object Local string // The local container name of this transfer Remote string // The remote source (in case of download: the URL, in case of import/export a string describing the file descriptor passed in) Type string // The type of operation Verify string // The selected verification setting, and is only defined for download operations Progress float64 // The current progress of the transfer, as a value between 0.0 and 1.0 }