ipfs

package
v0.0.0-...-e1789b5 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: GPL-3.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Files []File
View Source
var IPLDLinkPrototype cidlink.LinkPrototype = cidlink.LinkPrototype{
	Prefix: cid.Prefix{
		Version:  1,
		Codec:    cid.DagJSON,
		MhType:   mh.SHA3_384,
		MhLength: 48,
	}}
View Source
var IPLDNodePrototype datamodel.NodePrototype = basicnode.Prototype.Any
View Source
var Messages = list.New()

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 GetSubscriptionPeers

func GetSubscriptionPeers(ctx context.Context, ipfscore IPFSCore, topic string) ([]peer.ID, error)

func GetSubscriptionTopics

func GetSubscriptionTopics(ctx context.Context, ipfscore IPFSCore) ([]string, 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 PublishSubscriptionMessage

func PublishSubscriptionMessage(ctx context.Context, ipfscore IPFSCore, topic string, message SubscriptionMessage) error

func SubscribeToTopic

func SubscribeToTopic(ctx context.Context, ipfscore IPFSCore, topic string) error

Types

type File

type File struct {
	Cid  string
	Size int
}

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

func (*IPFSCore) PutIPFSBlock

func (store *IPFSCore) PutIPFSBlock(ctx context.Context, data []byte) (cid.Cid, 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)

type SubscriptionMessage

type SubscriptionMessage struct {
	Did   string
	Type  string
	Data  string
	Time  time.Time
	Topic string
	Read  bool
}

swagger:response message

func GetSubscriptionMessages

func GetSubscriptionMessages(ctx context.Context, ipfscore IPFSCore, topic string) ([]SubscriptionMessage, error)

Jump to

Keyboard shortcuts

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