stub

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	Equals   map[string]interface{} `json:"equals"`
	Contains map[string]interface{} `json:"contains"`
	Matches  map[string]interface{} `json:"matches"`
	Any      map[string]interface{} `json:"any"`
}

type Manager

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

func NewManager

func NewManager() *Manager

func (*Manager) AddStub

func (m *Manager) AddStub(stub *Stub) error

func (*Manager) DeleteStub

func (m *Manager) DeleteStub(service, method string) error

func (*Manager) FindStubs

func (m *Manager) FindStubs(service, method string, in map[string]interface{}) []*Stub

func (*Manager) LoadStubsFromFile

func (m *Manager) LoadStubsFromFile(dir string) error

type Output

type Output struct {
	Data    map[string]interface{} `json:"data"`
	Code    int32                  `json:"code"`
	Message string                 `json:"message"`
}

type Stub

type Stub struct {
	Service string  `json:"service"`
	Method  string  `json:"method"`
	In      *Input  `json:"in"`
	Out     *Output `json:"out"`
}

func (*Stub) Match

func (s *Stub) Match(in map[string]interface{}) bool

func (*Stub) Validate

func (s *Stub) Validate() error

Jump to

Keyboard shortcuts

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