index

package
v0.0.0-...-97c84cb Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 11 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 {
	// contains filtered or unexported fields
}

func NewEntry

func NewEntry(path, hash, changeId string) Entry

func (Entry) ChangeId

func (e Entry) ChangeId() string

func (Entry) Hash

func (e Entry) Hash() string

func (Entry) Path

func (e Entry) Path() string

type Index

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

Index tracks changes made in files

func LoadIndexFile

func LoadIndexFile(filePath string) (Index, error)

LoadIndexFile loads entries from a specified path or creates a new index file

func New

func New(entryList []Entry) Index

func (Index) CalculateChanges

func (i Index) CalculateChanges(files []model.FileWithContent) model.Changes

CalculateChanges for a given list of files, finds model.Changes for those files comparing to version stored in Index

func (Index) Clear

func (i Index) Clear() error

Clear removes all files from index.

func (Index) CommitAdd

func (i Index) CommitAdd(changeId string, file model.HashedFile) error

CommitAdd marks change as complete.

func (Index) CommitDelete

func (i Index) CommitDelete(changeId string, file model.HashedFile) error

CommitDelete marks change as complete.

func (Index) IsChanged

func (i Index) IsChanged(file model.FileWithContent) bool

IsChanged returns true if the file was changed.

Jump to

Keyboard shortcuts

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