package import1

import "github.com/coreos/go-systemd/v22/import1"

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

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

Conn is a connection to systemds dbus endpoint.

func New

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 (*Conn) CancelTransfer

func (c *Conn) CancelTransfer(transfer_id uint32) error

CancelTransfer will cancel an ongoing import, export or download operations.

func (*Conn) Connected

func (c *Conn) Connected() bool

Connected returns whether conn is connected

func (*Conn) ExportRaw

func (c *Conn) ExportRaw(
	local_name string, f *os.File, format string,
) (*Transfer, error)

ExportRaw exports a raw image from systemd-importd.

func (*Conn) ExportTar

func (c *Conn) ExportTar(
	local_name string, f *os.File, format string,
) (*Transfer, error)

ExportTar exports a tar from systemd-importd.

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.

func (*Conn) PullRaw

func (c *Conn) PullRaw(
	url, local_name, verify_mode string, force bool,
) (*Transfer, error)

PullRaw pulls a raw image into systemd-importd.

func (*Conn) PullTar

func (c *Conn) PullTar(
	url, local_name, verify_mode string, force bool,
) (*Transfer, error)

PullTar pulls a tar into systemd-importd.

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.

Source Files

dbus.go

Version
v22.4.0
Published
Sep 16, 2022
Platform
darwin/amd64
Imports
5 packages
Last checked
2 minutes ago

Tools for package owners.