operation

package
v1.0.77 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string

Action is the type of operation being performed

const (
	Import      Action = "import"
	Update      Action = "update"
	Export      Action = "export"
	ExportVault Action = "export-vault"
	ImportVault Action = "import-vault"
	Delete      Action = "delete"
	Integrity   Action = "integrity"
)

type Details

type Details struct {
	ID          ID
	Action      Action
	Status      Status
	TimeStarted timestamp.Nano
	TimeEnded   timestamp.Nano
	VaultName   library.VaultName
	Disposable  bool
}

Details describes an operation's metadata

type Handle

type Handle struct {
	OperationID ID
	Context     context.Context
	TimeStarted timestamp.Nano
}

Handle provides operation context and metadata

type ID

type ID string

ID uniquely identifies an operation

const EmptyID ID = ""

type IdGenerator

type IdGenerator func() ID

IdGenerator creates unique operation IDs

type MutationApplier

type MutationApplier func(Mutator) error

type Mutator

type Mutator func(report *Report)

type Registry

type Registry interface {
	NewOperation(vault library.VaultName, action Action) Handle
	MutateReport(opID ID, mutator func(report *Report)) error
	MarkTerminated(opID ID) error
	Service
}

Registry manages operation lifecycle

type Report

type Report struct {
	Progress    int
	Total       int
	NoSuccesses int
	NoFailures  int

	NoValidURLs   int
	NoInvalidURLs int
	NoDuplicates  int
	NoUnchanges   int
	NoFixes       int

	AuxData []string
}

Report tracks operation progress and results

type Service

type Service interface {
	Cancel(opID ID) error
	ListReports() []UnifiedReport
	ActiveOperations() int
	HasChanges() bool
}

Service provides operation queries and cancellation

type Status

type Status string

Status indicates the current state of an operation

const (
	Ongoing   Status = "ONGOING"
	Completed Status = "COMPLETED"
	Cancelled Status = "CANCELLED"
)

type UnifiedReport

type UnifiedReport struct {
	Details Details
	Report  Report
}

UnifiedReport combines operation details and progress

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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