p2p

package
v0.0.0-...-bc1f52c Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 39 Imported by: 0

Documentation

Overview

Package P2P represent a peer to peer linked on go-libp2p.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EndPoint

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

func New

func New(
	cfg config.P2P,
	per persistenceadapter.Adapter,
	wallets wallet.IWallets,
	logs *zap.Logger,
	evt *event.Event,
	opts ...Option,
) *EndPoint

New represent a new peer to peer adapter.

func (*EndPoint) Enabled

func (e *EndPoint) Enabled() bool

Enabled lets you know if the peer to peer system is activated.

func (*EndPoint) Handle

func (e *EndPoint) Handle(err error)

func (*EndPoint) HasTarget

func (e *EndPoint) HasTarget() bool

func (*EndPoint) Listen

func (e *EndPoint) Listen(stop chan error)

Listen start to listen the peer to peer connexion.

func (*EndPoint) PushMsgForFiles

func (e *EndPoint) PushMsgForFiles(stop chan error)

func (*EndPoint) SetTarget

func (e *EndPoint) SetTarget(target string)

func (*EndPoint) Shutdown

func (e *EndPoint) Shutdown()

func (*EndPoint) Target

func (e *EndPoint) Target() string

type Option

type Option func(e *EndPoint)

Option is the type of option passed to the constructor.

func WithXCache

func WithXCache(cfg config.XCache) Option

WithXCache offer the possibility to add a cache system to the peer to peer adapter.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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