server

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockTestEndpoint

type MockTestEndpoint struct {
	RequestURI string
	FileName   string
}

MockTestEndpoint is a mock API endpoint.

type MockTestServer

type MockTestServer struct {
	NonTLS *MockTestServerInstance
	TLS    *MockTestServerInstance
}

MockTestServer is a mock web server. The server supports both HTTPS and HTTP.

func NewMockTestServer

func NewMockTestServer(log *zap.Logger, pathMap map[string][]*MockTestEndpoint, authMap map[string]string, tlsEnabled bool) (*MockTestServer, error)

NewMockTestServer return an instance of MockTestServer running with and without TLS.

func (*MockTestServer) Close

func (srv *MockTestServer) Close()

Close closes running instances of MockTestServerInstance, if any.

type MockTestServerInstance

type MockTestServerInstance struct {
	Instance *httptest.Server
	URL      *url.URL
	Hostname string
	Protocol string
	Port     int
}

MockTestServerInstance is an instance of a mock web server.

Jump to

Keyboard shortcuts

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