Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrRemoteFileNotFound = errors.New("remote file not found")
ErrRemoteFileNotFound reports that the peer no longer has the file (gRPC NotFound), not a transient fetch failure. On-demand reads map it to EOF and map stalls to EIO. It lives here so the filesystem package avoids a gRPC import.
Functions ¶
func AttrToStat ¶
AttrToStat converts a protobuf Attr back to a FUSE Stat_t.
func NanoToTimespec ¶
NanoToTimespec converts nanoseconds since Unix epoch to a fuse.Timespec.
Types ¶
type ChunkHashReceiver ¶ added in v0.3.6
ChunkHashReceiver streams (chunkIndex, hash) pairs from a peer's GetChunkHashes RPC.
type ChunkHasher ¶ added in v0.3.6
type ChunkHasher interface {
GetChunkHashes(ctx context.Context, path string, chunkSize, fromChunk, count uint64) (ChunkHashReceiver, error)
}
ChunkHasher marks providers that support the GetChunkHashes RPC. Callers type-assert and fall back when a provider (older peer, test fake) lacks it.
type FileAction ¶
type FileAction int
FileAction identifies the type of a local filesystem event.
const ( Unknown FileAction = iota AddDir AddFile RemoveDir RemoveFile EditDir EditFile RenameFile RenameDir // CancelPendingNotify never reaches the wire: it tells the notify worker // to drop a queued ADD/EDIT for the path. Emitted when an acceptance // replaces local content — the queued announce describes bytes that no // longer exist, and its flush-time attr refresh would stamp the PEER'S // content with a fresh local mtime and bounce it back as "newer". CancelPendingNotify )
type FileEvent ¶
type FileEvent struct {
Path string // Relative path in the FS; the new path for renames.
OldPath string // Source path for renames.
Action FileAction
Attr *keibidrop.Attr // File attributes from Stat_t.
// BaseMtimeNs is the newest peer version the sender accepted when the edit
// session started. 0 means unknown; the receiver then keeps no conflict copy.
BaseMtimeNs int64
}
FileEvent represents a filesystem change
type FileStreamProvider ¶
type FileStreamProvider interface {
OpenRemoteFile(ctx context.Context, inode uint64, path string) (RemoteFileStream, error)
// StreamFile starts a push-based download. The server sends all chunks
// from startOffset to EOF without per-chunk round-trips.
StreamFile(ctx context.Context, path string, startOffset uint64) (StreamFileReceiver, error)
}
FileStreamProvider is a factory for RemoteFileStream and StreamFile.