handlers

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backoff added in v0.1.4

type Backoff interface {
	Next(retry int) time.Duration
}

Backoff interface defines contract for backoff strategies

type ConstantBackoff added in v0.1.4

type ConstantBackoff struct {
	Interval time.Duration
}

ConstantBackoff implements constant backoff

func (ConstantBackoff) Next added in v0.1.4

func (b ConstantBackoff) Next(_ int) time.Duration

Next returns next time for retrying operation with constant strategy

type EchoHandler

type EchoHandler struct{}

EchoHandler implements a Handler that simply echoes back the input

func (*EchoHandler) CloseConnection added in v0.1.3

func (lc *EchoHandler) CloseConnection() error

CloseConnection - not implemented

func (*EchoHandler) Handle

func (lc *EchoHandler) Handle(event *types.Event, conf *types.HandlerConfig) (map[string]interface{}, error)

Handle echos back input data before process starts. The config is the normalized config built using data from the child process. This may be different from the one used in Init

func (*EchoHandler) Init

func (lc *EchoHandler) Init(*types.HandlerConfig) error

type GnatsdHandler

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

GnatsdHandler is handler to publish lifecycle events to gnatsd

func (*GnatsdHandler) CloseConnection added in v0.1.3

func (lc *GnatsdHandler) CloseConnection() error

CloseConnection - closes the nats connection ensuring the last event gets published before the app terminates

func (*GnatsdHandler) Handle

func (lc *GnatsdHandler) Handle(event *types.Event, conf *types.HandlerConfig) (map[string]interface{}, error)

Handle publishes to gnatsd. The config is the normalized config built using data from the child process. This may be different from the one used in Init

func (*GnatsdHandler) Init

func (lc *GnatsdHandler) Init(conf *types.HandlerConfig) error

Init initializes the connection to the gnatsd cluster

type HTTPClientHandler

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

HTTPClientHandler implements a HTTP client handler for events

func NewHTTPClientHandler

func NewHTTPClientHandler(resolver *resolver.Resolver, backoff Backoff, maxRetries int) *HTTPClientHandler

NewHTTPClientHandler instantiates a new HTTPClientHandler

func (*HTTPClientHandler) CloseConnection added in v0.1.3

func (handler *HTTPClientHandler) CloseConnection() error

CloseConnection - not implemented

func (*HTTPClientHandler) Handle

func (handler *HTTPClientHandler) Handle(event *types.Event, conf *types.HandlerConfig) (map[string]interface{}, error)

Handle handles an event by making an http call per the config. Event is the raw event and HandlerConfig is the normalized config after interpolations have been applied.

func (*HTTPClientHandler) Init

func (handler *HTTPClientHandler) Init(conf *types.HandlerConfig) error

Init initializes the http handler with the its specific config

type LinearBackoff added in v0.1.4

type LinearBackoff struct {
	Interval time.Duration
}

LinearBackoff implements linear backoff

func (LinearBackoff) Next added in v0.1.4

func (b LinearBackoff) Next(retry int) time.Duration

Next returns next time for retrying operation with linear strategy

type NatsStreamdHandler added in v0.1.5

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

NatsStreamdHandler is handler to publish lifecycle events to NatsStream

func (*NatsStreamdHandler) CloseConnection added in v0.1.5

func (lc *NatsStreamdHandler) CloseConnection() error

CloseConnection closes the nats stream connection

func (*NatsStreamdHandler) Handle added in v0.1.5

func (lc *NatsStreamdHandler) Handle(event *types.Event, conf *types.HandlerConfig) (map[string]interface{}, error)

Handle publishes to NatsStream. The config is the normalized config built using data from the child process. This may be different from the one used in Init

func (*NatsStreamdHandler) Init added in v0.1.5

func (lc *NatsStreamdHandler) Init(conf *types.HandlerConfig) error

Init initializes the connection to the NatsStream cluster

Jump to

Keyboard shortcuts

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