listeners

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultOutboundChannels

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

func (*DefaultOutboundChannels) Get

func (channels *DefaultOutboundChannels) Get(name string) (channel OutboundChannel, has bool)

func (*DefaultOutboundChannels) Set

func (channels *DefaultOutboundChannels) Set(name string, channel OutboundChannel)

type Listener

type Listener interface {
	Name() (name string)
	OutboundChannels() (channels OutboundChannels)
	Listen(ctx context.Context, options ListenerOptions) (err error)
	Close() (err error)
}

type ListenerOptions

type ListenerOptions struct {
	Log    logs.Logger
	Config configures.Config
}

type Message

type Message interface {
	Header() (header MessageHeader)
	SetBody(body []byte)
	Body() (body []byte)
}

func NewMessage

func NewMessage() Message

type MessageHeader

type MessageHeader interface {
	Get(key string) (value interface{})
	Set(key string, value interface{})
}

type OutboundChannel

type OutboundChannel interface {
	Name() (name string)
	Send(ctx context.Context, msg Message) (err errors.CodeError)
}

type OutboundChannels

type OutboundChannels interface {
	Get(name string) (channel OutboundChannel, has bool)
	Set(name string, channel OutboundChannel)
}

func NewDefaultOutboundChannels

func NewDefaultOutboundChannels() OutboundChannels

Jump to

Keyboard shortcuts

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