Documentation
¶
Index ¶
- func GenerateEd25519Key() ([]byte, error)
- type Client
- func (c *Client) Get(key []byte) ([]byte, error)
- func (c *Client) Has(key []byte) (bool, error)
- func (c *Client) ID() peer.ID
- func (c *Client) Pull(addr string, key []byte) error
- func (c *Client) Push(addr string, key []byte) error
- func (c *Client) Put(value []byte, codec uint64) ([]byte, error)
- func (c *Client) Shutdown() error
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateEd25519Key ¶ added in v0.5.2
GenerateEd25519Key generates a random Ed25519 libp2p private key.
Types ¶
type Client ¶ added in v0.4.9
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Get ¶ added in v0.4.9
Get gets the value corresponding to the given key from the local ipld.LinkSystem The key must be a valid ipld.Link and the value returned is encoded ipld.Node.
func (*Client) Has ¶ added in v0.4.9
Has checks whether the value corresponding to the given key is present in the local datastore. The key must be a valid ipld.Link.
func (*Client) Pull ¶ added in v0.4.9
Pull downloads the data corresponding to the given key from the given addr. The key must be a valid ipld.Link, and the addr must be a valid multiaddr that includes peer ID. See peer.AddrInfoFromString.
func (*Client) Push ¶ added in v0.4.9
Push requests the given addr to download the given key from this node. The key must be a valid ipld.Link, and the addr must be a valid multiaddr that includes peer ID. The value corresponding to the given key must be stored in the local datastore prior to calling this function. See: Client.Put, peer.AddrInfoFromString.