api

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: GPL-3.0 Imports: 20 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIPFSAPI

func GetIPFSAPI() *rpc.HttpApi

func GetIPFSAPIUrl

func GetIPFSAPIUrl() string

func IPFSDagPutCBOR

func IPFSDagPutCBOR(data []byte, pin bool, bb bool) (cid.Cid, error)

Publish publishes a simple CBOR struct to IPFS and returns the CID. The parameters are the data, a flag whether to pin the data and a flag whether to allow big blocks.

func IPFSDagPutWithOptions

func IPFSDagPutWithOptions(data []byte, inputCodec string, storeCodec string, pin bool, hash string, allowBigBlock bool) (cid.Cid, error)

Publish publishes a simple CBOR struct to IPFS and returns the CID. This is a kludge, as the kubo client/rpc is not working. The parameters are consistent with the correspconding IPFS API call. Ref. https://docs.ipfs.io/reference/http/api/#api-v0-dag-put

func ResolveRootCID added in v0.7.5

func ResolveRootCID(name string, cached bool) (cid.Cid, error)

Takes an IPFS path name and returns the root CID. The cached field tells the function whether to use the cached value or not.

Types

type DagPutResponse

type DagPutResponse struct {
	Cid struct {
		CidString string `json:"/"`
	} `json:"Cid"`
}

Jump to

Keyboard shortcuts

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