remote

package
v0.0.0-...-b926886 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Unlicense Imports: 25 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 {
	Logger *slog.Logger
	Host   host.Host
	DHT    *dht.IpfsDHT
	Proxy  *proxy.Proxy
}

type Handler

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

func New

func New(ctx context.Context, cfg *Config, remote *Remote) (h *Handler, err error)

Setups a remote connection handler the passed context is used only during configuration

func (*Handler) Close

func (h *Handler) Close() (err error)

func (*Handler) Protocol

func (h *Handler) Protocol() (protocol protocol.ID)

type Remote

type Remote struct {
	// Timeout when GC active protocol connections
	StreamTimeout time.Duration
	// Timeout for the refresh process
	RefreshTimeout time.Duration
	// Interval between refresh processes
	RefreshInterval time.Duration
	// Protocol of the remote service
	// This should be the same as the one advertised by remote
	Protocol protocol.ID
	// Name used for handling the service with the configured proxy
	Host string
	// Listen address for incoming requests
	ListenAddress multiaddr.Multiaddr
	// Optional. Remote peers address from which consume the remote service
	// If a DHT is passed the service could be advertised locally and the P2P
	// will resolve the address automatically
	Addresses []multiaddr.Multiaddr
	// Optional. Allowed peers to request the service from. This will prevent consuming
	// the service from untrusted peers
	AllowedPeers []peer.ID
}

Jump to

Keyboard shortcuts

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