Documentation
¶
Overview ¶
package mfs implements an in memory model of a mutable ipfs filesystem.
It consists of four main structs:
- The Filesystem The filesystem serves as a container and entry point for various mfs filesystems
- Root Root represents an individual filesystem mounted within the mfs system as a whole
- Directories
- Files
Index ¶
- Constants
- Variables
- func FlushPath(rt *Root, pth string) error
- func Mkdir(r *Root, pth string, mkparents bool, flush bool) error
- func Mv(r *Root, src, dst string) error
- func PutNode(r *Root, path string, nd *dag.Node) error
- type Directory
- func (d *Directory) AddChild(name string, nd *dag.Node) error
- func (d *Directory) Child(name string) (FSNode, error)
- func (d *Directory) Flush() error
- func (d *Directory) GetNode() (*dag.Node, error)
- func (d *Directory) List() ([]NodeListing, error)
- func (d *Directory) ListNames() []string
- func (d *Directory) Mkdir(name string) (*Directory, error)
- func (d *Directory) Path() string
- func (d *Directory) Type() NodeType
- func (d *Directory) Uncache(name string)
- func (d *Directory) Unlink(name string) error
- type FSNode
- type File
- type FileDescriptor
- type NodeListing
- type NodeType
- type PubFunc
- type Republisher
- type Root
Constants ¶
const ( OpenReadOnly = iota OpenWriteOnly OpenReadWrite )
Variables ¶
Functions ¶
func Mkdir ¶
Mkdir creates a directory at 'path' under the directory 'd', creating intermediary directories as needed if 'mkparents' is set to true
Types ¶
type Directory ¶
type Directory struct {
// contains filtered or unexported fields
}
func NewDirectory ¶
func (*Directory) AddChild ¶
AddChild adds the node 'nd' under this directory giving it the name 'name'
func (*Directory) Child ¶
Child returns the child of this directory by the given name
func (*Directory) List ¶
func (d *Directory) List() ([]NodeListing, error)
type FSNode ¶
FSNode represents any node (directory, root, or file) in the mfs filesystem
func DirLookup ¶
DirLookup will look up a file or directory at the given path under the directory 'd'
type File ¶
type File struct {
// contains filtered or unexported fields
}
func NewFile ¶
NewFile returns a NewFile object with the given parameters
func (*File) GetNode ¶
GetNode returns the dag node associated with this file
type FileDescriptor ¶
type Republisher ¶
type Republisher struct {
TimeoutLong time.Duration
TimeoutShort time.Duration
Publish chan struct{}
// contains filtered or unexported fields
}
Republisher manages when to publish a given entry
func NewRepublisher ¶
NewRepublisher creates a new Republisher object to republish the given root using the given short and long time intervals
func (*Republisher) Close ¶
func (p *Republisher) Close() error
func (*Republisher) Update ¶
func (np *Republisher) Update(k key.Key)
Touch signals that an update has occurred since the last publish. Multiple consecutive touches may extend the time period before the next Publish occurs in order to more efficiently batch updates
func (*Republisher) WaitPub ¶
func (p *Republisher) WaitPub()
Source Files
¶
- dir.go
- fd.go
- file.go
- ops.go
- system.go