meta

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainDB

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

ChainDB chains a RepoDB and a fallback DB, always querying the first, and falling back to querying the second. This i.e. allows to chain a FSDB and a RepoDB to both handle files that are already committed and those that are not, yet.

func NewChainDB

func NewChainDB(db0 *RepoDB, db1 DB) *ChainDB

func (*ChainDB) Modified

func (db *ChainDB) Modified(path string) (time.Time, error)

func (*ChainDB) Refresh

func (db *ChainDB) Refresh() error

type DB

type DB interface {
	Modified(string) (time.Time, error)
	Refresh() error
}

DB stores information about files and directories.

type FSDB

type FSDB struct{}

FSDB will extract information from the underlying file system.

func NewFSDB

func NewFSDB() *FSDB

func (*FSDB) Modified

func (db *FSDB) Modified(path string) (time.Time, error)

Modified will look at the directory's and all files modification times, and recursive into each contained directory's to return the most recent modified time.

This function has different semantics than the file system's mtime: Most file systems change the mtime of the directory when a new file or directory is created inside it, the mtime will not change when a file has been modified.

It will not descend into directories it considers hidden (their name is prefixed by a dot), except when the given directory itself is dot-hidden.

func (*FSDB) Refresh

func (db *FSDB) Refresh() error

type NoopDB

type NoopDB struct{}

NoopDB will extract information from the underlying file system.

func NewNoopDB

func NewNoopDB() *NoopDB

func (*NoopDB) Modified

func (db *NoopDB) Modified(path string) (time.Time, error)

func (*NoopDB) Refresh

func (db *NoopDB) Refresh() error

type RepoDB

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

RepoDB uses the information from a repository to extract better meta data.

func NewRepoDB

func NewRepoDB(r *vcs.Repo) *RepoDB

func (*RepoDB) Modified

func (db *RepoDB) Modified(path string) (time.Time, error)

func (*RepoDB) ModifiedWithContext

func (db *RepoDB) ModifiedWithContext(ctx context.Context, path string) (time.Time, error)

func (*RepoDB) Refresh

func (db *RepoDB) Refresh() error

Jump to

Keyboard shortcuts

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