utils

package
v0.0.0-...-5e81e3c Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleSwitchListener = "switch-listener"
	RoleSwitchClient   = "switch-client"

	RoleAdapterListener = "adapter-listener"
	RoleAdapterClient   = "adapter-client"

	RoleBenchmarkListener = "benchmark-listener"
	RoleBenchmarkClient   = "benchmark-client"
)

Variables

This section is empty.

Functions

func GenerateCertificate

func GenerateCertificate(rsaBits int, caCfg *x509.Certificate, caPrivKey *rsa.PrivateKey, validity time.Duration, routeID, ip, role string) ([]byte, []byte, error)

func GenerateCertificateAuthority

func GenerateCertificateAuthority(rsaBits int, validity time.Duration) (*x509.Certificate, []byte, []byte, *rsa.PrivateKey, error)

func GetPublicIP

func GetPublicIP(stunAddr string) (net.IP, error)

func HandleTestConn

func HandleTestConn(verbose bool, conn net.Conn, benchmarkLimit int64) error

func IsClosedErr

func IsClosedErr(err any) bool

func PipeShellCommand

func PipeShellCommand(command string, src io.Reader, dst io.Writer) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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