router

package
v0.0.0-...-9da5f0f Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCachedPacketCount

func GetCachedPacketCount() int

func GetChannelCacheLimit

func GetChannelCacheLimit() int

func GetChannelCount

func GetChannelCount() int

func GetConsumerChannelCount

func GetConsumerChannelCount() int

func GetIOCount

func GetIOCount() (int, int)

func GetProducerChannelCount

func GetProducerChannelCount() int

func Init

func Init(cfg RouterConfig)

func Start

func Start(cvts []Converter)

Types

type Channel

type Channel struct {
	UUID   string
	Buffer Buffer
}

type ConsumerChannel

type ConsumerChannel struct {
	Channel
	Accept   []RoutingRule
	HelpInfo *helpinfo.HelpInfo
}

func RegisterConsumerChannel

func RegisterConsumerChannel(uuid string, accept []RoutingRule) *ConsumerChannel

func (*ConsumerChannel) Close

func (cc *ConsumerChannel) Close()

func (*ConsumerChannel) Consume

func (cc *ConsumerChannel) Consume() Packet

type ProducerChannel

type ProducerChannel struct {
	Channel
	AcknowledgeBuffer Buffer
}

func RegisterProducerChannel

func RegisterProducerChannel(uuid string, acceptAck bool) *ProducerChannel

func (*ProducerChannel) Close

func (pc *ProducerChannel) Close()

func (*ProducerChannel) Produce

func (pc *ProducerChannel) Produce(packet Packet)

type RouterConfig

type RouterConfig struct {
	BufferSize uint
}

type RoutingRule

type RoutingRule struct {
	From       string         `json:"from"`
	FromRegexp *regexp.Regexp `json:"-"`
	To         string         `json:"to"`
	ToRegexp   *regexp.Regexp `json:"-"`
	Formats    []Format       `json:"formats"`
}

Jump to

Keyboard shortcuts

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