server

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPMainServer

type HTTPMainServer struct {
	// contains filtered or unexported fields
}

HTTPMainServer emulates http Server for TestMain. Do not initialize manualy, use ServerMain(m) instead.

func NewHTTPMainServer

func NewHTTPMainServer(m *testing.M) *HTTPMainServer

func (*HTTPMainServer) Addr

func (s *HTTPMainServer) Addr() string

func (*HTTPMainServer) Cleanup

func (s *HTTPMainServer) Cleanup()

func (*HTTPMainServer) HandleFunc

func (s *HTTPMainServer) HandleFunc(pattern string, handler http.HandlerFunc)

HandleFunc adds handler to test server.

type HTTPServer

type HTTPServer struct {
	// contains filtered or unexported fields
}

HTTPServer emulates http Server. Do not initialize manualy, use Server(t) instead.

func NewHTTPServer

func NewHTTPServer(t *testing.T) *HTTPServer

func (*HTTPServer) Addr

func (s *HTTPServer) Addr() string

func (*HTTPServer) Cleanup

func (s *HTTPServer) Cleanup()

func (*HTTPServer) HandleFunc

func (s *HTTPServer) HandleFunc(pattern string, handler http.HandlerFunc)

HandleFunc adds handler to test server.

Jump to

Keyboard shortcuts

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