catcher

package
v0.3.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const IndexHTML = `` /* 1037-byte string literal not displayed */

Variables

View Source
var ServicePort int = 12346

Functions

func EchoServer

func EchoServer(ws *websocket.Conn)

Echo the data received on the WebSocket.

Types

type Service

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

Service is an instance of the catcher service. This service is used to test the relay. It exposes an HTTP server that captures the last request it receives and makes it available via the LastRequest() and LastRequestBody() methods. For websocket testing, the /echo endpoint exposes a simple websocket server that echoes back whatever it receives.

func NewService

func NewService() *Service

func (*Service) Close

func (service *Service) Close() error

func (*Service) HttpUrl

func (service *Service) HttpUrl() string

func (*Service) LastRequest

func (service *Service) LastRequest() (*http.Request, error)

func (*Service) LastRequestBody

func (service *Service) LastRequestBody() ([]byte, error)

func (*Service) Port

func (service *Service) Port() int

func (*Service) Start

func (service *Service) Start(host string, port int) error

Directories

Path Synopsis
Catcher is a simple web server used for testing the relay service.
Catcher is a simple web server used for testing the relay service.

Jump to

Keyboard shortcuts

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