target

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Describe

func Describe(d config.Device) string

Describe renders a one-line status suffix for a card, which cannot report the firmware, heap, and signal a live device does.

func Label

func Label(d config.Device) string

Label names a device for display without opening it.

func NetworkClient

func NetworkClient(ctx context.Context, d config.Device) (*device.Client, error)

NetworkClient builds a client for a configured device, discovering it when no host is set.

Exported for the paths that are network-only by nature -- doctor reads the signal strength and free heap, which a card has no answer for.

Types

type Target

type Target interface {
	syncpkg.Transport
	ListRecursive(ctx context.Context, root device.Path) (map[device.Path]device.FileEntry, error)
	MkdirAll(ctx context.Context, p device.Path) error
	Download(ctx context.Context, p device.Path) (io.ReadCloser, error)
}

Target is everything a command needs from a place books can go.

Both a networked device and a mounted SD card satisfy it, which is what lets the planner, the manifest, and path pinning work identically over either. The interface lives here rather than in internal/sync because sync needs only the mutating subset; listing and downloading are the CLI's business. Target is a place books can go.

func Open

func Open(ctx context.Context, d config.Device, wantUUID string) (Target, string, error)

Open resolves a configured device to something writable, plus a label naming it for messages -- a host for a network device, a mount for a card.

wantUUID is the manifest's device UUID, used to catch a card that belongs to a different reader. Pass "" when no manifest has been loaded, which skips that check without weakening the others.

Jump to

Keyboard shortcuts

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