go-strfs/fileinfo.go

41 lines
663 B
Go
Raw Permalink Normal View History

2022-12-14 11:33:55 +00:00
package strfs
import (
"io/fs"
"time"
)
type internalFileInfo struct {
2022-12-14 17:50:42 +00:00
sys string
2022-12-14 11:33:55 +00:00
mode fs.FileMode
modtime time.Time
name string
size int64
}
var _ fs.FileInfo = &internalFileInfo{}
func (receiver internalFileInfo) IsDir() bool {
return 0 != (receiver.mode & fs.ModeDir)
}
func (receiver internalFileInfo) Mode() fs.FileMode {
return receiver.mode
}
func (receiver internalFileInfo) ModTime() time.Time {
return receiver.modtime
}
func (receiver internalFileInfo) Name() string {
return receiver.name
}
func (receiver internalFileInfo) Size() int64 {
return receiver.size
}
func (receiver internalFileInfo) Sys() any {
2022-12-14 17:50:42 +00:00
return receiver.sys
2022-12-14 11:33:55 +00:00
}