From f577ddb54a808c1915df873907d705711f83033c Mon Sep 17 00:00:00 2001 From: Dmitriy Smotrov Date: Sun, 24 Sep 2023 08:18:02 +0400 Subject: [PATCH] Fix docs --- nodes/file.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nodes/file.go b/nodes/file.go index 6c22d35..9c0a72f 100644 --- a/nodes/file.go +++ b/nodes/file.go @@ -70,11 +70,15 @@ var ( _ fs.FileReader = (*FileHandler)(nil) ) +// FileHandler implements the fs.FileReader interface. +// It is used to read the file. +// It holds bytes.Reader to read the file at the given offset. type FileHandler struct { reader io.ReaderAt file *object.File } +// NewFileHandler creates a new file handler. func NewFileHandler(file *object.File, reader io.ReaderAt) *FileHandler { return &FileHandler{ file: file, @@ -82,6 +86,7 @@ func NewFileHandler(file *object.File, reader io.ReaderAt) *FileHandler { } } +// Read reads the file. func (h FileHandler) Read(_ context.Context, dest []byte, off int64) (fuse.ReadResult, syscall.Errno) { logger := slog.Default(). With(slog.String("fileName", h.file.Name)).