http_tester

package
v0.0.0-...-056dfb2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(w http.ResponseWriter, r *http.Request, err error, statusCode int)

func NotFound

func NotFound(w http.ResponseWriter, r *http.Request)

func Run

func Run(args []string)

func RunClient

func RunClient(args []string)

func RunServer

func RunServer(args []string)

func SetupHTTPServer

func SetupHTTPServer(handler func(request *Request) *Response)

Types

type Client

type Client struct {
	URL   string
	Resty *resty.Client
}

func NewClient

func NewClient(url string) *Client

func (*Client) PostRequest

func (c *Client) PostRequest(body *Request) (*Response, error)

type Request

type Request struct {
	MessageNumber int
	Message       string
	ClientUUID    string
}

type Response

type Response struct {
	Request         *Request
	ResponseNumber  int
	ResponseMessage string
	ServerUUID      string
}

func (*Response) JSONString

func (resp *Response) JSONString(indent bool) string

Jump to

Keyboard shortcuts

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