httpstub

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPStub

type HTTPStub struct {
	Path     string   `json:"path"`
	Method   string   `json:"method"`
	Response Response `json:"response"`
}

type Response

type Response struct {
	Header http.Header    `json:"header"`
	Body   map[string]any `json:"body"`
	Status int            `json:"status"`
}

type StubHandler

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

func NewHandler

func NewHandler(stubDir string) (*StubHandler, error)

func (*StubHandler) ServeHTTP

func (s *StubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Writer

type Writer struct{}

func (*Writer) Write

func (w *Writer) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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