Documentation
¶
Overview ¶
Package buggyhttp is a webserver affected by any kind of network issues
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Listen ¶
func Listen(port int)
Listen on the specified port using a package-level server. Deprecated: prefer New().Start() / New().StartPort() for an isolated, port configurable instance.
func ListenTLS ¶
ListenTLS because buggyhttp also supports bugged TLS. Deprecated: prefer New().StartTLS().
func SecureRandomAlphaString ¶
func SecureRandomBytes ¶
SecureRandomBytes returns the requested number of bytes using crypto/rand
Types ¶
type Server ¶ added in v1.3.16
type Server struct {
// contains filtered or unexported fields
}
Server is a configurable instance of the buggy test server. Each instance keeps its own state (so tests do not share a global counter) and can bind an ephemeral port, avoiding conflicts with other services running locally.
func (*Server) Start ¶ added in v1.3.16
Start binds an ephemeral port on 127.0.0.1, serves in the background and returns the base URL (e.g. http://127.0.0.1:54321). The listener is bound before returning, so the URL is ready to receive requests.