package
4.3.2+incompatible
Repository: https://github.com/qbit/client.git
Documentation: pkg.go.dev

# README

Common library code useful to any file system presentation layer for KBFS.

(TODO: Fill in more details.)

# Functions

AddRootWrapper should be called on startup by any KBFS interface that wants to handle special files.
BranchNameFromArchiveRefDir returns a branch name and true if the given directory name is specifying an archived revision with a revision number.
Deobfuscate returns a set of possible plaintext paths, given an obfuscated path as input.
EnableFastMode returns a context.Context based on ctx that will test to true with IsFastModeEnabled.
FileDataFromRelativeTimeString returns a byte string containing the name of a revision-based archive directory, and true, if the given file name specifies a valid by-relative-time file name.
FilterTLFEarlyExitError decides whether an error received while trying to create a TLF should result in showing the user an empty folder (exitEarly == true), or not.
GetEncodedErrors gets the list of encoded errors in a format suitable for error file.
GetEncodedFolderStatus returns serialized JSON containing status information for a folder.
GetEncodedMetrics returns metrics encoded as bytes for metrics file.
GetEncodedStatus returns serialized JSON containing top-level KBFS status information.
GetEncodedTlfEditHistory returns serialized JSON containing the file edit history for a folder.
GetEncodedUpdateHistory returns a JSON-encoded version of a TLF's complete update history.
GetEncodedUserEditHistory returns serialized JSON containing the file edit history for the user.
GetFileInfo returns serialized JSON containing status information for a file or directory entry.
InitError is for initialization errors.
IsFastModeEnabled returns true if fast mode should be enabled.
IsSupportedProfileName matches a string against allowed profile names.
IsWriter returns whether or not the currently logged-in user is a valid writer for the folder described by `h`.
LinkTargetFromTimeString returns the name of a by-revision archive directory, and true, if the given link specifies a valid by-time link name.
MountError is for mount errors.
NewFS returns a new FS instance, chroot'd to the given TLF and subdir within that TLF.
NewFSIfExists returns a new FS instance, chroot'd to the given TLF and subdir within that TLF, but only if the TLF already exists.
NewFSNotifications creates a new FSNotifications object.
NewMountInterrupter creates a new MountInterrupter.
NewReadonlyFS returns a new FS instance, chroot'd to the given TLF and subdir within that TLF, but all the nodes are read-only.
NewRootFS creates a new RootFS instance.
NewUnwrappedFS returns a new FS instance, chroot'd to the given TLF and subdir within that TLF, but all the nodes are unwrapped.
PrettyJSON marshals a value to human-readable JSON.
ProfileGet gets the relevant read function for the profile or nil if it doesn't exist.
RecursiveDelete deletes the given entry from the given filesystem.
RevFromRelativeTimeString turns a string describing a time in the past relative to now (e.g., "5m", "2h55s"), and turns it into a revision number for the given TLF.
RevFromTimeString converts a time string (in any supported golang date format) to the earliest revision number with a server timestamp greater or equal to that time.
TimeEqual compares two filesystem-related timestamps.
UnstageForTesting unstages all unmerged commits and fast-forwards to the current master, if the given data is non-empty.
WritePermMode fills in original based on whether or not the currently logged-in user is a valid writer for the folder described by `h`.

# Constants

ArchivedRelTimeFilePrefix is the prefix to the file at the root of a TLF that contains the directory name of an archived revision described by the given relative time.
ArchivedRevDirPrefix is the prefix to the directory at the root of a TLF that exposes a version of that TLF at the specified revision.
ArchivedTimeLinkPrefix is the prefix to the symlink at the root of a TLF that links to a version of that TLF at the specified time.
CtxAppIDKey is the context app id.
DisableAutoJournalsFileName is the name of the KBFS-wide auto-journal-disabling file.
DisableBlockPrefetchingFileName is the name of the KBFS-wide prefetching-disabling file.
DisableDebugServerFileName is the name of the file to turn on the debug HTTP server.
DisableJournalFileName is the name of the journal-disabling file.
DisableSyncFileName is the name of the file to disable the sync cache for a TLF.
DisableUpdatesFileName is the name of the KBFS update-disabling file -- it can be reached anywhere within a top-level folder.
EditHistoryName is the name of the KBFS TLF edit history file -- it can be reached anywhere within a top-level folder.
EnableAutoJournalsFileName is the name of the KBFS-wide auto-journal-enabling file.
EnableBlockPrefetchingFileName is the name of the KBFS-wide prefetching-enabling file.
EnableDebugServerFileName is the name of the file to turn on the debug HTTP server.
EnableJournalFileName is the name of the journal-enabling file.
EnableSyncFileName is the name of the file to enable the sync cache for a TLF.
EnableUpdatesFileName is the name of the KBFS update-enabling file -- it can be reached anywhere within a top-level folder.
FileInfoPrefix is the prefix of the per-file metadata files.
FlushJournalFileName is the name of the journal-flushing file.
FSEventLock indicates Lock method has been called.
FSEventUnlock indicates Unlock method has been called.
Special files in root directory.
Special files in root directory.
InitErrorCode is the error code for initialization errors.
JournalDisable is to disable the journal.
JournalDisableAuto is to turn off automatic journaling for new TLFs.
JournalEnable is to turn the journal on.
JournalEnableAuto is to turn on journals for all TLFs, persistently.
JournalFlush is to flush the journal.
JournalPauseBackgroundWork is to pause journal background work.
JournalResumeBackgroundWork is to resume journal background work.
MetricsFileName is the name of the KBFS metrics file -- it can be reached from any KBFS directory.
MountErrorCode is the error code for mount errors.
PauseJournalBackgroundWorkFileName is the name of the file that pauses the background work of a journal.
ProfileListDirName is the name of the KBFS profile directory -- it can be reached from any KBFS directory.
ReclaimQuotaFileName is the name of the KBFS quota-reclaiming file -- it can be reached anywhere within a top-level folder.
RekeyFileName is the name of the KBFS rekeying file -- it can be reached anywhere within a top-level folder.
ResetCachesFileName is the name of the KBFS unstaging file.
ResumeJournalBackgroundWorkFileName is the name of the file that resumes the background work of a journal.
StatusFileName is the name of the KBFS status file -- it can be reached anywhere within a top-level folder or inside the Keybase root.
SyncDisable is to disable syncing for a TLF.
SyncEnable is to enable syncing for a TLF.
SyncFromServerFileName is the name of the KBFS sync-from-server file -- it can be reached anywhere within a top-level folder.
UnstageFileName is the name of the KBFS unstaging file -- it can be reached anywhere within a top-level folder.
UpdateHistoryFileName is the name of the KBFS update history -- it can be reached anywhere within a top-level folder.

# Variables

ErrUnknownPrefetchStatus is returned when the prefetch status given by the KBFSOps's NodeMetadata is invalid.

# Structs

ErrNotADirectory is returned when a non-final path element exists but is not a directory.
Error defines errors with codes.
File is a wrapper around a libkbfs.Node that implements the billy.File interface.
FileInfo is a wrapper around libkbfs.EntryInfo that implements the os.FileInfo interface.
FileInfoFast always returns a returns a read-only mode, and doesn't populate LastWriterUnverified.
FS is a wrapper around a KBFS subdirectory that implements the billy.Filesystem interface.
FSEvent is the type for events sent into the events channel passed into NewFS.
FSNotifications processes notifications (arbitrary functions, usually triggered by libkbfs) and lets other objects block on them, usually for testing.
JSONReportedError stringifies the reported error before marshalling.
KBFSMetadataForSimpleFS contains the KBFS metadata needed to answer a simpleFSStat call.
MountInterrupter is for managing mounts with cancelation.
RemoteStatus is for maintaining status of various remote connections like keybase service and md-server.
RootFS is a browseable (read-only) version of `/keybase`.
TlfDoesNotExist is a shortcut error for the cases a TLF does not exist and an early successful exit via FilterTLFEarlyExitError is wished.

# Interfaces

KBFSMetadataForSimpleFSGetter is an interface for something that can return the last KBFS writer and prefetch status of a directory entry.
Mounter is the interface for filesystems to be mounted by MountInterrupter.
PrevRevisionsGetter is an interface for something that can return the previous revisions of an entry.
RemoteStatusUpdater has callbacks that will be called from libfs when kbfs status changes in interesting ways.

# Type aliases

CtxAppIDType is the type used for the app ID context tag.
FSEventType is FS event type.
JournalAction enumerates all the possible actions to take on a TLF's journal.
SyncAction enumerates all the possible actions to take on a TLF's sync state.