testutils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertHttpToWS

func ConvertHttpToWS(u string) (string, error)

func ConvertJsonFileToJsonString

func ConvertJsonFileToJsonString(fn string) string

func IsValidUUID

func IsValidUUID(uuid string) bool

func MockResponse

func MockResponse(resString string, statusCode int, m *MockClient) func(req *http.Request) (*http.Response, error)

Types

type MockClient

type MockClient struct {
	DoFunc func(req *http.Request) (*http.Response, error)
	Spy    *http.Request
}

func (*MockClient) Do

func (m *MockClient) Do(req *http.Request) (*http.Response, error)

type MockWebSocketServer

type MockWebSocketServer struct {
	Msgs []anyjson.AnyJson
}

func (*MockWebSocketServer) TestWebSocketServer

func (ms *MockWebSocketServer) TestWebSocketServer(writeFunc connFn) *httptest.Server

Jump to

Keyboard shortcuts

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