wrtceth

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

Adapter provides an ethernet service

func NewAdapter

func NewAdapter(
	signaler string,
	key string,
	ice []string,
	config *AdapterConfig,
	ctx context.Context,
) *Adapter

NewAdapter creates the adapter

func (*Adapter) Close

func (a *Adapter) Close() error

Close disconnects the adapter from the signaler and closes the TAP device

func (*Adapter) Open

func (a *Adapter) Open() error

Open connects the adapter to the signaler and creates the TAP device

func (*Adapter) Wait

func (a *Adapter) Wait() error

Wait starts the transmission loop

type AdapterConfig

type AdapterConfig struct {
	*wrtcconn.AdapterConfig
	Device             string       // Name to give to the TAP device
	OnSignalerConnect  func(string) // Handler to be called when the adapter has connected to the signaler
	OnPeerConnect      func(string) // Handler to be called when the adapter has connected to a peer
	OnPeerDisconnected func(string) // Handler to be called when the adapter has received a message
	Parallel           int          // Maximum amount of goroutines to use to unmarshal ethernet frames
}

AdapterConfig configures the adapter

Jump to

Keyboard shortcuts

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