embeddedShell

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultNodeWithFSRepo

func NewDefaultNodeWithFSRepo(ctx context.Context, repoPath string) (*core.IpfsNode, error)

func NewTmpDirNode

func NewTmpDirNode(ctx context.Context) (*core.IpfsNode, error)

Types

type Interface

type Interface interface {
	// Add reads everything from the Reader and returns the IPFS hash
	Add(io.Reader) (string, error)

	// Cat returns a reader returning the data under the IPFS path
	Cat(path string) (io.ReadCloser, error)

	// AddDir(dir string) (string, error)
	Get(hash string, outdir string) error
}

Interface ...

type Shell

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

Shell ...

func NewShell

func NewShell(node *core.IpfsNode) *Shell

func NewShellWithContext

func NewShellWithContext(node *core.IpfsNode, ctx context.Context) *Shell

func (*Shell) Add

func (s *Shell) Add(r io.Reader) (string, error)
func (s *Shell) AddLink(target string) (string, error)

AddLink creates a unixfs symlink and returns its hash

func (*Shell) Cat

func (s *Shell) Cat(p string) (io.ReadCloser, error)

Cat resolves the ipfs path p and returns a reader for that data, if it exists and is availalbe

func (*Shell) Get

func (s *Shell) Get(ref, outdir string) error

Cat resolves the ipfs path p and returns a reader for that data, if it exists and is availalbe

func (*Shell) List

func (s *Shell) List(ipath string) ([]*sh.LsLink, error)

func (*Shell) NewObject

func (s *Shell) NewObject(template string) (string, error)

func (*Shell) Patch

func (s *Shell) Patch(root, action string, args ...string) (string, error)

TODO: extract all this logic from the core/commands/object.go to avoid dupe code

func (s *Shell) PatchLink(root, npath, childhash string, create bool) (string, error)

TODO: hrm, maybe this interface could be better

func (*Shell) ResolvePath

func (s *Shell) ResolvePath(ipath string) (string, error)

Jump to

Keyboard shortcuts

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