Documentation ¶
Index ¶
- Constants
- Variables
- func IsNotExists(err error) bool
- func NewEmbedFS(embed *embed.FS) *embedfs
- func NewFS() *fs
- func NewHttpFS(url url.URL) *httpfs
- func NewLocalFS(path string) *localfs
- type DirEntry
- type FS
- type FSError
- type FSErrorBase
- type File
- type FileDescriptor
- type FileMode
- type ReadStream
- type ReadStreamBase
- type Stats
Constants ¶
View Source
const ( ENOENT = "ENOENT" ENOACCESS = "ENOACCESS" )
View Source
const ( F_OK = 1 R_OK = 2 W_OK = 4 X_OK = 8 )
Variables ¶
View Source
var ErrFileDescriptorNotFound = func(ctx context.Context) error { return NewFSError(ctx, "ENOFD", "file descriptor not found") }
View Source
var ErrInvalid = func(ctx context.Context) error { return NewFSError(ctx, "EINVAL", "received invalid argument") }
View Source
var ErrNoFileDescriptorTable = func(ctx context.Context) error { return NewFSError(ctx, "ENOCTX", "file descriptor table not found in context") }
Functions ¶
func IsNotExists ¶
func NewEmbedFS ¶
func NewLocalFS ¶
func NewLocalFS(path string) *localfs
Types ¶
type FS ¶
type FS interface { ReadDir(ctx context.Context, path string) ([]string, error) ReadFile(ctx context.Context, path string, options ...any) (any, error) ReadStream(ctx context.Context, path string) (ReadStream, error) Open(ctx context.Context, path string) (FileDescriptor, error) Close(ctx context.Context, fd FileDescriptor) error Exists(ctx context.Context, path string) (bool, error) Stat(ctx context.Context, path string) (Stats, error) LStat(ctx context.Context, path string) (Stats, error) Access(ctx context.Context, path string, args ...any) error Mount(mountPoint string, mount FS, path string) error RealPath(ctx context.Context, path string) (string, error) File(ctx context.Context, fd FileDescriptor) (File, error) }
type FSErrorBase ¶
type FSErrorBase struct {
// contains filtered or unexported fields
}
func NewFSError ¶
func NewFSError(ctx context.Context, code string, message string) *FSErrorBase
func NewFSError2 ¶
func NewFSError2(in isolates.FunctionArgs) (*FSErrorBase, error)
func (*FSErrorBase) Code ¶
func (e *FSErrorBase) Code() string
func (*FSErrorBase) Error ¶
func (e *FSErrorBase) Error() string
func (*FSErrorBase) Message ¶
func (e *FSErrorBase) Message() string
func (*FSErrorBase) V8GetCode ¶
func (e *FSErrorBase) V8GetCode(in isolates.GetterArgs) (*isolates.Value, error)
func (*FSErrorBase) V8GetMessage ¶
func (e *FSErrorBase) V8GetMessage(in isolates.GetterArgs) (*isolates.Value, error)
type FileDescriptor ¶
type FileDescriptor uintptr
func NewFileDescriptor ¶
func NewFileDescriptor(ctx context.Context, file File) (FileDescriptor, error)
func (FileDescriptor) ReadAll ¶
func (f FileDescriptor) ReadAll(ctx context.Context) ([]byte, error)
func (FileDescriptor) ReadStream ¶
func (f FileDescriptor) ReadStream(ctx context.Context) (ReadStream, error)
type ReadStream ¶
type ReadStreamBase ¶
type ReadStreamBase struct {
*stream.ReadableBase
}
func NewReadStream ¶
func NewReadStream(in isolates.FunctionArgs) (*ReadStreamBase, error)
type Stats ¶
type Stats interface { IsFile() bool IsDirectory() bool IsSymbolicLink() bool AccessedMilli() int64 Accessed() time.Time ModifiedMilli() int64 Modified() time.Time ChangedMilli() int64 Changed() time.Time CreatedMilli() int64 Created() time.Time Size() int64 ContentType() string Uid() int Gid() int Mode() FileMode }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.