Documentation ¶
Overview ¶
Package import1 provides integration with the systemd-importd API. See https://www.freedesktop.org/wiki/Software/systemd/importd/ Note: Requires systemd v231 or higher
Index ¶
- type Conn
- func (c *Conn) CancelTransfer(transfer_id uint32) error
- func (c *Conn) ExportRaw(local_name string, f *os.File, format string) (*Transfer, error)
- func (c *Conn) ExportTar(local_name string, f *os.File, format string) (*Transfer, error)
- func (c *Conn) ImportRaw(f *os.File, local_name string, force, read_only bool) (*Transfer, error)
- func (c *Conn) ImportTar(f *os.File, local_name string, force, read_only bool) (*Transfer, error)
- func (c *Conn) ListTransfers() ([]TransferStatus, error)
- func (c *Conn) PullRaw(url, local_name, verify_mode string, force bool) (*Transfer, error)
- func (c *Conn) PullTar(url, local_name, verify_mode string, force bool) (*Transfer, error)
- type Transfer
- type TransferStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a connection to systemds dbus endpoint.
func New ¶
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 (*Conn) CancelTransfer ¶
CancelTransfer will cancel an ongoing import, export or download operations.
func (*Conn) ImportRaw ¶
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 (*Conn) ImportTar ¶
func (c *Conn) ImportTar( f *os.File, local_name string, force, read_only bool, ) (*Transfer, error)
ImportTar imports a tar into systemd-importd.
func (*Conn) ListTransfers ¶
func (c *Conn) ListTransfers() ([]TransferStatus, error)
ListTransfers will list ongoing import, export or download operations.
type Transfer ¶
type Transfer struct { Id uint32 // The numeric transfer ID of the transfer object Path dbus.ObjectPath // The dbus objectPath for the transfer }
Transfer is an object in dbus for an import, export or download operation.
type TransferStatus ¶
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 }
TransferStatus is the status for an import, export or download operation.