ipfs

package
v0.0.0-...-0269a1e Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IpfsID is the ID for state of a ipfs client in the connection state.
	IpfsID = "ipfs"
)

Variables

This section is empty.

Functions

func State

func State(conState jsonrpc.State) *ipfsState

State from a connection. If no state is present, it is initialized

Types

type Client

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

Client exposes ipfs related functionality

func NewClient

func NewClient(peer *ipfslite.Peer) *Client

func (*Client) GetFile

func (c *Client) GetFile(ctx context.Context, conState jsonrpc.State, contentId string) ([]byte, error)

GetFile gets a file from the ipfs client

func (*Client) ListCids

func (c *Client) ListCids(ctx context.Context, conState jsonrpc.State) ([]string, error)

ListCids lists all CIDs stored in the ipfs client

func (*Client) RemoveAllFiles

func (c *Client) RemoveAllFiles(ctx context.Context, conState jsonrpc.State) error

RemoveAllFiles removes all files from the ipfs client

func (*Client) RemoveFile

func (c *Client) RemoveFile(ctx context.Context, contentId string) (bool, error)

RemoveFile removes a file from the ipfs client

func (*Client) StoreFile

func (c *Client) StoreFile(ctx context.Context, conState jsonrpc.State, data []byte) (string, error)

StoreFile stores a file in the ipfs client

Jump to

Keyboard shortcuts

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