source

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2018 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package source provides implementations of entities, such as network interfaces, that are able to create network connections, i.e. are "sources" of Internet.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	net.Conn
	Ref string // Reference identifier
	Add func(val int) int
	// contains filtered or unexported fields
}

func (*Conn) Close

func (c *Conn) Close() error

type Interface

type Interface struct {
	net.Interface

	// If ErrHook is not nil, it is called each time that the
	// dialer is not able to create a network connection.
	ErrHook func(ref, network, address string, err error)

	// N is the number of network connections that
	// the interface is currenlty handling.
	N int
	// contains filtered or unexported fields
}

Interface is a wrapper around net.Interface and implements the core.Source interface, i.e. is it capable of providing network connections through the device it is referring to.

func (*Interface) Add

func (i *Interface) Add(val int) int

func (*Interface) DialContext

func (i *Interface) DialContext(ctx context.Context, network, address string) (net.Conn, error)

func (*Interface) ID

func (i *Interface) ID() string

func (*Interface) Metrics

func (i *Interface) Metrics() map[string]interface{}

func (*Interface) String

func (i *Interface) String() string

Jump to

Keyboard shortcuts

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