sysfs

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

sysfs is a almost verbatim copy of internal package sysfs from wazero. As it's internal, it cannot be used outside of wazero; however, it's useful to be able to create AdaptFS and SysFS and instrument them and experiment on them further.

Do NOT use it in prod code, because it is not being kept up-to-date with wazero; use it only for experimenting/debugging.

Network and polling was removed, as it was dependent on other internal packages. As was all testing.

path.go is copied over from internal platform package.

Original wazero docs:

Package sysfs includes a low-level filesystem interface and utilities needed for WebAssembly host functions (ABI) such as WASI and runtime.GOOS=js.

The name sysfs was chosen because wazero's public API has a "sys" package, which was named after https://github.com/golang/sys.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirFS

func DirFS(dir string) experimentalsys.FS

func OpenFile

func OpenFile(path string, flag experimentalsys.Oflag, perm fs.FileMode) (*os.File, experimentalsys.Errno)

Types

type AdaptFS

type AdaptFS struct {
	FS fs.FS
}

func (*AdaptFS) Chmod

Chmod implements the same method as documented on sys.FS

Link implements the same method as documented on sys.FS

func (*AdaptFS) Lstat

func (a *AdaptFS) Lstat(path string) (sys.Stat_t, experimentalsys.Errno)

Lstat implements the same method as documented on sys.FS

func (*AdaptFS) Mkdir

Mkdir implements the same method as documented on sys.FS

func (*AdaptFS) OpenFile

OpenFile implements the same method as documented on sys.FS

func (a *AdaptFS) Readlink(string) (string, experimentalsys.Errno)

Readlink implements the same method as documented on sys.FS

func (*AdaptFS) Rename

Rename implements the same method as documented on sys.FS

func (*AdaptFS) Rmdir

func (a *AdaptFS) Rmdir(string) experimentalsys.Errno

Rmdir implements the same method as documented on sys.FS

func (*AdaptFS) Stat

func (a *AdaptFS) Stat(path string) (sys.Stat_t, experimentalsys.Errno)

Stat implements the same method as documented on sys.FS

func (*AdaptFS) String

func (a *AdaptFS) String() string

String implements fmt.Stringer

func (a *AdaptFS) Symlink(string, string) experimentalsys.Errno

Symlink implements the same method as documented on sys.FS

func (a *AdaptFS) Unlink(string) experimentalsys.Errno

Unlink implements the same method as documented on sys.FS

func (*AdaptFS) Utimens

Utimens implements the same method as documented on sys.FS

type ReadFS

type ReadFS struct {
	experimentalsys.FS
}

func (*ReadFS) Chmod

func (r *ReadFS) Chmod(path string, perm fs.FileMode) experimentalsys.Errno

Chmod implements the same method as documented on sys.FS

func (r *ReadFS) Link(_, _ string) experimentalsys.Errno

Link implements the same method as documented on sys.FS

func (*ReadFS) Mkdir

func (r *ReadFS) Mkdir(path string, perm fs.FileMode) experimentalsys.Errno

Mkdir implements the same method as documented on sys.FS

func (*ReadFS) OpenFile

OpenFile implements the same method as documented on sys.FS

func (*ReadFS) Rename

func (r *ReadFS) Rename(from, to string) experimentalsys.Errno

Rename implements the same method as documented on sys.FS

func (*ReadFS) Rmdir

func (r *ReadFS) Rmdir(path string) experimentalsys.Errno

Rmdir implements the same method as documented on sys.FS

func (r *ReadFS) Symlink(_, _ string) experimentalsys.Errno

Symlink implements the same method as documented on sys.FS

func (r *ReadFS) Unlink(path string) experimentalsys.Errno

Unlink implements the same method as documented on sys.FS

func (*ReadFS) Utimens

func (r *ReadFS) Utimens(path string, atim, mtim int64) experimentalsys.Errno

Utimens implements the same method as documented on sys.FS

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL