Documentation ¶
Index ¶
- type Dir
- type FS
- type File
- func (f *File) Cid() cid.Cid
- func (f *File) Close() error
- func (f *File) Info() (fs.FileInfo, error)
- func (f *File) IsDir() bool
- func (f *File) Name() string
- func (f *File) Read(buf []byte) (int, error)
- func (f *File) Seek(offset int64, whence int) (int64, error)
- func (f *File) Stat() (fs.FileInfo, error)
- func (f *File) Type() fs.FileMode
- func (f *File) WriteTo(w io.Writer) (int64, error)
- type FileInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dir ¶
type Dir struct {
// contains filtered or unexported fields
}
func (*Dir) ReadDir ¶
ReadDir reads the contents of the directory and returns a slice of up to n DirEntry values in directory order. Subsequent calls on the same file will yield further DirEntry values. If n > 0, ReadDir returns at most n DirEntry structures. In this case, if ReadDir returns an empty slice, it will return a non-nil error explaining why. At the end of a directory, the error is io.EOF.
If n <= 0, ReadDir returns all the DirEntry values from the directory in a single slice. In this case, if ReadDir succeeds (reads all the way to the end of the directory), it returns the slice and a nil error. If it encounters an error before the end of the directory, ReadDir returns the DirEntry list read until that point and a non-nil error.
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
func ReadFS ¶
ReadFS returns a read-only filesystem. It expects the supplied node to be the root of a UnixFS merkledag.
func (*FS) ReadDir ¶
ReadDir reads the named directory and returns a list of directory entries sorted by filename.
type File ¶
type File struct {
// contains filtered or unexported fields
}
type FileInfo ¶
type FileInfo struct {
// contains filtered or unexported fields
}
func (*FileInfo) Cid ¶
func (f *FileInfo) Cid() cid.Cid
Cid returns the CID of the file or directory's root node.
func (*FileInfo) ModTime ¶
Mode returns the modification time of the file if known or the zero time otherwise.