test

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPServer

type HTTPServer struct {
	// URL has the `host:port` format.
	URL string
	// contains filtered or unexported fields
}

HTTPServer describes a mock http/https server.

func NewHTTPSServerV3

func NewHTTPSServerV3() *HTTPServer

NewHTTPSServerV3 returns an instance of a mock https server for v3 API.

func NewHTTPServerV3

func NewHTTPServerV3() *HTTPServer

NewHTTPServerV3 returns an instance of a mock http server for v3 API.

func (*HTTPServer) Close

func (s *HTTPServer) Close()

Close closes the unversioned server connection.

func (*HTTPServer) GetCertificates

func (s *HTTPServer) GetCertificates() *x509.Certificate

GetCertificates returns the certificate used by the server.

func (*HTTPServer) ServeUnversioned

func (s *HTTPServer) ServeUnversioned(t *testing.T, uri string, statusCode int, response interface{})

ServeUnversioned serves an unversioned endpoint.

func (*HTTPServer) ServeVersioned

func (s *HTTPServer) ServeVersioned(t *testing.T, uri string, statusCode int, response interface{})

ServeVersioned serves a versioned endpoint.

func (*HTTPServer) SetTLS

func (s *HTTPServer) SetTLS(cfg *tls.Config)

SetTLS starts TLS using the configured options.

type WebSocketServer

type WebSocketServer struct {
	// URL has the `host:port` format.
	URL string
	// contains filtered or unexported fields
}

WebSocketServer describes a mock websocket server.

func NewWebSocketServerV3

func NewWebSocketServerV3() *WebSocketServer

NewWebSocketServerV3 returns an instance of a mock websocket server for v3 API.

func NewWebSocketTLSServerV3

func NewWebSocketTLSServerV3() *WebSocketServer

NewWebSocketTLSServerV3 returns an instance of a mock websocket tls server for v3 API.

func (*WebSocketServer) Close

func (s *WebSocketServer) Close()

Close closes the connection.

func (*WebSocketServer) GetCertificates

func (s *WebSocketServer) GetCertificates() *x509.Certificate

GetCertificates returns the certificate used by the server.

func (*WebSocketServer) Serve

func (s *WebSocketServer) Serve(resp string)

Serve reads a request event and writes back a given response.

func (*WebSocketServer) SetTLS

func (s *WebSocketServer) SetTLS(cfg *tls.Config)

SetTLS starts TLS using the configured options.

func (*WebSocketServer) Stream

func (s *WebSocketServer) Stream(responses []string)

Stream issues a requests and writes back a stream of response data.

Jump to

Keyboard shortcuts

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