import1

package
v0.0.0-...-d3cd4ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2019 License: Apache-2.0 Imports: 5 Imported by: 1

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

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

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) 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL