mocker

package
v0.0.0-...-9fa2827 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2018 License: MIT Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorUnsupportedMIMEType1    = errutil.NewFactory("unsupported MIME type: %q")
	ErrorHeaderRequired1         = errutil.NewFactory("header %q required")
	ErrorQueryParameterRequired1 = errutil.NewFactory("query parameter %q required")
	ErrorBindFailed              = errutil.NewFactory("bind request body failed")
	ErrorResourceNotFound1       = errutil.NewFactory("resource %q not found in RAML file")
	ErrorWSDialFailed            = errutil.NewFactory("websocket dial failed")
	ErrorWSUpgrdaeFailed         = errutil.NewFactory("websocket upgrade failed")
	ErrorWSIOFailed              = errutil.NewFactory("websocket IO failed")
)

errors

View Source
var (
	ErrorUnsupportedOutputType1 = errutil.NewFactory("unsupported output type %T")
	ErrorUnexpectedOutputType2  = errutil.NewFactory("output type mismatch, expected %q but got %q")
)

errors

Functions

func BuildResourcesMap

func BuildResourcesMap(resources []string) map[string]bool

BuildResourcesMap return resource map by resources string slice

func Start

func Start(conf Config) (err error)

Start mock server

Types

type Config

type Config struct {
	RAMLFile                       string
	CheckRAMLVersion               bool
	CacheDir                       string
	Port                           int64
	Proxy                          string
	Resources                      map[string]bool
	AllowRequiredPropertyToBeEmpty bool
}

Config for mock server

Jump to

Keyboard shortcuts

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