engine

package
v0.0.0-...-00d9010 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DolusExpectationEngine

type DolusExpectationEngine struct {
	ResponseSchemas  map[schema.Route]dstruct.DynamicStructModifier
	RequestSchemas   map[schema.Route]dstruct.DynamicStructModifier
	GenerationConfig generator.GenerationConfig
	// contains filtered or unexported fields
}

func NewDolusExpectationEngine

func NewDolusExpectationEngine(
	generationConfig generator.GenerationConfig,
) (dolusExpectationEngine *DolusExpectationEngine)

func (*DolusExpectationEngine) AddExpectation

func (e *DolusExpectationEngine) AddExpectation(
	expect expectation.Expectation,
	validateExpectationSchema bool,
	expectationType expectation.ExpectationType,
) error

func (*DolusExpectationEngine) AddResponseSchemaForRoute

func (e *DolusExpectationEngine) AddResponseSchemaForRoute(
	route schema.Route,
	responseSchema dstruct.DynamicStructModifier,
) error

func (*DolusExpectationEngine) GetAllExpectations

func (e *DolusExpectationEngine) GetAllExpectations() map[schema.Route][]expectation.Expectation

func (*DolusExpectationEngine) GetCueExpectations

func (e *DolusExpectationEngine) GetCueExpectations() expectation.Expectations

GetCueExpectations returns the cue expectations

func (*DolusExpectationEngine) GetExpectation

func (e *DolusExpectationEngine) GetExpectation(
	route schema.Route,
) []expectation.Expectation

func (*DolusExpectationEngine) GetExpectationRoutes

func (e *DolusExpectationEngine) GetExpectationRoutes() []schema.Route

func (*DolusExpectationEngine) GetResponseForRequest

func (e *DolusExpectationEngine) GetResponseForRequest(
	request *http.Request,
	requestParameters schema.RequestParameters,
	pathTemplate string,
) (*expectation.Response, error)

GetResponseForRequest returns the response for the given request

func (*DolusExpectationEngine) SetRouteProperties

func (e *DolusExpectationEngine) SetRouteProperties(routeProperties schema.RouteProperties)

type ExpectationEngine

type ExpectationEngine interface {
	AddExpectation(expectation expectation.Expectation,
		validateExpectationSchema bool,
		expectationType expectation.ExpectationType) error
	AddResponseSchemaForRoute(
		route schema.Route,
		responseSchema dstruct.DynamicStructModifier,
	) error
	GetAllExpectations() map[schema.Route][]expectation.Expectation
	GetExpectation(route schema.Route) []expectation.Expectation
	GetResponseForRequest(
		request *http.Request,
		reqParam schema.RequestParameters,
		path string,
	) (*expectation.Response, error)
	GetCueExpectations() expectation.Expectations
	GetExpectationRoutes() []schema.Route
	SetRouteProperties(routeProperties schema.RouteProperties)
}

Jump to

Keyboard shortcuts

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