tst

package
v0.0.70 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package tst implements some common test functionality needed across ong.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPort

func GetPort() uint16

GetPort returns a random port. The idea is that different tests should run on different independent ports to avoid collisions.

func Ping

func Ping(t attest.TB, port uint16)

Ping waits for port to be open, it fails after a number of given seconds.

func SecretKey

func SecretKey() string

SecretKey returns a secret key that is valid and can be used in tests.

func TlsServer

func TlsServer(t attest.TB, h http.Handler, domain string, httpsPort uint16) *httptest.Server

TlsServer starts a test TLS server at a predetermined port and returns it. It's upto callers to close the server.

Types

This section is empty.

Jump to

Keyboard shortcuts

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