filereg

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

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

Registry keeps track of given files with their checksum

func New

func New() *Registry

func (*Registry) Add

func (r *Registry) Add(filePath string) (updated bool, err error)

Add returns (true,nil) if filePath either wasn't added or existed before but had a different checksum, otherwise returns (false,nil).

func (*Registry) Get

func (r *Registry) Get(filePath string) (checksum uint64, ok bool)

Get returns (checksum,true) if a file record exists for filePath, otherwise returns (0,false).

func (*Registry) Len

func (r *Registry) Len() int

Len returns the number of registered files.

func (*Registry) Remove

func (r *Registry) Remove(filePath string)

Remove removes filePath from the registry, if a record exists.

func (*Registry) RemoveWithPrefix

func (r *Registry) RemoveWithPrefix(prefix string)

RemoveWithPrefix removes all records with the given prefix.

func (*Registry) Reset

func (r *Registry) Reset()

Reset resets the registry removing all records.

Jump to

Keyboard shortcuts

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