ipfs

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client will write new documents to IPFS and read existing documents from IPFS based on CID. It implements Sidetree CAS interface.

func New

New creates cas client. If no CID version is specified, then v1 will be used by default.

func (*Client) Read

func (m *Client) Read(cid string) ([]byte, error)

Read reads the content for the given CID from CAS. returns the contents of CID.

func (*Client) Write

func (m *Client) Write(content []byte) (string, error)

Write writes the given content to IPFS. Returns the address (CID) of the content.

func (*Client) WriteWithCIDFormat added in v0.1.2

func (m *Client) WriteWithCIDFormat(content []byte, opts ...extendedcasclient.CIDFormatOption) (string, error)

WriteWithCIDFormat writes the given content to IPFS using the provided CID format options. Returns the address (CID) of the content. TODO (#443): Support v1 CID formats (different multibases and multicodecs) other than just the IPFS default.

Jump to

Keyboard shortcuts

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