index

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileHash

func FileHash(path string) (string, error)

func LoadIgnorePatterns

func LoadIgnorePatterns() ([]string, error)

Types

type Change

type Change struct {
	Path       string     `json:"path"`
	Type       ChangeType `json:"type"`
	LocalHash  string     `json:"local_hash,omitempty"`
	RemoteHash string     `json:"remote_hash,omitempty"`
}

func DetectChanges

func DetectChanges(root string, ignorePatterns []string) ([]Change, error)

type ChangeType

type ChangeType int
const (
	Added ChangeType = iota
	Modified
	Deleted
	Unchanged
)

func (ChangeType) String

func (ct ChangeType) String() string

type FileEntry

type FileEntry struct {
	Hash  string `json:"hash"`
	Mtime int64  `json:"mtime"`
	Size  int64  `json:"size"`
}

type Index

type Index struct {
	Files map[string]*FileEntry `json:"files"`
}

func BuildIndex

func BuildIndex(root string, ignorePatterns []string) (*Index, error)

func Load

func Load() (*Index, error)

func New

func New() *Index

func (*Index) Save

func (idx *Index) Save() error

Jump to

Keyboard shortcuts

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