mediator

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DelayingMediator

type DelayingMediator struct {
	Delay time.Duration
}

func NewDelayingMediator

func NewDelayingMediator(delay string) *DelayingMediator

func (*DelayingMediator) Mediate

func (dm *DelayingMediator) Mediate(message model.RequestMessage, responses <-chan model.ResponseMessage) <-chan model.ResponseMessage

type GeneratingMediator

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

func NewGeneratingMediator

func NewGeneratingMediator(quantity int, bodyTempalte []string) *GeneratingMediator

func (*GeneratingMediator) Mediate

func (gm *GeneratingMediator) Mediate(message model.RequestMessage, responses <-chan model.ResponseMessage) <-chan model.ResponseMessage

type MatchingMediator

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

func NewMatchingMediator

func NewMatchingMediator(pattern matchers.Pattern, matchers []matchers.Matcher) *MatchingMediator

func (*MatchingMediator) Mediate

func (mm *MatchingMediator) Mediate(message model.RequestMessage, responses <-chan model.ResponseMessage) <-chan model.ResponseMessage

type Mediator

type Mediator interface {
	// Mediate is a function that should be done with message
	Mediate(message model.RequestMessage, _ <-chan model.ResponseMessage) <-chan model.ResponseMessage
}

Mediator is an interface that should be implemented by all mediators

func NewOAPIGeneratingMediator

func NewOAPIGeneratingMediator(quantity int, sch *base.Schema) Mediator

type MediatorChain

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

func (*MediatorChain) Append

func (mc *MediatorChain) Append(mediator Mediator)

func (*MediatorChain) Prepend

func (mc *MediatorChain) Prepend(mediator Mediator)

func (*MediatorChain) Run

type RandomDelayingMediator

type RandomDelayingMediator struct {
	MinDelay time.Duration
	MaxDelay time.Duration
}

func NewRandomDelayingMediator

func NewRandomDelayingMediator(minDelay, maxDelay string) *RandomDelayingMediator

func (*RandomDelayingMediator) Mediate

func (rdm *RandomDelayingMediator) Mediate(message model.RequestMessage, responses <-chan model.ResponseMessage) <-chan model.ResponseMessage

Jump to

Keyboard shortcuts

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