Documentation ¶
Overview ¶
Package sys provides platform-independent interfaces to support webassembly runtime
Index ¶
- Variables
- type DiskFS
- func (dfs *DiskFS) MkdirAll(path string, perm os.FileMode) error
- func (dfs *DiskFS) Open(name string) (File, error)
- func (dfs *DiskFS) OpenFile(name string, flag int, perm os.FileMode) (File, error)
- func (dfs *DiskFS) ReadFile(name string) ([]byte, error)
- func (dfs *DiskFS) Remove(name string) error
- func (dfs *DiskFS) WriteFile(name string, data []byte, perm os.FileMode) error
- type FS
- type File
- type KeyPair
- type MemFS
- func (mfs *MemFS) MkdirAll(path string, perm os.FileMode) error
- func (mfs *MemFS) Open(name string) (File, error)
- func (mfs *MemFS) OpenFile(name string, flag int, perm os.FileMode) (File, error)
- func (mfs *MemFS) ReadFile(name string) ([]byte, error)
- func (mfs *MemFS) Remove(name string) error
- func (mfs *MemFS) WriteFile(name string, data []byte, perm os.FileMode) error
- type MemFile
- type MemFileInfo
- func (i *MemFileInfo) Info() (fs.FileInfo, error)
- func (i *MemFileInfo) IsDir() bool
- func (i *MemFileInfo) ModTime() time.Time
- func (i *MemFileInfo) Mode() fs.FileMode
- func (i *MemFileInfo) Name() string
- func (i *MemFileInfo) Size() int64
- func (i *MemFileInfo) Sys() interface{}
- func (i *MemFileInfo) Type() fs.FileMode
- type SignFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //Files file system implementation on sdk. DiskFS doesn't work on webassembly. it should be initialized with common.NewMemFS() Files FS = NewDiskFS() //Sleep pauses the current goroutine for at least the duration. // time.Sleep will stop webassembly main thread. it should be bridged to javascript method on webassembly sdk Sleep = time.Sleep // Sign sign method. it should be initialized on different platform. Sign SignFunc )
Functions ¶
This section is empty.
Types ¶
type DiskFS ¶
type DiskFS struct { }
DiskFS implement file system on disk
func (*DiskFS) Open ¶
Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY. If there is an error, it will be of type *PathError.
type FS ¶
type FS interface { // Open opens the named file for reading. If successful, methods on // the returned file can be used for reading; the associated file // descriptor has mode O_RDONLY. // If there is an error, it will be of type *PathError. Open(name string) (File, error) // OpenFile open a file OpenFile(name string, flag int, perm os.FileMode) (File, error) // ReadFile reads the file named by filename and returns the contents. ReadFile(name string) ([]byte, error) // WriteFile writes data to a file named by filename. WriteFile(name string, data []byte, perm fs.FileMode) error // Remove removes the named file or (empty) directory. // If there is an error, it will be of type *PathError. Remove(name string) error //MkdirAll creates a directory named path MkdirAll(path string, perm os.FileMode) error }
FS An FS provides access to a hierarchical file system.
type MemFS ¶
type MemFS struct {
// contains filtered or unexported fields
}
MemFS implement file system on memory
func (*MemFS) Open ¶
Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY. If there is an error, it will be of type *PathError.
type MemFile ¶
type MemFileInfo ¶
type MemFileInfo struct {
// contains filtered or unexported fields
}
func (*MemFileInfo) IsDir ¶
func (i *MemFileInfo) IsDir() bool
func (*MemFileInfo) ModTime ¶
func (i *MemFileInfo) ModTime() time.Time
func (*MemFileInfo) Mode ¶
func (i *MemFileInfo) Mode() fs.FileMode
func (*MemFileInfo) Name ¶
func (i *MemFileInfo) Name() string
func (*MemFileInfo) Size ¶
func (i *MemFileInfo) Size() int64
func (*MemFileInfo) Sys ¶
func (i *MemFileInfo) Sys() interface{}
func (*MemFileInfo) Type ¶
func (i *MemFileInfo) Type() fs.FileMode
Click to show internal directories.
Click to hide internal directories.