util

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTLSCerts

func GenerateTLSCerts(outputDir string, serverCN string, serverSANs []string) (caCertPath, serverCertPath, serverKeyPath string, err error)

GenerateTLSCerts generates a CA, a server key, and a server certificate signed by the CA. It includes Subject Alternative Names (SANs) for modern TLS compliance. Returns paths to ca.crt, server.crt, and server.key.

func GetEphemeralPort

func GetEphemeralPort() (int, error)

GetEphemeralPort finds an available ephemeral port on localhost.

func RunCommandInBackground

func RunCommandInBackground(outputBuffer *bytes.Buffer, args ...string) *exec.Cmd

func StartTestHttpServer

func StartTestHttpServer(port int) (*http.Server, error)

Helper to start a simple HTTP server (for non-TLS tests)

func StartTestHttpsServer

func StartTestHttpsServer(port int, certFile, keyFile string) (*http.Server, error)

Helper to start a simple HTTPS server with custom certs

func WaitForPort

func WaitForPort(addr string, timeout time.Duration)

WaitForPort blocks until a TCP port is listening or timeout occurs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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