server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: MIT Imports: 16 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 {
	Port       string
	SSLEnabled bool
	// contains filtered or unexported fields
}

HTTPServer represents a http server struct

func NewHTTPServer

func NewHTTPServer(
	port string, ssl bool, certDirectory, workingDirectory string, mocker internal.Mocker, logger logsutil.Logger) *HTTPServer

NewHTTPServer creates and initializes a {HTTPServer} struct

func (HTTPServer) Listen

func (s HTTPServer) Listen() error

Listen creates the http server and dispatches the incoming requests

type MockedRequestLightWithLinks struct {
	internal.MockedRequestLight
	Links map[string]string `json:"_links,omitempty"`
}

type Response

type Response struct {
	ResponseWriter http.ResponseWriter
	DelayMax       time.Duration
}

Response represents a {http.ResponseWriter} from the HTTP request

func NewResponse

func NewResponse(responseWriter http.ResponseWriter, delayMax string) Response

NewResponse creates and initializes a {Response} struct

func (Response) Write

func (r Response) Write(mock internal.MockedRequest, delay string)

Write writes the http response using the provided {mock} value and delays the response {delay} parameter is setted

Jump to

Keyboard shortcuts

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