Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dsxack committed Sep 24, 2023
1 parent a120e58 commit f577ddb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nodes/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,23 @@ 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,
reader: reader,
}
}

// 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)).
Expand Down

0 comments on commit f577ddb

Please sign in to comment.