routes

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindRoutes

func BindRoutes(api *operations.SendmailserviceproxyAPI, emailServices []sendmailserviceproxy.EmailService, pollMessageAddress string)

BindRoutes Binds the route handlers to the API

func HealthcheckGet

HealthcheckGet; This method simply returns a 200 code and is for the purpose of automated monitoring It could be useful to include circuit breaker state in the response although currently is does not

Types

type EmailHandler

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

Encapsulates n email services and wraps them in circuit breakers

func NewEmailHandler

func NewEmailHandler(emailServices []sendmailserviceproxy.EmailService, pollMessageAddress string) *EmailHandler

NewEmailHandler; ctor for EmailHandler

func (EmailHandler) EmailPost

func (emailHandler EmailHandler) EmailPost(params email.PostEmailParams, data interface{}) middleware.Responder

This method processes the API request to send a message.

func (*EmailHandler) Send

func (emailHandler *EmailHandler) Send(message sendmailserviceproxy.EmailMessage) error

Send message; This method will attempt to send an email by iterating over it's circuits. The result from the first closed circuit will be returned to the caller. It is not possible to determine if a failed or timed out call may have resulted in the downstream system sending the message therefore the decision to retry or not is deferred to the upstream system.

Jump to

Keyboard shortcuts

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