types

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttrToStat

func AttrToStat(attr *keibidrop.Attr) *fuse.Stat_t

AttrToStat converts a protobuf Attr back to a FUSE Stat_t.

func NanoToTimespec

func NanoToTimespec(ns uint64) fuse.Timespec

NanoToTimespec converts nanoseconds since Unix epoch to a fuse.Timespec.

func StatToAttr

func StatToAttr(stat *fuse.Stat_t) *keibidrop.Attr

StatToAttr converts a FUSE Stat_t to a protobuf Attr.

Types

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.

type RemoteFileStream

type RemoteFileStream interface {
	// ReadAt sends offset & size, receives exactly those bytes.
	ReadAt(ctx context.Context, offset int64, size int64) ([]byte, error)
	Close() error
}

type StreamFileReceiver

type StreamFileReceiver interface {
	// Recv returns the next chunk. Returns io.EOF when the stream ends.
	Recv() (data []byte, offset uint64, totalSize uint64, err error)
}

StreamFileReceiver receives pushed chunks from the server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL