Documentation ¶
Index ¶
- Variables
- func BuildIndex(config index.Config, existingIdx *index.Index) (*index.Index, error)
- func BuildTestIndex(t *testing.T, config index.Config) *index.Index
- func Compare(one *index.Index, two *index.Index, ignoreMissing bool) bool
- func GetIndexFile(config index.Config, ext string) string
- func LoadConfig(configFile string) (index.Config, error)
- func LoadIndex(config index.Config, ext string) (idx *index.Index, err error)
- func LoadTestConfig(t *testing.T) (index.Config, func())
- func MakeFile(t *testing.T, path string, data string, perm os.FileMode) os.FileInfo
- func StoreIndex(idx *index.Index, config index.Config, ext string) error
- type HashFn
- type MissingFn
Constants ¶
This section is empty.
Variables ¶
var ConfigFile = "config.properties"
ConfigFile is the name of the config file used for testing.
Functions ¶
func BuildIndex ¶
BuildIndex creates an Index by walking the file system from Config.Root(). If an existing Index is passed in, only new & updated files will be scanned. Other files will use the existing Index's Entries.
func BuildTestIndex ¶
BuildTestIndex creates a file layout and builds the Index from those files.
func Compare ¶
Compare examines the Entries in the given Indexes and returns true if they are all the same.
func GetIndexFile ¶
GetIndexFile returns the filename that will be used by StoreIndex(). It outputs Config.SavePath() + "/" + Config.BaseName() + ext.
func LoadConfig ¶
LoadConfig loads the Config defined by the given file.
func LoadIndex ¶
LoadIndex loads the index defined by the given Config plus an (optional) identifier extension (e.g. _current, _known, etc).
func LoadTestConfig ¶
LoadTestConfig sets up a fake config file for use in tests. It links the index file system into Viper, saves 'config.properties' from the given string and then loads that file into a Config. The unction returned should is for test teardown and should be called via defer.