mediator

package
v1.0.1-0...-7544f63 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: LGPL-2.1 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Remove

func Remove[T any]()

Types

type IMediator

type IMediator[T Input, K Output] interface {
	MediateMediate(msg T) (res K)
	Close()
}

type Input

type Input interface {
	int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | uintptr | float32 | float64 | string | ~struct{} | interface{}
}

type MediatePayload

type MediatePayload[T Input, K Output] struct {
	Payload  T
	Response K
}

type Mediator

type Mediator[T Input, K Output] struct {
	// contains filtered or unexported fields
}

func (*Mediator[T, K]) AddOrUpdateCallback

func (mtr *Mediator[T, K]) AddOrUpdateCallback(del func(*MediatePayload[T, K]))

func (*Mediator[T, K]) Close

func (mtr *Mediator[T, K]) Close()

func (*Mediator[T, K]) Mediate

func (mtr *Mediator[T, K]) Mediate(msg T) (res K)

type Observable

type Observable[T Input, K Output] struct {
	// contains filtered or unexported fields
}

func CreateOrGet

func CreateOrGet[T any, K any]() *Observable[T, K]

func (*Observable[T, K]) Emit

func (b *Observable[T, K]) Emit(e string, request T)

func (*Observable[T, K]) EmitResponse

func (b *Observable[T, K]) EmitResponse(e string, request K)

func (*Observable[T, K]) EmitWithResponse

func (b *Observable[T, K]) EmitWithResponse(e string, requestWrp eventMessage[T, K]) eventMessage[T, K]

func (*Observable[T, K]) NewMediator

func (obs *Observable[T, K]) NewMediator(actionName string) Mediator[T, K]

func (*Observable[T, K]) RemoveRSitter

func (b *Observable[T, K]) RemoveRSitter(correlationId, e string, ch *chan eventMessage[T, K])

func (*Observable[T, K]) Subscribe

func (obs *Observable[T, K]) Subscribe(action string) *chan eventMessage[T, K]

type Output

type Output interface {
	int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | uintptr | float32 | float64 | string | ~struct{} | interface{}
}

Jump to

Keyboard shortcuts

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