Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrRemoteFileNotFound = errors.New("remote file not found")
ErrRemoteFileNotFound is returned by RemoteFileStream.ReadAt when the peer reports the file no longer exists (gRPC NotFound), as opposed to a transient fetch failure (timeout, connection loss, server I/O error). The on-demand read path uses this to distinguish a genuinely gone file (surface EOF, e.g. git's transient .keep files) from a stall (surface EIO, so a media player does not see a false end-of-file mid-stream). Defined here, in the shared types package, so the filesystem package can check it without importing gRPC.
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 is implemented by providers that support the GetChunkHashes RPC. A provider that does not implement it (older peer, test fake) signals via the failed type assertion at the call site that the caller must fall back.
type FileAction ¶
type FileAction int
FileAction maps local FS events
const ( Unknown FileAction = iota AddDir AddFile RemoveDir RemoveFile EditDir EditFile RenameFile RenameDir )
type FileEvent ¶
type FileEvent struct {
Path string // relative path in the FS (new path for renames)
OldPath string // for renames: the source path
Action FileAction // type of event
Attr *keibidrop.Attr // file attributes (from Stat_t)
}
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: 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.