Documentation ¶
Index ¶
- Constants
- Variables
- func ApiAddr(ipfspath string) (ma.Multiaddr, error)
- type BlockAPI
- func (api *BlockAPI) Get(ctx context.Context, p path.Path) (io.Reader, error)
- func (api *BlockAPI) Put(ctx context.Context, r io.Reader, opts ...caopts.BlockPutOption) (iface.BlockStat, error)
- func (api *BlockAPI) Rm(ctx context.Context, p path.Path, opts ...caopts.BlockRmOption) error
- func (api *BlockAPI) Stat(ctx context.Context, p path.Path) (iface.BlockStat, error)
- type DhtAPI
- func (api *DhtAPI) FindPeer(ctx context.Context, p peer.ID) (peerstore.PeerInfo, error)
- func (api *DhtAPI) FindProviders(ctx context.Context, p path.Path, opts ...caopts.DhtFindProvidersOption) (<-chan peerstore.PeerInfo, error)
- func (api *DhtAPI) Provide(ctx context.Context, p path.Path, opts ...caopts.DhtProvideOption) error
- type Error
- type HttpApi
- func (api *HttpApi) Block() iface.BlockAPI
- func (api *HttpApi) Dag() iface.APIDagService
- func (api *HttpApi) Dht() iface.DhtAPI
- func (api *HttpApi) Key() iface.KeyAPI
- func (api *HttpApi) Name() iface.NameAPI
- func (api *HttpApi) Object() iface.ObjectAPI
- func (api *HttpApi) Pin() iface.PinAPI
- func (api *HttpApi) PubSub() iface.PubSubAPI
- func (api *HttpApi) Request(command string, args ...string) *RequestBuilder
- func (api *HttpApi) ResolveNode(ctx context.Context, p path.Path) (ipld.Node, error)
- func (api *HttpApi) ResolvePath(ctx context.Context, p path.Path) (path.Resolved, error)
- func (api *HttpApi) Swarm() iface.SwarmAPI
- func (api *HttpApi) Unixfs() iface.UnixfsAPI
- func (api *HttpApi) WithOptions(opts ...caopts.ApiOption) (iface.CoreAPI, error)
- type HttpDagServ
- func (api *HttpDagServ) Add(ctx context.Context, nd format.Node) error
- func (api *HttpDagServ) AddMany(ctx context.Context, nds []format.Node) error
- func (api *HttpDagServ) Get(ctx context.Context, c cid.Cid) (format.Node, error)
- func (api *HttpDagServ) GetMany(ctx context.Context, cids []cid.Cid) <-chan *format.NodeOption
- func (api *HttpDagServ) Pinning() format.NodeAdder
- func (api *HttpDagServ) Remove(ctx context.Context, c cid.Cid) error
- func (api *HttpDagServ) RemoveMany(ctx context.Context, cids []cid.Cid) error
- type KeyAPI
- func (api *KeyAPI) Generate(ctx context.Context, name string, opts ...caopts.KeyGenerateOption) (iface.Key, error)
- func (api *KeyAPI) List(ctx context.Context) ([]iface.Key, error)
- func (api *KeyAPI) Remove(ctx context.Context, name string) (iface.Key, error)
- func (api *KeyAPI) Rename(ctx context.Context, oldName string, newName string, ...) (iface.Key, bool, error)
- func (api *KeyAPI) Self(ctx context.Context) (iface.Key, error)
- type NameAPI
- func (api *NameAPI) Publish(ctx context.Context, p path.Path, opts ...caopts.NamePublishOption) (iface.IpnsEntry, error)
- func (api *NameAPI) Resolve(ctx context.Context, name string, opts ...caopts.NameResolveOption) (path.Path, error)
- func (api *NameAPI) Search(ctx context.Context, name string, opts ...caopts.NameResolveOption) (<-chan iface.IpnsResult, error)
- type ObjectAPI
- func (api *ObjectAPI) AddLink(ctx context.Context, base path.Path, name string, child path.Path, ...) (path.Resolved, error)
- func (api *ObjectAPI) AppendData(ctx context.Context, p path.Path, r io.Reader) (path.Resolved, error)
- func (api *ObjectAPI) Data(ctx context.Context, p path.Path) (io.Reader, error)
- func (api *ObjectAPI) Diff(ctx context.Context, a path.Path, b path.Path) ([]iface.ObjectChange, error)
- func (api *ObjectAPI) Get(ctx context.Context, p path.Path) (ipld.Node, error)
- func (api *ObjectAPI) Links(ctx context.Context, p path.Path) ([]*ipld.Link, error)
- func (api *ObjectAPI) New(ctx context.Context, opts ...caopts.ObjectNewOption) (ipld.Node, error)
- func (api *ObjectAPI) Put(ctx context.Context, r io.Reader, opts ...caopts.ObjectPutOption) (path.Resolved, error)
- func (api *ObjectAPI) RmLink(ctx context.Context, base path.Path, link string) (path.Resolved, error)
- func (api *ObjectAPI) SetData(ctx context.Context, p path.Path, r io.Reader) (path.Resolved, error)
- func (api *ObjectAPI) Stat(ctx context.Context, p path.Path) (*iface.ObjectStat, error)
- type PinAPI
- func (api *PinAPI) Add(ctx context.Context, p path.Path, opts ...caopts.PinAddOption) error
- func (api *PinAPI) Ls(ctx context.Context, opts ...caopts.PinLsOption) ([]iface.Pin, error)
- func (api *PinAPI) Rm(ctx context.Context, p path.Path, opts ...caopts.PinRmOption) error
- func (api *PinAPI) Update(ctx context.Context, from path.Path, to path.Path, ...) error
- func (api *PinAPI) Verify(ctx context.Context) (<-chan iface.PinStatus, error)
- type PubsubAPI
- func (api *PubsubAPI) Ls(ctx context.Context) ([]string, error)
- func (api *PubsubAPI) Peers(ctx context.Context, opts ...caopts.PubSubPeersOption) ([]peer.ID, error)
- func (api *PubsubAPI) Publish(ctx context.Context, topic string, message []byte) error
- func (api *PubsubAPI) Subscribe(ctx context.Context, topic string, opts ...caopts.PubSubSubscribeOption) (iface.PubSubSubscription, error)
- type Request
- type RequestBuilder
- func (r *RequestBuilder) Arguments(args ...string) *RequestBuilder
- func (r *RequestBuilder) Body(body io.Reader) *RequestBuilder
- func (r *RequestBuilder) BodyBytes(body []byte) *RequestBuilder
- func (r *RequestBuilder) BodyString(body string) *RequestBuilder
- func (r *RequestBuilder) Exec(ctx context.Context, res interface{}) error
- func (r *RequestBuilder) FileBody(body io.Reader) *RequestBuilder
- func (r *RequestBuilder) Header(name, value string) *RequestBuilder
- func (r *RequestBuilder) Option(key string, value interface{}) *RequestBuilder
- func (r *RequestBuilder) Send(ctx context.Context) (*Response, error)
- type Response
- type SwarmAPI
- func (api *SwarmAPI) Connect(ctx context.Context, pi peerstore.PeerInfo) error
- func (api *SwarmAPI) Disconnect(ctx context.Context, addr multiaddr.Multiaddr) error
- func (api *SwarmAPI) KnownAddrs(ctx context.Context) (map[peer.ID][]multiaddr.Multiaddr, error)
- func (api *SwarmAPI) ListenAddrs(ctx context.Context) ([]multiaddr.Multiaddr, error)
- func (api *SwarmAPI) LocalAddrs(ctx context.Context) ([]multiaddr.Multiaddr, error)
- func (api *SwarmAPI) Peers(ctx context.Context) ([]iface.ConnectionInfo, error)
- type UnixfsAPI
- func (api *UnixfsAPI) Add(ctx context.Context, f files.Node, opts ...caopts.UnixfsAddOption) (path.Resolved, error)
- func (api *UnixfsAPI) Get(ctx context.Context, p path.Path) (files.Node, error)
- func (api *UnixfsAPI) Ls(ctx context.Context, p path.Path, opts ...caopts.UnixfsLsOption) (<-chan iface.DirEntry, error)
Constants ¶
const ( DefaultPathName = ".ipfs" DefaultPathRoot = "~/" + DefaultPathName DefaultApiFile = "api" EnvDir = "IPFS_PATH" )
Variables ¶
var ErrApiNotFound = errors.New("ipfs api address could not be found")
ErrApiNotFound if we fail to find a running daemon.
Functions ¶
Types ¶
type BlockAPI ¶
type BlockAPI HttpApi
type HttpApi ¶
HttpApi implements github.com/ipfs/interface-go-ipfs-core/CoreAPI using IPFS HTTP API.
For interface docs see https://godoc.org/github.com/ipfs/interface-go-ipfs-core#CoreAPI
func NewApiWithClient ¶
NewApiWithClient constructs HttpApi with specified endpoint and custom http client
func NewLocalApi ¶
NewLocalApi tries to construct new HttpApi instance communicating with local IPFS daemon
Daemon api address is pulled from the $IPFS_PATH/api file. If $IPFS_PATH env var is not present, it defaults to ~/.ipfs
func NewPathApi ¶
NewPathApi constructs new HttpApi by pulling api address from specified ipfspath. Api file should be located at $ipfspath/api
func NewURLApiWithClient ¶ added in v0.0.2
func (*HttpApi) Dag ¶
func (api *HttpApi) Dag() iface.APIDagService
func (*HttpApi) Request ¶ added in v0.0.2
func (api *HttpApi) Request(command string, args ...string) *RequestBuilder
func (*HttpApi) ResolveNode ¶
func (*HttpApi) ResolvePath ¶
type HttpDagServ ¶
type HttpDagServ httpNodeAdder
func (*HttpDagServ) AddMany ¶
func (api *HttpDagServ) AddMany(ctx context.Context, nds []format.Node) error
func (*HttpDagServ) Get ¶
func (api *HttpDagServ) Get(ctx context.Context, c cid.Cid) (format.Node, error)
func (*HttpDagServ) GetMany ¶
func (api *HttpDagServ) GetMany(ctx context.Context, cids []cid.Cid) <-chan *format.NodeOption
func (*HttpDagServ) Pinning ¶
func (api *HttpDagServ) Pinning() format.NodeAdder
func (*HttpDagServ) RemoveMany ¶
func (api *HttpDagServ) RemoveMany(ctx context.Context, cids []cid.Cid) error
type KeyAPI ¶
type KeyAPI HttpApi
type ObjectAPI ¶
type ObjectAPI HttpApi
func (*ObjectAPI) AppendData ¶
type PinAPI ¶
type PinAPI HttpApi
type Request ¶
type Request struct { Ctx context.Context ApiBase string Command string Args []string Opts map[string]string Body io.Reader Headers map[string]string }
func NewRequest ¶
type RequestBuilder ¶
type RequestBuilder struct {
// contains filtered or unexported fields
}
RequestBuilder is an IPFS commands request builder.
func (*RequestBuilder) Arguments ¶
func (r *RequestBuilder) Arguments(args ...string) *RequestBuilder
Arguments adds the arguments to the args.
func (*RequestBuilder) Body ¶
func (r *RequestBuilder) Body(body io.Reader) *RequestBuilder
Body sets the request body to the given reader.
func (*RequestBuilder) BodyBytes ¶
func (r *RequestBuilder) BodyBytes(body []byte) *RequestBuilder
BodyBytes sets the request body to the given buffer.
func (*RequestBuilder) BodyString ¶
func (r *RequestBuilder) BodyString(body string) *RequestBuilder
BodyString sets the request body to the given string.
func (*RequestBuilder) Exec ¶
func (r *RequestBuilder) Exec(ctx context.Context, res interface{}) error
Exec sends the request a request and decodes the response.
func (*RequestBuilder) FileBody ¶
func (r *RequestBuilder) FileBody(body io.Reader) *RequestBuilder
FileBody sets the request body to the given reader wrapped into multipartreader.
func (*RequestBuilder) Header ¶
func (r *RequestBuilder) Header(name, value string) *RequestBuilder
Header sets the given header.
func (*RequestBuilder) Option ¶
func (r *RequestBuilder) Option(key string, value interface{}) *RequestBuilder
Option sets the given option.
type Response ¶
type Response struct { Output io.ReadCloser Error *Error }
type SwarmAPI ¶
type SwarmAPI HttpApi