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 ¶
func New(url string, timeout time.Duration, cacheSize int, metrics metricsProvider, opts ...extendedcasclient.CIDFormatOption) *Client
New creates cas client. If no CID version is specified, then v1 will be used by default.
func (*Client) GetPrimaryWriterType ¶
GetPrimaryWriterType returns primary writer type.
func (*Client) Read ¶
Read reads the content for the given CID from CAS. returns the contents of CID.
func (*Client) Write ¶
Write writes the given content to IPFS. Returns the address (CID) of the content.
func (*Client) WriteWithCIDFormat ¶
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.