http_mocking

package
v0.12.5 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "http-mocking"
)

Variables

This section is empty.

Functions

func Create

func Create(id, name string, conf *Config, workers map[eosc.RequireId]eosc.IWorker) (eosc.IWorker, error)

func NewComplete

func NewComplete(responseStatus int, contentType string, responseExample string, responseSchema map[string]interface{}, responseHeader map[string]string) *complete

func NewFactory

func NewFactory() eosc.IExtenderDriverFactory

func Register

func Register(register eosc.IExtenderDriverRegister)

Types

type Config

type Config struct {
	ResponseStatus  int               `json:"response_status" default:"200" label:"响应状态码" description:"仅http路由有效"`
	ContentType     string            `json:"content_type" label:"响应 Content-Type" enum:"application/json"`
	ResponseExample string            `json:"response_example"  format:"text" label:"响应Body" description:"与Json Schema字段二选一"`
	ResponseSchema  string            `` /* 138-byte string literal not displayed */
	ResponseHeader  map[string]string `json:"response_header" label:"响应头"`
}

type Mocking

type Mocking struct {
	drivers.WorkerBase
	// contains filtered or unexported fields
}

func (*Mocking) CheckSkill

func (m *Mocking) CheckSkill(skill string) bool

func (*Mocking) Destroy

func (m *Mocking) Destroy()

func (*Mocking) DoFilter

func (m *Mocking) DoFilter(ctx eocontext.EoContext, next eocontext.IChain) (err error)

func (*Mocking) DoHttpFilter

func (m *Mocking) DoHttpFilter(ctx http_context.IHttpContext, next eocontext.IChain) (err error)

func (*Mocking) Reset

func (m *Mocking) Reset(v interface{}, workers map[eosc.RequireId]eosc.IWorker) error

func (*Mocking) Start

func (m *Mocking) Start() error

func (*Mocking) Stop

func (m *Mocking) Stop() error

Jump to

Keyboard shortcuts

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