interflow

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetReceiveInterflowCh

func GetReceiveInterflowCh() <-chan *HookMsg

GetReceiveInterflowCh 获取接收消息的通道

func GetSendInterflowCh

func GetSendInterflowCh() chan<- *HookMsg

GetSendInterflowCh 获取发送消息的通道

Types

type Callback

type Callback func(topic consts.TopicType, key, value []byte) error

type HookMsg

type HookMsg struct {
	Topic string `json:"topic"`
	Value []byte `json:"value"`
	Key   []byte `json:"key"`
}

func (*HookMsg) Bytes

func (l *HookMsg) Bytes() []byte

Bytes send message to interflow

type Interflow

type Interflow interface {
	// Send 把数据投递给谁
	Send(ctx context.Context, to string, msg *HookMsg) error
	// Receive 接收投递过来的数据
	Receive() error
	// SetHandles 设置回调函数
	SetHandles(handles map[consts.TopicType]Callback) error
	// Close 关闭
	Close() error
}

func NewHookInterflow

func NewHookInterflow(log *log.Helper) Interflow

func NewKafkaInterflow

func NewKafkaInterflow(kafkaMQServer *servers.KafkaMQServer, log *log.Helper) (Interflow, error)

Jump to

Keyboard shortcuts

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