ipfs

package
v0.0.0-...-22aeabe Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: GPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateIPFSNodeKeyPair

func GenerateIPFSNodeKeyPair() ([]byte, []byte, error)

func GenerateIPNSKeyPair

func GenerateIPNSKeyPair() ([]byte, []byte, error)

func GetIPFSNodeIdentity

func GetIPFSNodeIdentity(pubb []byte) peer.ID

func GetIPFSNodeIdentityFromPublicKeyName

func GetIPFSNodeIdentityFromPublicKeyName(key string) (peer.ID, error)

func GetIPNSPublicKeyName

func GetIPNSPublicKeyName(pubb []byte) (string, error)

func GetIPNSRecordFromW3S

func GetIPNSRecordFromW3S(ctx context.Context, authToken string, name string) (cid.Cid, error)

func PinIPFSBlockToW3S

func PinIPFSBlockToW3S(ctx context.Context, ipfs iface.CoreAPI, authToken string, block *blocks.BasicBlock) error

func PinIPLDBlockToW3S

func PinIPLDBlockToW3S(ctx context.Context, ipfsNode iface.CoreAPI, authToken string, block *blocks.BasicBlock) (cid.Cid, error)

func PublishIPNSRecordForDAGNode

func PublishIPNSRecordForDAGNode(ctx context.Context, ipfscore IPFSCore, authtoken string, cid cid.Cid, keyname string, privkey []byte, pubkey []byte) error

func PublishIPNSRecordForDAGNodeToW3S

func PublishIPNSRecordForDAGNodeToW3S(ctx context.Context, authToken string, cid cid.Cid, privkey []byte, pubkey []byte) error
func PutNostrEventAsIPLDLink(ctx context.Context, ipfs IPFSCore, evt nostr.Event) (datamodel.Link, error)

Types

type IPFSCore

type IPFSCore struct {
	Ctx      context.Context
	Api      iface.CoreAPI
	Node     ipfsCore.IpfsNode
	Shutdown func()
	LS       linking.LinkSystem
	W3S      w3s.Client
}

func StartIPFSNode

func StartIPFSNode(ctx context.Context, privkey []byte, pubkey []byte) (*IPFSCore, error)

func (*IPFSCore) Get

func (store *IPFSCore) Get(ctx context.Context, key string) ([]byte, error)

func (*IPFSCore) Has

func (store *IPFSCore) Has(ctx context.Context, key string) (bool, error)

func (*IPFSCore) OpenRead

func (store *IPFSCore) OpenRead(lnkCtx linking.LinkContext, lnk datamodel.Link) (io.Reader, error)

func (*IPFSCore) OpenWrite

func (store *IPFSCore) OpenWrite(lnkCtx linking.LinkContext, lnk datamodel.Link) (io.Writer, linking.BlockWriteCommitter, error)

func (*IPFSCore) Put

func (store *IPFSCore) Put(ctx context.Context, key string, data []byte) error

type IPFSLinkWriter

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

func (*IPFSLinkWriter) BlockWriteCommit

func (w *IPFSLinkWriter) BlockWriteCommit(lnk datamodel.Link) error

func (*IPFSLinkWriter) Write

func (w *IPFSLinkWriter) Write(d []byte) (int, error)

Jump to

Keyboard shortcuts

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