testutil

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package testutil holds helpers shared by tests across packages

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FreePort

func FreePort(t testing.TB) int

The kernel may reissue a released port before it's bound, so ports already handed out by this process are skipped

func WriteTempFile added in v0.15.0

func WriteTempFile(t testing.TB, name string, content []byte) string

Writes into a test temp directory and returns the path

Types

type CA added in v0.15.0

type CA struct {
	CertPEM []byte
	// contains filtered or unexported fields
}

func NewCA added in v0.15.0

func NewCA(t testing.TB, name string) *CA

func (*CA) Issue added in v0.15.0

func (c *CA) Issue(t testing.TB, hosts ...string) Leaf

Each host is added as an IP or DNS name as appropriate

type Leaf added in v0.15.0

type Leaf struct {
	CertPEM []byte
	KeyPEM  []byte
}

Usable by both sides of a connection

Jump to

Keyboard shortcuts

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