tunnel

package
v0.67.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package tunnel contains helpers for a traffic tunneling implementation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReaderSenderLoop

func ReaderSenderLoop(
	ctx context.Context,
	r io.Reader,
	sendFunc func(buf []byte) error,
	connClosed <-chan struct{},
	logger logging.Logger,
) (retErr error)

ReaderSenderLoop implements a loop that reads bytes from the reader passed in and sends those bytes using sendFunc. The loop will exit for any error received or if the context errors.

func RecvWriterLoop

func RecvWriterLoop(
	ctx context.Context,
	recvFunc func() ([]byte, error),
	w io.Writer,
	rsDone <-chan struct{},
	logger logging.Logger,
) (retErr error)

RecvWriterLoop implements a loop that receives bytes using recvFunc and writes those bytes to the writer. The loop will exit for any error received or if the context errors.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳