tst

package
v0.0.96 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 9 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(port uint16) error

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(h http.Handler, domain string, httpsPort uint16) (*httptest.Server, error)

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