Documentation
¶
Index ¶
- Constants
- func AddData(node *core.IpfsNode, reader io.Reader, pin bool) (*cid.Cid, error)
- func AddDataToDirectory(node *core.IpfsNode, dir uio.Directory, fname string, reader io.Reader) (*cid.Cid, error)
- func AddLinkToDirectory(node *core.IpfsNode, dir uio.Directory, fname string, pth string) error
- func AddObject(node *core.IpfsNode, reader io.Reader, pin bool) (*cid.Cid, error)
- func DataAtPath(node *core.IpfsNode, pth string) ([]byte, error)
- func GetObjectAtPath(node *core.IpfsNode, pth string) ([]byte, error)
- func IdentityConfig(sk libp2pc.PrivKey) (config.Identity, error)
- func IpnsSubs(node *core.IpfsNode) ([]string, error)
- func LinksAtPath(node *core.IpfsNode, pth string) ([]*ipld.Link, error)
- func NodeAtCid(node *core.IpfsNode, id cid.Cid) (ipld.Node, error)
- func NodeAtLink(node *core.IpfsNode, link *ipld.Link) (ipld.Node, error)
- func NodeAtPath(node *core.IpfsNode, pth string) (ipld.Node, error)
- func PinNode(node *core.IpfsNode, nd ipld.Node, recursive bool) error
- func PrintSwarmAddrs(node *core.IpfsNode) error
- func PublicIPv4Addr(node *core.IpfsNode) (string, error)
- func Publish(node *core.IpfsNode, topic string, data []byte, connectTimeout time.Duration) error
- func PublishIPNS(node *core.IpfsNode, id string) (iface.IpnsEntry, error)
- func ResolveIPNS(node *core.IpfsNode, name peer.ID) (iface.Path, error)
- func ShortenID(id string) string
- func StatObjectAtPath(node *core.IpfsNode, pth string) (*iface.ObjectStat, error)
- func Subscribe(node *core.IpfsNode, ctx context.Context, topic string, discover bool, ...) error
- func SwarmConnect(node *core.IpfsNode, addrs []string) ([]string, error)
- func SwarmConnected(node *core.IpfsNode, pid peer.ID) (bool, error)
- func UnmarshalPrivateKey(data []byte) (libp2pc.PrivKey, error)
- func UnmarshalPrivateKeyFromString(key string) (libp2pc.PrivKey, error)
- func UnmarshalPublicKeyFromString(key string) (libp2pc.PubKey, error)
- func UnpinCid(node *core.IpfsNode, id cid.Cid, recursive bool) error
- func UnpinNode(node *core.IpfsNode, nd ipld.Node, recursive bool) error
- type ConnInfos
- type Link
- type Node
Constants ¶
const PublishTimeout = time.Second * 5
Variables ¶
This section is empty.
Functions ¶
func AddDataToDirectory ¶
func AddDataToDirectory(node *core.IpfsNode, dir uio.Directory, fname string, reader io.Reader) (*cid.Cid, error)
AddDataToDirectory adds reader bytes to a virtual dir
func AddLinkToDirectory ¶
AddLinkToDirectory adds a link to a virtual dir
func DataAtPath ¶
DataAtPath return bytes under an ipfs path
func GetObjectAtPath ¶
GetObjectAtPath returns the DAG object at the given path
func IdentityConfig ¶
IdentityConfig initializes a new identity.
func LinksAtPath ¶
LinksAtPath return ipld links under a path
func NodeAtLink ¶
NodeAtLink returns the node behind an ipld link
func NodeAtPath ¶
NodeAtPath returns the last node under path
func PrintSwarmAddrs ¶
PrintSwarmAddrs prints the addresses of the host
func PublicIPv4Addr ¶
PublicIPv4Addr uses the ipfs NAT traveral result to locate a (possibly) public ipv4 address. this method is used to inform cafe clients of the http api address
func PublishIPNS ¶
PublishIPNS publishes a content id to ipns
func ResolveIPNS ¶
ResolveIPNS resolves an ipns path to an ipfs path
func StatObjectAtPath ¶ added in v0.1.12
StatObjectAtPath returns info about an object
func Subscribe ¶
func Subscribe(node *core.IpfsNode, ctx context.Context, topic string, discover bool, msgs chan iface.PubSubMessage) error
Subscribe subscribes to a topic
func SwarmConnect ¶
SwarmConnect opens a direct connection to a list of peer multi addresses
func SwarmConnected ¶ added in v0.1.12
SwarmConnected returns whether or not the node has the peer in its current swarm
func UnmarshalPrivateKey ¶
UnmarshalPrivateKey converts a protobuf serialized private key into its representative object
func UnmarshalPrivateKeyFromString ¶
UnmarshalPrivateKeyFromString attempts to create a private key from a base64 encoded string
func UnmarshalPublicKeyFromString ¶
UnmarshalPublicKeyFromString attempts to create a public key from a base64 encoded string