go-pathfingerprint: github.com/dsoprea/go-pathfingerprint/internal/pfinternal Index | Files

package pfinternal

import "github.com/dsoprea/go-pathfingerprint/internal/pfinternal"

Index

Package Files

catalog.go catalog_containers.go catalog_resource.go change.go common.go hash.go log.go path.go

Constants

const (
    UpdateTypeError_ = iota

    UpdateTypeCreate = iota
    UpdateTypeUpdate = iota
    UpdateTypeDelete = iota
)
const (
    PathStateError_ = iota

    PathStateNew        = iota
    PathStateUpdated    = iota
    PathStateUnaffected = iota
)
const (
    EntityTypeFile = iota
    EntityTypePath = iota
)
const (
    Sha1Algorithm   = "sha1"
    Sha256Algorithm = "sha256"
)
const (
    CurrentSchemaVersion = 2
)
const (
    DbType = "sqlite3"
)
const (
    LogPackageVersion = 1
)
const (
    PathListBatchSize = 3
)

Variables

var ErrFileChanged = errors.New("mtime for filename does not match")
var ErrNoHash = errors.New("no hash recorded for the filename")

TODO(dustin): !! We ended-up going the other direction with our errors. Deimplement these?

func ConfigureRootLogger Uses

func ConfigureRootLogger()

func EntityTypeName Uses

func EntityTypeName(entityType int) string

func NewCatalogResource Uses

func NewCatalogResource(catalogFilepath *string, hashAlgorithm *string) (cr *catalogResource, err error)

func NewLogger Uses

func NewLogger(context string) log.Logger

func PathStateName Uses

func PathStateName(pathState int) string

func SetDebugLogging Uses

func SetDebugLogging()

func UpdateTypeName Uses

func UpdateTypeName(updateType int) string

type Catalog Uses

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

func NewCatalog Uses

func NewCatalog(catalogResource *catalogResource, scanPath *string, allowUpdates bool, hashAlgorithm *string, reportingChannel chan<- *ChangeEvent) (cp *Catalog, err error)

func (*Catalog) BranchCatalog Uses

func (self *Catalog) BranchCatalog(childPathName *string) (*Catalog, error)

func (*Catalog) Cleanup Uses

func (self *Catalog) Cleanup() (err error)

func (*Catalog) Close Uses

func (self *Catalog) Close() error

func (*Catalog) Open Uses

func (self *Catalog) Open() error

func (*Catalog) PruneOldFiles Uses

func (self *Catalog) PruneOldFiles() (err error)

Delete all file records that haven't been touched in this run (because all of the ones that match known files have been updated to a later timestamp than they had).

func (*Catalog) PruneOldPaths Uses

func (self *Catalog) PruneOldPaths() (err error)

Delete all path records that haven't been touched in this run (because all of the ones that match known files have been updated to a later timestamp than they had).

type ChangeEvent Uses

type ChangeEvent struct {
    EntityType int
    ChangeType int
    RelPath    string
}

type Path Uses

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

func NewPath Uses

func NewPath(hashAlgorithm *string, reportingChannel chan<- *ChangeEvent) *Path

func (*Path) GenerateFileHash Uses

func (self *Path) GenerateFileHash(filepath *string) (hash string, err error)

func (*Path) GeneratePathHash Uses

func (self *Path) GeneratePathHash(scanPath *string, relPath *string, existingCatalog *Catalog) (hash string, err error)

Generate a hash for a path.

Package pfinternal imports 16 packages (graph) and is imported by 2 packages. Updated 2017-11-07. Refresh now. Tools for package owners.