registry

package
v1.18.4-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2021 License: MPL-2.0 Imports: 2 Imported by: 2

Documentation

Overview

Registry tracks connections/addresses on which we are listening on, to allow us to pick a connection/address that has a NAT port mapping. This also makes our outgoing port stable and same as incoming port which should allow better probability of punching through.

Index

Constants

This section is empty.

Variables

View Source
var (
	Default = New()
)

Functions

func Get

func Get(scheme string, preferred func(interface{}) bool) interface{}

func Register

func Register(scheme string, item interface{})

func Unregister

func Unregister(scheme string, item interface{})

Types

type Registry

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

func New

func New() *Registry

func (*Registry) Get

func (r *Registry) Get(scheme string, preferred func(interface{}) bool) interface{}

Get returns an item for a schema compatible with the given scheme. If any item satisfies preferred, that has precedence over other items.

func (*Registry) Register

func (r *Registry) Register(scheme string, item interface{})

func (*Registry) Unregister

func (r *Registry) Unregister(scheme string, item interface{})

Jump to

Keyboard shortcuts

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