dispatcher

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InTransit = DispatchState("in-transit")
	Retrying  = DispatchState("retrying")
	Error     = DispatchState("error")
	Success   = DispatchState("success")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DispatchEvent

type DispatchEvent struct {
	State        DispatchState
	ReceiverId   string
	ReceiverDesc string
	Retries      int
	Error        error
	Response     *clients.Response
}

DispatchEvent provides a struct for storing dispatching events.

type DispatchState

type DispatchState string

DispatchState provides a dispatch state

type Dispatcher

type Dispatcher interface {
	Dispatch(ctx context.Context) error
	Events() chan DispatchEvent
	Done() chan struct{}
	SetMockClient(impl clients.ClientImpl)
}

Dispatcher provides an interface for implementing dispatching protocol.

func NewNotificationDispatcher

func NewNotificationDispatcher(
	logger *log.Logger,
	specs map[string]*receivers.Spec,
	config *notifcfg.Config,
	params, envVars map[string]string,
) Dispatcher

NewNotificationDispatcher returns an implementation of *Dispatcher* service.

Jump to

Keyboard shortcuts

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