Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CAS ¶
type CAS struct {
// contains filtered or unexported fields
}
CAS represents a content-addressable storage provider.
func New ¶
func New(provider ariesstorage.Provider, casLink string, ipfsClient *ipfs.Client, metrics metricsProvider, cacheSize int, opts ...extendedcasclient.CIDFormatOption) (*CAS, error)
New returns a new CAS that uses the passed in provider as a backing store for local CAS storage. ipfsClient is optional, but if provided (not nil), then writes will go to IPFS in addition to the passed in provider. Reads are always done on only the passed in provider. If no CID version is specified, then v1 will be used by default.
func (*CAS) GetPrimaryWriterType ¶
GetPrimaryWriterType returns primary writer type.
func (*CAS) Read ¶
Read reads the content of the given address from the underlying local CAS provider. Returns the content at the given address.
func (*CAS) Write ¶
Write writes the given content to the underlying CAS provider (and IPFS if configured) using this CAS' default CID version. Returns the address of the content.
func (*CAS) WriteWithCIDFormat ¶
func (p *CAS) WriteWithCIDFormat(content []byte, opts ...extendedcasclient.CIDFormatOption) (string, error)
WriteWithCIDFormat writes the given content to the underlying local CAS provider (and IPFS if configured) using the CID format specified by opts. Returns the address of the content. TODO (#418): Support creating IPFS-compatible CIDs when content is > 256KB. TODO (#443): Support v1 CID formats (different multibases and multicodecs) other than just the IPFS default.