prototype

package
v0.0.0-...-4dfa584 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessagePrototype

type MessagePrototype struct {
	Alias string
	// Headers is a map of headers
	// Optional and used mostly in HTTP requests
	Headers map[string]string

	// Parameters is a map of parameters
	// Optional and used mostly in HTTP requests
	Parameters map[string]string

	// Type is a message type
	Type string

	// BodyTemplate is a template for message body
	// It uses text/template syntax
	BodyTemplate []string

	Mediators mediator.MediatorChain

	From string

	To string

	Matcher []matchers.Matcher
}

MessagePrototype is a template for message with mediators, bodyTemplate and headers

type PrototypeBuilder

type PrototypeBuilder interface {
	Build() []MessagePrototype
}

PrototypeBuilder builds message templates

type RequestPrototypeBuilder

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

RequestPrototypeBuilder is a builder for request prototypes

func NewRequestPrototypeBuilder

func NewRequestPrototypeBuilder(requestConfig []config.Request) *RequestPrototypeBuilder

NewRequestPrototypeBuilder creates a new instance of RequestPrototypeBuilder

func (*RequestPrototypeBuilder) Build

Build creates a list of request prototypes

type ResponsePrototypeBuilder

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

ResponsePrototypeBuilder builds response templates

func NewResponsePrototypeBuilder

func NewResponsePrototypeBuilder(responseConfig []config.Response) *ResponsePrototypeBuilder

NewResponsePrototypeBuilder creates a new ResponseTemplateBuilder

func (*ResponsePrototypeBuilder) Build

Build builds response templates from response configuration

func (*ResponsePrototypeBuilder) BuildFromOAPISpec

func (rtb *ResponsePrototypeBuilder) BuildFromOAPISpec(responseConfig config.Response) ([]MessagePrototype, error)

BuildFromSpec builds the response prototype from OpenAPI spec

func (*ResponsePrototypeBuilder) BuildResponse

func (rtb *ResponsePrototypeBuilder) BuildResponse(responseConfig config.Response) MessagePrototype

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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