ipfs

package
v0.0.0-...-8cd5e98 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPFSStorageDriver

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

IPFSStorageDriver implements the StorageDriver interface for IPFS.

func NewIPFSDriver

func NewIPFSDriver(ipfsNodeAddress string, keyManager cryptography.KeyManager) *IPFSStorageDriver

NewIPFSStorageDriver initializes a new IPFS storage driver.

func (*IPFSStorageDriver) Create

func (ipfs *IPFSStorageDriver) Create(ctx context.Context, publicKey kyber.Point, data []byte) (string, error)

Create stores data in IPFS and returns the hash of the stored content.

func (*IPFSStorageDriver) Delete

func (ipfs *IPFSStorageDriver) Delete(key string) error

Delete is not directly supported by IPFS as it is immutable; data will be garbage collected if not pinned.

func (*IPFSStorageDriver) Read

func (ipfs *IPFSStorageDriver) Read(ctx context.Context, privateKey kyber.Scalar, cid string) ([]byte, error)

Read retrieves data from IPFS by the content hash.

func (*IPFSStorageDriver) Update

func (ipfs *IPFSStorageDriver) Update(key string, value []byte) error

Update is not directly supported by IPFS as it is immutable; data must be re-added for changes.

Jump to

Keyboard shortcuts

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