dag

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IPFS_HTTP_GATEWAYS = []string{"https://w3s.link/ipfs/%s", "https://dweb.link/ipfs/%s", "https://ipfs.io/ipfs/%s"}
)

Functions

func NewHttpContentFetcher added in v0.1.9

func NewHttpContentFetcher(ipfsFetchUrls []string) *httpContentFetcher

Types

type UnixfsAPI

type UnixfsAPI interface {
	GenerateDag(ctx context.Context, reader io.Reader) (cid.Cid, error)

	// free the DAG stored on disk, thereby freeing up space
	// to be used only if the dag is persisted on disk
	// this would also do a GC in order to make the space immediately
	// available
	RemoveDag(ctx context.Context, cid cid.Cid) error

	// get the data stored in ipfs referenced by cid.
	// If the node is online (networking enabled), this would also search
	// in other ipfs nodes (using bitswap).
	// NOTE: there's a timeout on bitswap method, after which, http is attempted.
	// If the dag is cleaned up from local store, it might take time for the
	// data to be pinned/available on remote nodes, which means that a "upload"
	// followed immediately by a "get" might not work.
	Get(ctx context.Context, cid cid.Cid) ([]byte, error)
}

merkle dag manipulator. There are various ways to generate merkle dag for some content. The implementors of this interface should capture those settings. Note that this means that those settings remain the same for an instance (across all requests on that instance). Though some implementor can use context to change the settings per request.

func NewUnixfsAPI

func NewUnixfsAPI(ipfs coreapi.CoreExtensionAPI, cidVersion int, cidGenerationOnly bool, ipfsFetchUrls []string) UnixfsAPI

Jump to

Keyboard shortcuts

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