multiswarm

package
v0.0.0-...-d4b7e32 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: MPL-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTransportNotExist = errors.New("transport does not exist for scheme")
)

Functions

func New

func New(m map[string]DynSwarm) p2p.Swarm[Addr]

New creates a swarm with a multiplexed addressed space from the elements of m

func NewSecure

func NewSecure[Pub any](m map[string]DynSecureSwarm[Pub]) p2p.SecureSwarm[Addr, Pub]

func NewSecureAsk

func NewSecureAsk[Pub any](m map[string]DynSecureAskSwarm[Pub]) p2p.SecureAskSwarm[Addr, Pub]

Types

type Addr

type Addr struct {
	Scheme string
	Addr   p2p.Addr
}

func (Addr) Key

func (a Addr) Key() string

func (Addr) Map

func (a Addr) Map(f func(p2p.Addr) p2p.Addr) p2p.Addr

func (Addr) MarshalText

func (a Addr) MarshalText() ([]byte, error)

func (Addr) String

func (a Addr) String() string

func (Addr) Unwrap

func (a Addr) Unwrap() p2p.Addr

type AddrSchema

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

AddrSchema is an address scheme for parsing addresses from multiple swarms

func NewSchemaFromSecureSwarms

func NewSchemaFromSecureSwarms[Pub any](sws map[string]DynSecureSwarm[Pub]) AddrSchema

func NewSchemaFromSwarms

func NewSchemaFromSwarms(sws map[string]DynSwarm) AddrSchema

func (AddrSchema) ParseAddr

func (as AddrSchema) ParseAddr(x []byte) (Addr, error)

type DynSecureAskSwarm

type DynSecureAskSwarm[Pub any] p2p.SecureAskSwarm[p2p.Addr, Pub]

func WrapSecureAskSwarm

func WrapSecureAskSwarm[T p2p.Addr, Pub any](x p2p.SecureAskSwarm[T, Pub]) DynSecureAskSwarm[Pub]

type DynSecureSwarm

type DynSecureSwarm[Pub any] p2p.SecureSwarm[p2p.Addr, Pub]

func WrapSecureSwarm

func WrapSecureSwarm[T p2p.Addr, Pub any](x p2p.SecureSwarm[T, Pub]) DynSecureSwarm[Pub]

type DynSwarm

type DynSwarm p2p.Swarm[p2p.Addr]

func WrapSwarm

func WrapSwarm[T p2p.Addr](x p2p.Swarm[T]) DynSwarm

Jump to

Keyboard shortcuts

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