dispatch

package
v0.0.0-...-2df7f6a Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSSource

type AWSSource struct {
	Client *http.Client
	URL    string
}

AWSSource is an implemenation of MessageDispatcher

func (AWSSource) GetRoutes

func (source AWSSource) GetRoutes(sourcename string) ([]Route, error)

GetRoutes is a method to retrieve routes for a source

type HTTPDispatcher

type HTTPDispatcher struct {
	Client *http.Client
}

HTTPDispatcher is an implementation of the Dispatcher interface

func (HTTPDispatcher) DispatchMessage

func (dispatcher HTTPDispatcher) DispatchMessage(message *handler.Message, route Route) error

DispatchMessage is a method to dispatch a message to a consumer

type LambdaDispatcher

type LambdaDispatcher struct {
	SourceClient      SourceClient
	MessageDispatcher MessageDispatcher
}

LambdaDispatcher is an implementation of the MessageHandler interface

func (LambdaDispatcher) Dispatch

func (dispatcher LambdaDispatcher) Dispatch(message *handler.Message, source string) error

Dispatch is a method to send a message to a source's routes

type MessageDispatcher

type MessageDispatcher interface {
	DispatchMessage(message *handler.Message, route Route) error
}

MessageDispatcher interface to dispatch message

type Route

type Route struct {
	URL string `json:"url"`
}

Route is a struct representing a Route

type SourceClient

type SourceClient interface {
	GetRoutes(sourcename string) ([]Route, error)
}

SourceClient interface to retrieve routes for a given source

type SourceDTO

type SourceDTO struct {
	Routes []Route `json:"routes"`
}

SourceDTO response

Jump to

Keyboard shortcuts

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