ipfs

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 34 Imported by: 0

Documentation

Overview

connect to server through ipfs network

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPFSWire

type IPFSWire struct {
	// base
	wire.BaseWire
	// contains filtered or unexported fields
}

ipfs wire

func (*IPFSWire) Address

func (w *IPFSWire) Address() net.IP

func (*IPFSWire) Close

func (w *IPFSWire) Close() error

send message to ipfs wire

func (*IPFSWire) Decode

func (w *IPFSWire) Decode(msg *message.Message) error

Decode

func (*IPFSWire) Encode

func (w *IPFSWire) Encode(msg *message.Message) error

Encode

func (*IPFSWire) Endpoint

func (w *IPFSWire) Endpoint() string

type IPFSWireManager

type IPFSWireManager struct {
	wire.BaseWireManager
	*P2PHost
}

IPFS wire manager

func (*IPFSWireManager) Dial

func (m *IPFSWireManager) Dial(endpoint string) error

func (*IPFSWireManager) Protocol

func (m *IPFSWireManager) Protocol() string

type P2PHost

type P2PHost struct {
	// libp2p host
	host.Host
	// discovery
	*dis_routing.RoutingDiscovery
	// contains filtered or unexported fields
}

p2p host

func GetP2PHost

func GetP2PHost() *P2PHost

func NewP2PHost

func NewP2PHost() (*P2PHost, error)

func (*P2PHost) AllowPeer

func (h *P2PHost) AllowPeer(peer string) error

add peer to allowlist of resource manager

func (*P2PHost) Background

func (h *P2PHost) Background() error

run some background jobs

func (*P2PHost) Bootstrap

func (h *P2PHost) Bootstrap(peers []string) error

bootstrap with public peers

func (*P2PHost) GetValue

func (h *P2PHost) GetValue(ctx context.Context, key string, opts ...routing.Option) ([]byte, error)

func (*P2PHost) PutValue

func (h *P2PHost) PutValue(ctx context.Context, key string, value []byte, opts ...routing.Option) (err error)

Jump to

Keyboard shortcuts

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