safaritabs

package
v0.8.21 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 24 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 ListDevices

func ListDevices(ctx context.Context, cfg config.Config, opts Options) ([]Device, SnapshotInfo, error)

func NewAuditInventory added in v0.7.0

func NewAuditInventory(cfg config.Config, opts Options) audit.UpstreamInventory

NewAuditInventory returns a read-only Safari iCloud Tabs inventory for one explicitly configured device. It snapshots CloudTabs exactly once per run.

Types

type Device

type Device struct {
	UUID                string    `json:"uuid"`
	Name                string    `json:"name"`
	TypeIdentifier      string    `json:"type_identifier"`
	HasDuplicateName    bool      `json:"has_duplicate_name"`
	IsEphemeral         bool      `json:"is_ephemeral"`
	LastModified        time.Time `json:"last_modified"`
	TabCount            int       `json:"tab_count"`
	OldestTabLastViewed time.Time `json:"oldest_tab_last_viewed,omitempty"`
	NewestTabLastViewed time.Time `json:"newest_tab_last_viewed,omitempty"`
}

type Options

type Options struct {
	DBPath       string
	SnapshotDir  string
	KeepSnapshot bool
	Device       string
	Limit        int
	OlderThan    time.Duration
	DryRun       bool
	ShowTitles   bool
	Force        bool
	Progress     ProgressFunc
}

type ProgressEvent

type ProgressEvent struct {
	Phase     string `json:"phase"`
	Index     int    `json:"index,omitempty"`
	Total     int    `json:"total,omitempty"`
	SourceKey string `json:"source_key,omitempty"`
	Title     string `json:"title,omitempty"`
	URL       string `json:"url,omitempty"`
	Status    string `json:"status,omitempty"`
	Reason    string `json:"reason,omitempty"`
	Rendered  bool   `json:"rendered,omitempty"`
}

type ProgressFunc

type ProgressFunc func(ProgressEvent)

type SnapshotInfo

type SnapshotInfo struct {
	SourceDBPath string   `json:"source_db_path"`
	Dir          string   `json:"dir"`
	DBPath       string   `json:"db_path"`
	CopiedFiles  []string `json:"copied_files"`
	Kept         bool     `json:"kept"`
}

type Stats

type Stats struct {
	SourceDBPath  string       `json:"source_db_path"`
	Snapshot      SnapshotInfo `json:"snapshot"`
	DevicesSeen   int          `json:"devices_seen"`
	DeviceName    string       `json:"device_name"`
	DeviceUUID    string       `json:"device_uuid"`
	TabsSeen      int          `json:"tabs_seen"`
	TabsMatched   int          `json:"tabs_matched"`
	TabsImported  int          `json:"tabs_imported"`
	TabsCreated   int          `json:"tabs_created"`
	TabsUpdated   int          `json:"tabs_updated"`
	TabsUnchanged int          `json:"tabs_unchanged"`
	TabsRendered  int          `json:"tabs_rendered"`
	TabsSkipped   int          `json:"tabs_skipped"`
	LinksFound    int          `json:"links_found"`
	SampleTitles  []string     `json:"sample_titles,omitempty"`
	DryRun        bool         `json:"dry_run"`
	Applied       bool         `json:"applied"`
	Errors        int          `json:"errors"`
}

func Run

func Run(ctx context.Context, cfg config.Config, st *store.Store, opts Options) (Stats, error)

type Tab

type Tab struct {
	UUID            string    `json:"uuid"`
	DeviceUUID      string    `json:"device_uuid"`
	DeviceName      string    `json:"device_name"`
	DeviceType      string    `json:"device_type"`
	Title           string    `json:"title"`
	URL             string    `json:"url"`
	IsShowingReader bool      `json:"is_showing_reader"`
	IsPinned        bool      `json:"is_pinned"`
	SceneID         string    `json:"scene_id,omitempty"`
	LastViewed      time.Time `json:"last_viewed,omitempty"`
}

Jump to

Keyboard shortcuts

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