Versions in this module Expand all Collapse all v0 v0.55.0 May 4, 2024 v0.54.0 Apr 4, 2024 Changes in this version + const DefaultEmbedGoFileName + const DefaultEmbedPackageName + const DefaultEmbedVarName + type DirWatcher struct + C <-chan NodeState + Delay time.Duration + func (dw *DirWatcher) Start() (err error) + func (dw *DirWatcher) Stop() + type EmbedOptions struct + CommentHeader string + GoFileName string + PackageName string + VarName string + WithoutModTime bool + type FileState byte + const FileStateCreated + const FileStateDeleted + const FileStateUpdateContent + const FileStateUpdateMode + func (fs FileState) String() (s string) + type MemFS struct + Opts *Options + PathNodes *PathNode + Root *Node + func New(opts *Options) (mfs *MemFS, err error) + func (mfs *MemFS) AddChild(parent *Node, fi os.FileInfo) (child *Node, err error) + func (mfs *MemFS) AddFile(internalPath, externalPath string) (node *Node, err error) + func (mfs *MemFS) Get(path string) (node *Node, err error) + func (mfs *MemFS) GoEmbed() (err error) + func (mfs *MemFS) Init() (err error) + func (mfs *MemFS) ListNames() (paths []string) + func (mfs *MemFS) MarshalJSON() ([]byte, error) + func (mfs *MemFS) Merge(sub *MemFS) + func (mfs *MemFS) MustGet(path string) (node *Node) + func (mfs *MemFS) Open(path string) (http.File, error) + func (mfs *MemFS) Remount() (err error) + func (mfs *MemFS) RemoveChild(parent *Node, child *Node) (removed *Node) + func (mfs *MemFS) Search(words []string, snippetLen int) (results []SearchResult) + func (mfs *MemFS) StopWatch() + func (mfs *MemFS) Update(node *Node, newInfo os.FileInfo) + func (mfs *MemFS) Watch(opts WatchOptions) (dw *DirWatcher, err error) + type Node struct + Childs []*Node + Content []byte + ContentType string + GenFuncName string + Parent *Node + Path string + SysPath string + func NewNode(parent *Node, fi os.FileInfo, maxFileSize int64) (node *Node, err error) + func (node *Node) AddChild(child *Node) + func (node *Node) Child(name string) (cnode *Node) + func (node *Node) Close() error + func (node *Node) GenerateIndexHTML() + func (node *Node) IsDir() bool + func (node *Node) JSON(depth int, withContent, withModTime bool) (rawjson []byte, err error) + func (node *Node) MarshalJSON() ([]byte, error) + func (node *Node) ModTime() time.Time + func (node *Node) Mode() os.FileMode + func (node *Node) Name() string + func (node *Node) Read(p []byte) (n int, err error) + func (node *Node) Readdir(count int) (fis []os.FileInfo, err error) + func (node *Node) Save(content []byte) (err error) + func (node *Node) Seek(offset int64, whence int) (int64, error) + func (node *Node) SetModTime(modTime time.Time) + func (node *Node) SetModTimeUnix(seconds, nanoSeconds int64) + func (node *Node) SetMode(mode os.FileMode) + func (node *Node) SetName(name string) + func (node *Node) SetSize(size int64) + func (node *Node) Size() int64 + func (node *Node) Stat() (os.FileInfo, error) + func (node *Node) Sys() interface{} + func (node *Node) Update(newInfo os.FileInfo, maxFileSize int64) (err error) + type NodeState struct + Node Node + State FileState + type Options struct + Embed EmbedOptions + Excludes []string + Includes []string + MaxFileSize int64 + Root string + TryDirect bool + type PathNode struct + func NewPathNode() *PathNode + func (pn *PathNode) Delete(path string) + func (pn *PathNode) Get(path string) (node *Node) + func (pn *PathNode) MarshalJSON() ([]byte, error) + func (pn *PathNode) Nodes() (nodes []*Node) + func (pn *PathNode) Paths() (paths []string) + func (pn *PathNode) Set(path string, node *Node) + type SearchResult struct + Path string + Snippets []string + type WatchCallback func(*NodeState) + type WatchOptions struct + Delay time.Duration + Watches []string + type Watcher struct + C <-chan NodeState + func NewWatcher(path string, d time.Duration) (w *Watcher, err error) + func (w *Watcher) Stop()