bridge

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 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 Bridge

type Bridge struct {
	Filter    []Filter
	Endpoints []string
}

func NewBridge

func NewBridge(filter []Filter, endpoints []string) Bridge

func (Bridge) Match

func (b Bridge) Match(env *envelope.Envelope) (int, bool)

type BridgeService

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

func NewBridgeService

func NewBridgeService(pub *event.Pub, envelopeService envelope.Service, endpointService endpoint.Service) *BridgeService

func (*BridgeService) CreateBridge

func (bs *BridgeService) CreateBridge(req *CreateBridgeRequest) error

func (*BridgeService) ListBridge

func (bs *BridgeService) ListBridge() []Bridge

func (*BridgeService) Run

func (bs *BridgeService) Run(ctx context.Context, doneC chan<- struct{})

type CreateBridgeRequest

type CreateBridgeRequest struct {
	Filters   []CreateFilterRequest
	Endpoints []string
}

type CreateFilterRequest

type CreateFilterRequest struct {
	From          string
	FromRegex     string
	To            string
	ToRegex       string
	MatchTemplate string
}

type Filter

type Filter struct {
	To   string
	From string
	// contains filtered or unexported fields
}

func NewFilter

func NewFilter(from, to, fromRegex, toRegex, templateStr string) (Filter, error)

func (*Filter) Match

func (f *Filter) Match(env *envelope.Envelope) bool

type Service

type Service interface {
	CreateBridge(req *CreateBridgeRequest) error
	ListBridge() []Bridge
}

Jump to

Keyboard shortcuts

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