stub

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(fileOrDir string) (http.HandlerFunc, error)

Types

type Request

type Request struct {
	Methods []string          `json:"methods" toml:"methods" yaml:"methods"`
	Path    string            `json:"path" toml:"path" yaml:"path"`
	Headers map[string]string `json:"headers" toml:"headers" yaml:"headers"`
	Query   map[string]string `json:"query" toml:"query" yaml:"query"`
	Body    string            `json:"body" toml:"body" yaml:"body"`
}

type Response

type Response struct {
	Code    int               `json:"code" toml:"code" yaml:"code"`
	Headers map[string]string `json:"headers" toml:"headers" yaml:"headers"`
	Body    string            `json:"body" toml:"body" yaml:"body"`
}

type Stub

type Stub struct {
	Request  Request  `json:"request" toml:"request" yaml:"request"`
	Response Response `json:"response" toml:"response" yaml:"response"`
}

type Stubs

type Stubs map[string]Stub

func Parse

func Parse(fileOrDir string) (Stubs, error)

type UnmarshalFunc

type UnmarshalFunc func([]byte, interface{}) error

Jump to

Keyboard shortcuts

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