connmanager

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressesMap

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

AddressesMap -

func NewAddressesMap

func NewAddressesMap() *AddressesMap

NewAddressesMap constructs a new SyncMap

func (*AddressesMap) Delete

func (m *AddressesMap) Delete(k string)

Delete -

func (*AddressesMap) Get

func (m *AddressesMap) Get(k string) (*addressState, bool)

Get -

func (*AddressesMap) GetOrPut

func (m *AddressesMap) GetOrPut(k string, v *addressState) (*addressState, bool)

GetOrPut -

func (*AddressesMap) ListKeys

func (m *AddressesMap) ListKeys() []string

ListKeys -

func (*AddressesMap) ListValues

func (m *AddressesMap) ListValues() []*addressState

ListValues -

func (*AddressesMap) Put

func (m *AddressesMap) Put(k string, v *addressState)

Put -

func (*AddressesMap) Range

func (m *AddressesMap) Range(i func(k string, v *addressState) bool)

Range -

type ConnectionHandler

type ConnectionHandler func(*net.Connection) error

type ConnectionsMap

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

ConnectionsMap -

func NewConnectionsMap

func NewConnectionsMap() *ConnectionsMap

NewConnectionsMap constructs a new SyncMap

func (*ConnectionsMap) Delete

func (m *ConnectionsMap) Delete(k crypto.PublicKey)

Delete -

func (*ConnectionsMap) Get

func (m *ConnectionsMap) Get(k crypto.PublicKey) (*peerbox, bool)

Get -

func (*ConnectionsMap) GetOrPut

func (m *ConnectionsMap) GetOrPut(k crypto.PublicKey, v *peerbox) (*peerbox, bool)

GetOrPut -

func (*ConnectionsMap) ListKeys

func (m *ConnectionsMap) ListKeys() []crypto.PublicKey

ListKeys -

func (*ConnectionsMap) ListValues

func (m *ConnectionsMap) ListValues() []*peerbox

ListValues -

func (*ConnectionsMap) Put

func (m *ConnectionsMap) Put(k crypto.PublicKey, v *peerbox)

Put -

func (*ConnectionsMap) Range

func (m *ConnectionsMap) Range(i func(k crypto.PublicKey, v *peerbox) bool)

Range -

type Manager

type Manager interface {
	GetConnection(
		context.Context,
		*peer.ConnectionInfo,
	) (*net.Connection, error)
	CloseConnection(
		context.Context,
		crypto.PublicKey,
	)
}

func New

func New(
	ctx context.Context,
	n net.Network,
	handler ConnectionHandler,
) Manager

Jump to

Keyboard shortcuts

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