files

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Old    uint32
	New    uint32
	Status uint32
}

Entry represents a single file reconciliation result. For Unchanged and Updated entries, Old and New will contain file indices. For Removed entries, New will be null (using the sentinel value of 0xFFFFFFFF). For Added entries, Old will be null (using the sentinel value of 0xFFFFFFFF).

type Result

type Result struct {
	E []Entry          // All Unchanged, Updated, Removed, and Added entries
	C [4]atomic.Uint32 // Counts of the above statuses indexed by their respecive integer values
}

Result contains the final reconciliation output for a collection of old and new files.

func Diff

func Diff(old, cur []string) *Result

Diff compares two file lists and returns a Result containing all reconciliation entries.

func (*Result) All

func (r *Result) All() iter.Seq2[Status, Entry]

All returns an iterator over all entries with their status.

func (*Result) Count

func (r *Result) Count(s Status) uint32

Count returns the number of entries with the given status.

func (*Result) Filter

func (r *Result) Filter(s Status) iter.Seq[Entry]

Filter returns an iterator over entries with a specific status.

type Status

type Status uint8
const (
	Unchanged Status = iota
	Updated
	Removed
	Added
)

Jump to

Keyboard shortcuts

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