addr

package
v0.3.8-dev-trailers Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2015 License: MIT Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package addr provides utility functions to handle peer addresses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Slice

type Slice []ma.Multiaddr

Slice is a simple slice of addresses that implements the AddrSource interface.

func (Slice) Addrs

func (as Slice) Addrs() []ma.Multiaddr

type Source

type Source interface {
	Addrs() []ma.Multiaddr
}

AddrSource is a source of addresses. It allows clients to retrieve a set of addresses at a last possible moment in time. It is used to query a set of addresses that may change over time, as a result of the network changing interfaces or mappings.

func CombineSources

func CombineSources(srcs ...Source) Source

CombineSources returns a new AddrSource which is the concatenation of all input AddrSources:

combined := CombinedSources(a, b)
combined.Addrs() // append(a.Addrs(), b.Addrs()...)

func UniqueSource

func UniqueSource(srcs ...Source) Source

UniqueSource returns a new AddrSource which omits duplicate addresses from the inputs:

unique := UniqueSource(a, b)
unique.Addrs() // append(a.Addrs(), b.Addrs()...)
               // but only adds each addr once.

Jump to

Keyboard shortcuts

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