data

package
v0.0.0-...-278c780 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: Unlicense Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	Method string
	Path   string

	sync.RWMutex
	// contains filtered or unexported fields
}

Endpoint represents the mocked route and can have one or more responses.

func GetEndpointsFromFile

func GetEndpointsFromFile(fn string) ([]*Endpoint, error)

GetEndpointsFromFile parses the *.http file(s).

func GetEndpointsFromReader

func GetEndpointsFromReader(r io.Reader) (routes []*Endpoint, err error)

GetEndpointsFromReader parses a reader from <stdin> or similar

func (*Endpoint) Handle

func (e *Endpoint) Handle() http.HandlerFunc

Handle returns a HTTP handler method for the given endpoint.

func (*Endpoint) String

func (e *Endpoint) String() string

Jump to

Keyboard shortcuts

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