teleportation

package
v0.0.0-...-27c307a Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PortalStr = []string{
		PortalSource: "source",
		PortalSink:   "sink",
	}
)

Functions

func SetDialRequestChannel

func SetDialRequestChannel(c chan *DialRequest) ofn.OFN

func WithDoTeleportFunc

func WithDoTeleportFunc(f DoTeleportFunc) ofn.OFN

func WithLogger

func WithLogger(logger logrus.FieldLogger) ofn.OFN

func WithName

func WithName(name string) ofn.OFN

func WithNewDial

func WithNewDial(f NewDial) ofn.OFN

func WithOnCloseHandler

func WithOnCloseHandler(h OnCloseHandler) ofn.OFN

func WithOnDoTeleportFunc

func WithOnDoTeleportFunc(f OnDoTeleportFunc) ofn.OFN

func WithOnErrorHandler

func WithOnErrorHandler(h OnErrorHandler) ofn.OFN

func WithSink

func WithSink(addr net.Addr) ofn.OFN

func WithSource

func WithSource(addr net.Addr) ofn.OFN

func WithTransport

func WithTransport(t transport.Transport) ofn.OFN

Types

type DialRequest

type DialRequest struct {
	Conn net.Conn
	Quit chan struct{}
}

func NewDialRequest

func NewDialRequest(conn net.Conn) *DialRequest

func NewDialRequestWithQuit

func NewDialRequestWithQuit(conn net.Conn, quit chan struct{}) *DialRequest

type DoTeleportFunc

type DoTeleportFunc func(label string) error

type NewDial

type NewDial func(network, address string) (net.Conn, error)

type NewTeleportationSinkOption

type NewTeleportationSinkOption = ofn.OFN

type NewTeleportationSourceOption

type NewTeleportationSourceOption = ofn.OFN

type OnCloseHandler

type OnCloseHandler func()

type OnDoTeleportFunc

type OnDoTeleportFunc func() error

type OnErrorHandler

type OnErrorHandler func(error)

type Portal

type Portal int
const (
	PortalSource Portal = iota + 1
	PortalSink
)

func (Portal) String

func (t Portal) String() string

type Teleportation

type Teleportation interface {
	Name() string
	Source() net.Addr
	Sink() net.Addr
	Portal() Portal
	Transport() transport.Transport
	DataChannels() []transport.DataChannel
	Close() error
}

type TeleportationSink

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

func NewTeleportationSink

func NewTeleportationSink(opts ...NewTeleportationSinkOption) (*TeleportationSink, error)

func (*TeleportationSink) Close

func (ts *TeleportationSink) Close() error

func (*TeleportationSink) DataChannels

func (ts *TeleportationSink) DataChannels() []transport.DataChannel

func (*TeleportationSink) Name

func (ts *TeleportationSink) Name() string

func (*TeleportationSink) OnDoTeleport

func (ts *TeleportationSink) OnDoTeleport(label string) error

func (*TeleportationSink) Portal

func (ts *TeleportationSink) Portal() Portal

func (*TeleportationSink) Sink

func (ts *TeleportationSink) Sink() net.Addr

func (*TeleportationSink) Source

func (ts *TeleportationSink) Source() net.Addr

func (*TeleportationSink) Transport

func (ts *TeleportationSink) Transport() transport.Transport

type TeleportationSource

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

func NewTeleportationSource

func NewTeleportationSource(opts ...NewTeleportationSourceOption) (*TeleportationSource, error)

func (*TeleportationSource) Close

func (ts *TeleportationSource) Close() error

func (*TeleportationSource) DataChannels

func (ts *TeleportationSource) DataChannels() []transport.DataChannel

func (*TeleportationSource) Name

func (ts *TeleportationSource) Name() string

func (*TeleportationSource) Portal

func (ts *TeleportationSource) Portal() Portal

func (*TeleportationSource) Sink

func (ts *TeleportationSource) Sink() net.Addr

func (*TeleportationSource) Source

func (ts *TeleportationSource) Source() net.Addr

func (*TeleportationSource) Transport

func (ts *TeleportationSource) Transport() transport.Transport

Jump to

Keyboard shortcuts

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