memfs

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

memfs implements an in-memory fs.FS implementation This is useful in for running d2 in javascript environments where native file calls are not available

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryFS

type MemoryFS struct {
	// contains filtered or unexported fields
}

func New

func New(m map[string]string) (*MemoryFS, error)

func (*MemoryFS) Open

func (mfs *MemoryFS) Open(name string) (fs.File, error)

type MemoryFile

type MemoryFile struct {
	// contains filtered or unexported fields
}

func (*MemoryFile) Close

func (mf *MemoryFile) Close() error

func (*MemoryFile) IsDir

func (mf *MemoryFile) IsDir() bool

func (*MemoryFile) ModTime

func (mf *MemoryFile) ModTime() time.Time

func (*MemoryFile) Mode

func (mf *MemoryFile) Mode() fs.FileMode

func (*MemoryFile) Name

func (mf *MemoryFile) Name() string

func (*MemoryFile) Read

func (mf *MemoryFile) Read(b []byte) (int, error)

func (*MemoryFile) Size

func (mf *MemoryFile) Size() int64

func (*MemoryFile) Stat

func (mf *MemoryFile) Stat() (fs.FileInfo, error)

func (*MemoryFile) Sys

func (mf *MemoryFile) Sys() interface{}

type MemoryFileHandle

type MemoryFileHandle struct {
	*MemoryFile
	// contains filtered or unexported fields
}

func (*MemoryFileHandle) Close

func (fh *MemoryFileHandle) Close() error

func (*MemoryFileHandle) Read

func (fh *MemoryFileHandle) Read(b []byte) (int, error)

func (*MemoryFileHandle) Stat

func (fh *MemoryFileHandle) Stat() (fs.FileInfo, error)

Jump to

Keyboard shortcuts

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