Documentation ¶
Overview ¶
Package filetree implements a lookup table for files in a tree structure.
Table format:
dirs:<corpus>\n<root>\n<path> -> srvpb.FileDirectory dirs:corpusRoots -> srvpb.CorpusRoots
Index ¶
Constants ¶
View Source
const ( // DirTablePrefix is used as the prefix of the keys of a combined serving // table. CorpusRootsPrefixedKey and PrefixedDirKey use this prefix to // construct their keys. Table uses this prefix when PrefixedKeys is true. DirTablePrefix = "dirs:" )
Variables ¶
View Source
var CorpusRootsKey = []byte("corpusRoots")
CorpusRootsKey is the filetree lookup key for the tree's srvpb.CorpusRoots.
View Source
var CorpusRootsPrefixedKey = []byte(DirTablePrefix + "corpusRoots")
CorpusRootsPrefixedKey is the filetree lookup key for the tree's srvpb.CorpusRoots when using PrefixedKeys.
Functions ¶
func PrefixedDirKey ¶ added in v0.0.16
PrefixedDirKey returns the filetree lookup table key for the given corpus path, prefixed by DirTablePrefix.
Types ¶
type Table ¶
type Table struct { table.Proto // PrefixedKeys indicates whether all keys are prefixed by DirTablePrefix // (i.e. when using a combined serving table). PrefixedKeys bool }
Table implements the FileTree interface using a static lookup table.
func (*Table) CorpusRoots ¶
func (t *Table) CorpusRoots(ctx context.Context, req *ftpb.CorpusRootsRequest) (*ftpb.CorpusRootsReply, error)
CorpusRoots implements part of the filetree Service interface.
func (*Table) Directory ¶
func (t *Table) Directory(ctx context.Context, req *ftpb.DirectoryRequest) (*ftpb.DirectoryReply, error)
Directory implements part of the filetree Service interface.
Click to show internal directories.
Click to hide internal directories.