ipfs

package
v0.0.0-...-95c1484 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Debug    bool
	RepoPath string
}

Config specifies service settings.

type KuboNode

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

KuboNode is an instance of a IPFS Kubo node

func (*KuboNode) Close

func (node *KuboNode) Close() error

Close closes the connections of IPFS node

func (*KuboNode) ConfigEncodePrivateKey

func (node *KuboNode) ConfigEncodePrivateKey() string

ConfigEncodePrivateKey returns the node private key encoded

func (*KuboNode) ConfigEncodePublicKey

func (node *KuboNode) ConfigEncodePublicKey() string

ConfigEncodePublicKey returns the node public key encoded

func (*KuboNode) Connect

func (node *KuboNode) Connect(peerInfos []peer.AddrInfo) error

Connect connects the Node to the IPFS peers

func (*KuboNode) CoreAPI

func (node *KuboNode) CoreAPI() icore.CoreAPI

CoreAPI returns the Core API of the IPFS node

func (*KuboNode) ID

func (node *KuboNode) ID() string

ID returns the node peer ID

type Node

type Node interface {
	// Connect connects the Node to the IPFS peers
	Connect(peerInfos []peer.AddrInfo) error

	// ID returns the node peer ID
	ID() string

	// ConfigEncodePrivateKey returns the node private key encoded
	ConfigEncodePrivateKey() string

	// ConfigEncodePublicKey returns the node public key encoded
	ConfigEncodePublicKey() string

	// CoreAPI returns the Core API of the IPFS node
	CoreAPI() icore.CoreAPI

	// Close closes the connections of IPFS node
	Close() error
}

Node is an interface for IPFS node

func NewKuboNode

func NewKuboNode(ctx context.Context, cfg Config) (Node, error)

NewKuboNode creates a new instance of IPFS Kubo Node

Jump to

Keyboard shortcuts

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