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 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 Error
- type FSNotifications
- type JSONReportedError
- type JournalAction
- type RemoteStatus
- 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 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 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 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 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 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 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 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 []errors.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 // JournalDisable is to disable the journal. JournalDisable )
func (JournalAction) Execute ¶
func (a JournalAction) Execute( ctx context.Context, jServer *libkbfs.JournalServer, tlf libkbfs.TlfID) 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) NewSpecialReadFunc ¶
NewSpecialReadFunc implements a special read file that contains human readable current status.
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.