Documentation ¶
Overview ¶
Package index contains files responsible for maintaining the database document index
Index ¶
- func ResolveReferences(jsonVal interface{}, depthLeft int) interface{}
- type File
- type FileIndex
- func (i *FileIndex) Delete(file *File) error
- func (i *FileIndex) List() (res []string)
- func (i *FileIndex) Lookup(key string) (*File, bool)
- func (i *FileIndex) Put(file *File, bytes []byte) error
- func (i *FileIndex) Regenerate()
- func (i *FileIndex) RegenerateNew(dir string)
- func (i *FileIndex) SetFileSystem(fs af.Fs)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveReferences ¶
func ResolveReferences(jsonVal interface{}, depthLeft int) interface{}
ResolveReferences tries to find key references and if found, replace the references with their corresponding value
Types ¶
type File ¶
type File struct { FileName string // contains filtered or unexported fields }
File stores the filename as well as a read-write mutex
func (*File) GetByteArray ¶
GetByteArray returns the byte array of given file
func (*File) ReplaceContent ¶
ReplaceContent changes the contents of file f to be str
func (*File) ResolvePath ¶
ResolvePath returns a string representing the path to file
type FileIndex ¶
FileIndex is holds the actual index mapping for keys to files
var I *FileIndex
I is the global database index which keeps track of which files are where
func NewFileIndex ¶
NewFileIndex returns a reference to a new file index
func (*FileIndex) Lookup ¶
Lookup returns the file with that key Returns (File, true) if file exists otherwise, returns new File, false
func (*FileIndex) Regenerate ¶
func (i *FileIndex) Regenerate()
Regenerate rebuilds the current file index from current directory by crawling it for any .json files
func (*FileIndex) RegenerateNew ¶
RegenerateNew rebuilds the file index at a new given directory
func (*FileIndex) SetFileSystem ¶
SetFileSystem sets the file system for the given FileIndex