tcp

package
v0.0.0-...-dfd1872 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorConnectionClosed = errors.New("ErrorConnectionClosed")
)

Functions

func Recieve

func Recieve(connection net.Conn) ([]byte, error)

func Send

func Send(connection net.Conn, data []byte) error

Types

type Config

type Config struct {
	SecurePort   int `koanf:"secure_port"`
	InsecurePort int `koanf:"insecure_port"`

	// https://blog.pinterjann.is/ed25519-certificates.html
	TLS struct {
		Certificate string `koanf:"certificate"`
		PrivateKey  string `koanf:"private_key"`
	} `koanf:"tls"`
}

type HandleTCP

type HandleTCP func(net.Conn)

type TCP

type TCP interface {
	ListenInsecureTCP(handler HandleTCP) error
	ListenSecureTCP(handler HandleTCP) error
}

func NewTCP

func NewTCP(cfg *Config) TCP

Jump to

Keyboard shortcuts

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