Documentation ¶
Overview ¶
package shell implements a remote API interface for a running ipfs daemon
Index ¶
- Constants
- type Error
- type IdOutput
- type IpfsObject
- type LsLink
- type LsObject
- type ObjectLink
- type PeerInfo
- type Request
- type Response
- type Shell
- func (s *Shell) Add(r io.Reader) (string, error)
- func (s *Shell) AddDir(dir string) (string, error)
- func (s *Shell) AddLink(target string) (string, error)
- func (s *Shell) BlockGet(path string) ([]byte, error)
- func (s *Shell) BlockPut(block []byte) (string, error)
- func (s *Shell) BlockStat(path string) (string, int, error)
- func (s *Shell) Cat(path string) (io.ReadCloser, error)
- func (s *Shell) FileList(path string) (*UnixLsObject, error)
- func (s *Shell) FindPeer(peer string) (*PeerInfo, error)
- func (s *Shell) Get(hash, outdir string) error
- func (s *Shell) ID(peer ...string) (*IdOutput, error)
- func (s *Shell) IsUp() bool
- func (s *Shell) List(path string) ([]*LsLink, error)
- func (s *Shell) NewObject(template string) (string, error)
- func (s *Shell) ObjectGet(path string) (*IpfsObject, error)
- func (s *Shell) ObjectPut(obj *IpfsObject) (string, error)
- func (s *Shell) Patch(root, action string, args ...string) (string, error)
- func (s *Shell) PatchData(root string, set bool, data interface{}) (string, error)
- func (s *Shell) PatchLink(root, path, childhash string, create bool) (string, error)
- func (s *Shell) Pin(path string) error
- func (s *Shell) Publish(node string, value string) error
- func (s *Shell) Refs(hash string, recursive bool) (<-chan string, error)
- func (s *Shell) Resolve(id string) (string, error)
- func (s *Shell) ResolvePath(path string) (string, error)
- func (s *Shell) SetTimeout(d time.Duration)
- func (s *Shell) Unpin(path string) error
- func (s *Shell) Version() (string, string, error)
- type UnixLsLink
- type UnixLsObject
Constants ¶
View Source
const ( TRaw = iota TDirectory TFile TMetadata TSymlink )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IpfsObject ¶
type IpfsObject struct { Links []ObjectLink Data string }
type ObjectLink ¶
type Request ¶
type Request struct { ApiBase string Command string Args []string Opts map[string]string Body io.Reader Headers map[string]string }
func NewRequest ¶
type Response ¶
type Response struct { Output io.ReadCloser Error *Error }
type Shell ¶
type Shell struct {
// contains filtered or unexported fields
}
func (*Shell) Cat ¶
func (s *Shell) Cat(path string) (io.ReadCloser, error)
Cat the content at the given path. Callers need to drain and close the returned reader after usage.
func (*Shell) FileList ¶
func (s *Shell) FileList(path string) (*UnixLsObject, error)
FileList entries at the given path using the UnixFS commands
func (*Shell) ID ¶
ID gets information about a given peer. Arguments:
peer: peer.ID of the node to look up. If no peer is specified,
return information about the local peer.
func (*Shell) SetTimeout ¶
type UnixLsObject ¶
type UnixLsObject struct { Hash string Size uint64 Type string Links []*UnixLsLink }
Click to show internal directories.
Click to hide internal directories.