tracker

package
v1.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

type FileInfo struct {
	Path           string    `json:"path"`
	Hash           string    `json:"hash,omitempty"`
	Size           int64     `json:"size"`
	Modified       time.Time `json:"modified"`
	WasPreExisting bool      `json:"was_pre_existing,omitempty"`
}

FileInfo contains information about an installed file

type Installation

type Installation struct {
	Timestamp     time.Time           `json:"timestamp"`
	SourceCommit  string              `json:"source_commit,omitempty"`
	Files         map[string]FileInfo `json:"files"`
	Directories   []string            `json:"directories"`
	DocsGenerated []string            `json:"docs_generated,omitempty"`
}

Installation represents an installed source

type Tracker

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

Tracker manages installation tracking

func New

func New(filePath string) *Tracker

New creates a new tracker

func (*Tracker) Backup

func (t *Tracker) Backup() error

Backup creates a backup of the current tracking data

func (*Tracker) Clear

func (t *Tracker) Clear() error

Clear removes all tracking data

func (*Tracker) GetInstallation

func (t *Tracker) GetInstallation(sourceName string) (*Installation, error)

GetInstallation retrieves installation information for a source

func (*Tracker) GetInstalledFiles

func (t *Tracker) GetInstalledFiles(sourceName string) ([]string, error)

GetInstalledFiles returns all files installed by a source

func (*Tracker) IsInstalled

func (t *Tracker) IsInstalled(sourceName string) bool

IsInstalled checks if a source is installed

func (*Tracker) List

func (t *Tracker) List() (map[string]*Installation, error)

List returns all installations

func (*Tracker) RecordInstallation

func (t *Tracker) RecordInstallation(sourceName string, installation Installation) error

RecordInstallation records a new installation

func (*Tracker) RemoveInstallation

func (t *Tracker) RemoveInstallation(sourceName string) error

RemoveInstallation removes installation tracking for a source

func (*Tracker) Restore

func (t *Tracker) Restore(backupPath string) error

Restore restores tracking data from a backup

func (*Tracker) UpdateFile

func (t *Tracker) UpdateFile(sourceName, filePath string, info FileInfo) error

UpdateFile updates tracking for a single file

type TrackingData

type TrackingData struct {
	Version       string                   `json:"version"`
	LastUpdated   time.Time                `json:"last_updated"`
	Installations map[string]*Installation `json:"installations"`
}

TrackingData represents the complete tracking data

Jump to

Keyboard shortcuts

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