Documentation ¶
Index ¶
- Constants
- func FilterTLFEarlyExitError(ctx context.Context, err error, log logger.Logger, ...) (exitEarly bool, retErr error)
- func GetEncodedErrors(config libkbfs.Config) func(context.Context) ([]byte, time.Time, error)
- func GetEncodedFolderStatus(ctx context.Context, config libkbfs.Config, folderBranch libkbfs.FolderBranch) (data []byte, t time.Time, err error)
- func GetEncodedMetrics(config libkbfs.Config) func(context.Context) ([]byte, time.Time, error)
- func GetEncodedStatus(ctx context.Context, config libkbfs.Config) (data []byte, t time.Time, err error)
- func GetEncodedTlfEditHistory(ctx context.Context, config libkbfs.Config, folderBranch libkbfs.FolderBranch) (data []byte, t time.Time, err error)
- func IsSupportedProfileName(name string) bool
- func PrettyJSON(value interface{}) ([]byte, error)
- func ProfileGet(name string) func(context.Context) ([]byte, time.Time, error)
- func TimeEqual(a, b time.Time) bool
- func UnstageForTesting(ctx context.Context, log logger.Logger, config libkbfs.Config, ...) (int, error)
- type CtxAppIDType
- type Error
- type FSNotifications
- type JSONReportedError
- type JournalAction
- type RemoteStatus
- type RemoteStatusUpdater
- type TlfDoesNotExist
Constants ¶
const ( // InitErrorCode is the error code for initialization errors InitErrorCode = 1 // MountErrorCode is the error code for mount errors MountErrorCode = 2 )
const ( HumanErrorFileName = "kbfs.error.txt" HumanNoLoginFileName = "kbfs.nologin.txt" )
Special files in root directory.
const DisableAutoJournalsFileName = ".kbfs_disable_auto_journals"
DisableAutoJournalsFileName is the name of the KBFS-wide auto-journal-disabling file. It's accessible anywhere outside a TLF.
const DisableBlockPrefetchingFileName = ".kbfs_disable_block_prefetching"
DisableBlockPrefetchingFileName is the name of the KBFS-wide prefetching-disabling file. It's accessible anywhere outside a TLF.
const DisableJournalFileName = ".kbfs_disable_journal"
DisableJournalFileName is the name of the journal-disabling file. It can be reached anywhere within a top-level folder.
const DisableUpdatesFileName = ".kbfs_disable_updates"
DisableUpdatesFileName is the name of the KBFS update-disabling file -- it can be reached anywhere within a top-level folder.
const EditHistoryName = ".kbfs_edit_history"
EditHistoryName is the name of the KBFS TLF edit history file -- it can be reached anywhere within a top-level folder.
const EnableAutoJournalsFileName = ".kbfs_enable_auto_journals"
EnableAutoJournalsFileName is the name of the KBFS-wide auto-journal-enabling file. It's accessible anywhere outside a TLF.
const EnableBlockPrefetchingFileName = ".kbfs_enable_block_prefetching"
EnableBlockPrefetchingFileName is the name of the KBFS-wide prefetching-enabling file. It's accessible anywhere outside a TLF.
const EnableJournalFileName = ".kbfs_enable_journal"
EnableJournalFileName is the name of the journal-enabling file. It can be reached anywhere within a top-level folder.
const EnableUpdatesFileName = ".kbfs_enable_updates"
EnableUpdatesFileName is the name of the KBFS update-enabling file -- it can be reached anywhere within a top-level folder.
const FileInfoPrefix = ".kbfs_fileinfo_"
FileInfoPrefix is the prefix of the per-file metadata files.
const FlushJournalFileName = ".kbfs_flush_journal"
FlushJournalFileName is the name of the journal-flushing file. It can be reached anywhere within a top-level folder.
const MetricsFileName = ".kbfs_metrics"
MetricsFileName is the name of the KBFS metrics file -- it can be reached from any KBFS directory.
const PauseJournalBackgroundWorkFileName = ".kbfs_pause_journal_background_work"
PauseJournalBackgroundWorkFileName is the name of the file that pauses the background work of a journal. It can be reached anywhere within a top-level folder.
const ProfileListDirName = ".kbfs_profiles"
ProfileListDirName is the name of the KBFS profile directory -- it can be reached from any KBFS directory.
const ReclaimQuotaFileName = ".kbfs_reclaim_quota"
ReclaimQuotaFileName is the name of the KBFS quota-reclaiming file -- it can be reached anywhere within a top-level folder.
const RekeyFileName = ".kbfs_rekey"
RekeyFileName is the name of the KBFS rekeying file -- it can be reached anywhere within a top-level folder.
const ResetCachesFileName = ".kbfs_reset_caches"
ResetCachesFileName is the name of the KBFS unstaging file.
const ResumeJournalBackgroundWorkFileName = ".kbfs_resume_journal_background_work"
ResumeJournalBackgroundWorkFileName is the name of the file that resumes the background work of a journal. It can be reached anywhere within a top-level folder.
const StatusFileName = ".kbfs_status"
StatusFileName is the name of the KBFS status file -- it can be reached anywhere within a top-level folder or inside the Keybase root
const SyncFromServerFileName = ".kbfs_sync_from_server"
SyncFromServerFileName is the name of the KBFS sync-from-server file -- it can be reached anywhere within a top-level folder.
const UnstageFileName = ".kbfs_unstage"
UnstageFileName is the name of the KBFS unstaging file -- it can be reached anywhere within a top-level folder.
Variables ¶
This section is empty.
Functions ¶
func FilterTLFEarlyExitError ¶
func FilterTLFEarlyExitError(ctx context.Context, err error, log logger.Logger, name libkbfs.CanonicalTlfName) ( exitEarly bool, retErr error)
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.
func GetEncodedErrors ¶
GetEncodedErrors gets the list of encoded errors in a format suitable for error file.
func GetEncodedFolderStatus ¶
func GetEncodedFolderStatus(ctx context.Context, config libkbfs.Config, folderBranch libkbfs.FolderBranch) ( data []byte, t time.Time, err error)
GetEncodedFolderStatus returns serialized JSON containing status information for a folder
func GetEncodedMetrics ¶
GetEncodedMetrics returns metrics encoded as bytes for metrics file.
func GetEncodedStatus ¶
func GetEncodedStatus(ctx context.Context, config libkbfs.Config) ( data []byte, t time.Time, err error)
GetEncodedStatus returns serialized JSON containing top-level KBFS status information
func GetEncodedTlfEditHistory ¶
func GetEncodedTlfEditHistory(ctx context.Context, config libkbfs.Config, folderBranch libkbfs.FolderBranch) ( data []byte, t time.Time, err error)
GetEncodedTlfEditHistory returns serialized JSON containing the file edit history for a folder.
func IsSupportedProfileName ¶
IsSupportedProfileName matches a string against allowed profile names.
func PrettyJSON ¶
PrettyJSON marshals a value to human-readable JSON.
func ProfileGet ¶
ProfileGet gets the relevant read function for the profile or nil if it doesn't exist.
func TimeEqual ¶
TimeEqual compares two filesystem-related timestamps.
On platforms that don't use nanosecond-accurate timestamps in their filesystem APIs, it truncates the timestamps to make them comparable.
func UnstageForTesting ¶
func UnstageForTesting(ctx context.Context, log logger.Logger, config libkbfs.Config, fb libkbfs.FolderBranch, data []byte) (int, error)
UnstageForTesting unstages all unmerged commits and fast-forwards to the current master, if the given data is non-empty. If the given data is empty, it does nothing.
This should only be needed if there is a bug in automatic conflict resolution.
If the given data begins with the bytes "async", the unstaging is done asynchronously, i.e. this function returns immediately and the unstaging happens in the background. (Other subsequent IO operations may be blocked, though.) You can figure out when the unstage succeeds by consulting .kbfs_status.
Types ¶
type CtxAppIDType ¶
type CtxAppIDType int
CtxAppIDType is the type used for the app ID context tag
const ( // CtxAppIDKey is the context app id CtxAppIDKey CtxAppIDType = iota )
type FSNotifications ¶
type FSNotifications struct {
// contains filtered or unexported fields
}
FSNotifications processes notifications (arbitrary functions, usually triggered by libkbfs) and lets other objects block on them, usually for testing.
func NewFSNotifications ¶
func NewFSNotifications(log logger.Logger) *FSNotifications
NewFSNotifications creates a new FSNotifications object.
func (*FSNotifications) LaunchProcessor ¶
func (f *FSNotifications) LaunchProcessor(ctx context.Context)
LaunchProcessor launches the notification processor.
func (*FSNotifications) QueueNotification ¶
func (f *FSNotifications) QueueNotification(fn func())
QueueNotification queues a notification, which must be goroutine-safe.
func (*FSNotifications) Wait ¶
func (f *FSNotifications) Wait()
Wait waits until all current notifications are done.
type JSONReportedError ¶
type JSONReportedError struct { Time time.Time Error string Stack []goerrors.StackFrame }
JSONReportedError stringifies the reported error before marshalling
type JournalAction ¶
type JournalAction int
JournalAction enumerates all the possible actions to take on a TLF's journal.
const ( // JournalEnable is to turn the journal on. JournalEnable JournalAction = iota // JournalFlush is to flush the journal. JournalFlush // JournalPauseBackgroundWork is to pause journal background // work. JournalPauseBackgroundWork // JournalResumeBackgroundWork is to resume journal background // work. JournalResumeBackgroundWork // JournalDisable is to disable the journal. JournalDisable // JournalEnableAuto is to turn on journals for all TLFs, persistently. JournalEnableAuto // JournalDisableAuto is to turn off automatic journaling for new TLFs. JournalDisableAuto )
func (JournalAction) Execute ¶
func (a JournalAction) Execute( ctx context.Context, jServer *libkbfs.JournalServer, tlfID tlf.ID) error
Execute performs the action on the given JournalServer for the given TLF.
func (JournalAction) String ¶
func (a JournalAction) String() string
type RemoteStatus ¶
RemoteStatus is for maintaining status of various remote connections like keybase service and md-server.
func (*RemoteStatus) ExtraFileName ¶
func (r *RemoteStatus) ExtraFileName() string
ExtraFileName returns the extra file name or an empty string for none.
func (*RemoteStatus) ExtraFileNameAndSize ¶
func (r *RemoteStatus) ExtraFileNameAndSize() (string, int64)
ExtraFileNameAndSize returns the extra file name or an empty string for none and the size of the extra file.
func (*RemoteStatus) Init ¶
func (r *RemoteStatus) Init(ctx context.Context, log logger.Logger, config libkbfs.Config, rs RemoteStatusUpdater)
Init a RemoteStatus and register it with libkbfs.
func (*RemoteStatus) NewSpecialReadFunc ¶
NewSpecialReadFunc implements a special read file that contains human readable current status.
type RemoteStatusUpdater ¶
type RemoteStatusUpdater interface { // UserChanged is called when the kbfs user is changed. // Either oldName or newName, or both may be empty. UserChanged(ctx context.Context, oldName, newName libkb.NormalizedUsername) }
RemoteStatusUpdater has callbacks that will be called from libfs when kbfs status changes in interesting ways.
type TlfDoesNotExist ¶
type TlfDoesNotExist struct{}
TlfDoesNotExist is a shortcut error for the cases a TLF does not exist and an early successful exit via FilterTLFEarlyExitError is wished.
func (TlfDoesNotExist) Error ¶
func (TlfDoesNotExist) Error() string
Error - implement error interface.