# Functions
DefaultNewBlockDataVersion returns the default data version for new blocks.
DirEntryMapToDirEntries returns a `DirEntries` slice of all the entries in the given map.
EntryInfoFromFileInfo converts an `os.FileInfo` into an `EntryInfo`, to the best of our ability to do so.
MakeConflictBranchName returns a branch name specifying a conflict date, if possible.
MakeRevBranchName returns a branch name specifying an archive branch pinned to the given revision number.
NewBlockCacheStandard constructs a new BlockCacheStandard instance with the given transient capacity (in number of entries) and the clean bytes capacity, which is the total of number of bytes allowed between the transient and permanent clean caches.
NewBlockSplitterSimple creates a new BlockSplittleSimple and adjusts the max size to try to match the desired size for file blocks, given the overhead of encoding a file block and the round-up padding we do.
NewBlockSplitterSimpleExact returns a BlockSplitterSimple with the max block size set to an exact value.
NewCommonBlock returns a generic block, unsuitable for caching.
NewCommonBlockForTesting returns a common block with some of the internal state set, which is useful for testing.
NewDirBlock creates a new, empty DirBlock.
NewDirBlockWithPtrs creates a new, empty DirBlock.
NewDirData creates a new DirData instance.
NewDirtyBlockCacheStandard constructs a new BlockCacheStandard instance.
NewDirtyFile constructs a new `DirtyFile` instance.
NewFileBlock creates a new, empty FileBlock.
NewFileBlockWithPtrs creates a new, empty FileBlock.
NewFileData makes a new file data object for the given `file` within the given `kmd`.
NewNodeObfuscator creates a new `NodeObfuscator` instance.
NewPathPartString creates a new `PathPartString` instance, given a plaintext string representing one part of a path, and a `Obfuscator`.
ReadyBlock is a thin wrapper around ReadyProvider.Ready() that handles checking for duplicates.
SimpleDirtyBlockCacheStandard that can only handle block put/get/delete requests; it cannot track dirty bytes.
SplitFileExtension splits filename into a base name and the extension.
# Constants
AtLeastTwoLevelsOfChildrenVer is the data version for blocks that have multiple levels of indirection below them (i.e., indirect blocks that point to other indirect blocks).
BackgroundTaskTimeout is the timeout for any background task.
BlockLookup indicates a lookup for a block for the purposes of creating a new node in the node cache for it; avoid any unlocks as part of the lookup process.
BlockRead indicates a block read request.
BlockReadParallel indicates a block read request that is happening from a different goroutine than the blockLock rlock holder, using the same lState.
BlockWrite indicates a block write request.
ChildHolesVer is the data version for any indirect block containing a set of pointers with holes.
Dir is a directory.
DirectBlock indicates the pointed-to block has no indirect pointers.
DoCacheHash means that the plaintext of a block should be hashed.
Exec is an executable file.
FakeDir can be used to indicate a faked-out entry for a directory, that will be specially processed by folderBranchOps.
FakeFile can be used to indicate a faked-out entry for a file, that will be specially processed by folderBranchOps.
File is a regular file.
FirstValidVer is the first value that is considered a valid data version.
IndirectBlock indicates the pointed-to block has indirect pointers.
IndirectDirsVer is the data version for a directory block that contains indirect pointers.
MasterBranch represents the mainline branch for a top-level folder.
MaxBlockSizeBytesDefault is the default maximum block size for KBFS.
MaxNameBytesDefault is the max supported size of a directory entry name.
NoCacheEntry means that the entry will not be cached.
PermanentEntry means that the cache entry must remain until explicitly removed from the cache.
SkipCacheHash means that the plaintext of a block should not be hashed.
Sym is a symbolic link.
TransientEntry means that the cache entry may be evicted at any time.
UnknownDirectType indicates an old block that was written before we started labeling pointers.
# Structs
BadDataError indicates that KBFS is storing corrupt data for a block.
BadSplitError indicates that the BlockSplitter has an error.
BlockCacheStandard implements the BlockCache interface by storing blocks in an in-memory LRU cache.
BlockInfo contains all information about a block in KBFS and its contents.
BlockPointer contains the identifying information for a block in KBFS.
BlockRef is a block ID/ref nonce pair, which defines a unique reference to a block.
BlockSplitterSimple implements the BlockSplitter interface by using a simple max-size algorithm to determine when to split blocks.
CachePutCacheFullError indicates that a cache put failed because the cache was full.
CommonBlock holds block data that is common for both subdirectories and files.
DirBlock is the contents of a directory.
DirData is a helper struct for accessing and manipulating data within a directory.
DirEntriesBySizeAsc sorts entries in order of ascending name.
DirEntriesBySizeDesc sorts entries in order of descending name.
DirEntry is all the data info a directory know about its child.
DirEntryWithName combines a DirEntry with the name pointing to that entry within a directory.
DirtyBlockCacheStandard implements the DirtyBlockCache interface by storing blocks in an in-memory cache.
DirtyFile represents a particular file that's been written to, but has not yet completed syncing its dirty blocks to the server.
EntryInfo is the (non-block-related) info a directory knows about its child.
FileBlock is the contents of a file.
FileData is a helper struct for accessing and manipulating data within a file.
FolderBranch represents a unique pair of top-level folder and a branch of that folder.
IndirectDirPtr pairs an indirect dir block with the start of that block's range of directory entries (inclusive).
IndirectFilePtr pairs an indirect file block with the start of that block's range of bytes (inclusive)
If `Holes` is true, then this pointer is part of a list of pointers that has non-continuous offsets; that is, the offset of ptr `i` plus the length of the corresponding block contents is less than the offset of ptr `i`+1.
NameExistsError indicates that the user tried to create an entry for a name that already existed in a subdirectory.
NodeObfuscator takes a secret, and uses it to create obfuscate strings based on BIP-0039 dictionary words.
NoSuchBlockError indicates that a block for the associated ID doesn't exist.
NotDirectFileBlockError indicates that a direct file block was expected, but something else (e.g., an indirect file block) was given instead.
ParentBlockAndChildIndex is a node on a path down the tree to a particular leaf node.
Path represents the full KBFS path to a particular location, so that a flush can traverse backwards and fix up ids along the way.
PathNode is a single node along an KBFS path, pointing to the top block for that node of the path.
PathPartString returns an obfuscated version of part of a path, preserving the suffixes if they're small enough or if it's a conflicted copy of a file.
PrevRevisionAndCount track the MD version of a previous revision of a dir entry, and how many revisions ago that was from the current revision.
ReadyBlockData is a block that has been encoded (and encrypted).
ShutdownHappenedError indicates that shutdown has happened.
WallClock is a wrapper around the built-in clock.
# Interfaces
Block just needs to be (de)serialized using msgpack.
BlockCache specifies the interface of BlockCacheSimple, and also more advanced and internal methods.
BlockCacheSimple gets and puts plaintext dir blocks and file blocks into a cache.
BlockPutState is an interface for keeping track of readied blocks before putting them to the bserver.
BlockSplitter decides when a file block needs to be split.
BlockWithPtrs defines methods needed for interacting with indirect pointers.
DirtyBlockCache gets and puts plaintext dir blocks and file blocks into a cache, which have been modified by the application and not yet committed on the KBFS servers.
DirtyBlockCacheSimple is a bare-bones interface for a dirty block cache.
IsDirtyProvider defines a method for checking whether a given pointer is dirty.
Obfuscator can transform a given plaintext string into a securely-obfuscated, but still human-readable, string.
Offset is a generic representation of an offset to an indirect pointer within an indirect Block.
ReadyProvider defines a method for readying a block.
Versioner defines a method for getting the version of some piece of data.
# Type aliases
BlockCacheHashBehavior denotes whether the cache should hash the plaintext of a new block or not.
BlockCacheLifetime denotes the lifetime of an entry in BlockCache.
BlockDirectType indicates to what kind of block (direct or indirect) a BlockPointer points.
BlockReqType indicates whether an operation makes block modifications or not.
BranchName is the name given to a KBFS branch, for a particular top-level folder.
DirEntries is a slice of `DirEntryWithName` instances.
EntryType is the type of a directory entry.
FileBlockGetter is a function that gets a block suitable for reading or writing, and also returns whether the block was already dirty.
Int64Offset represents the offset of a block within a file.
NodeObfuscatorSecret is a byte slice wrapper for a secret that can be passed to `NodeObfuscator`.
PrevRevisions tracks several previous versions of a file in order of descending revision number, starting with the most recent.
StringOffset represents the offset of a block within a directory.
Ver is the type of a version for marshalled KBFS data structures.