channel

package
v0.0.0-...-9835270 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: AGPL-3.0, Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeOut          = 10
	DefaultEnableAutoCommit = true
)

Variables

This section is empty.

Functions

func NewKafkaChannel

func NewKafkaChannel(conf interface{}) (core.IChannel, error)

func NewNatsChannel

func NewNatsChannel(conf interface{}) (core.IChannel, error)

Types

type KafkaChannel

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

func (*KafkaChannel) Close

func (c *KafkaChannel) Close()

func (*KafkaChannel) Commit

func (c *KafkaChannel) Commit(rawMsgs []interface{}) error

func (*KafkaChannel) GetDir

func (c *KafkaChannel) GetDir() int

func (*KafkaChannel) GetID

func (c *KafkaChannel) GetID() string

func (*KafkaChannel) Init

func (c *KafkaChannel) Init(logPorf bool)

func (*KafkaChannel) PreStart

func (c *KafkaChannel) PreStart(broker string, statsInterval int)

func (*KafkaChannel) Send

func (c *KafkaChannel) Send(topic string, partition int32, keys, bytes []byte, headers map[string]string) error

异步发送消息

func (*KafkaChannel) SendAndRecv

func (c *KafkaChannel) SendAndRecv(topic string, partition int32, keys, bytes []byte,
	headers map[string]string) error

同步发送消息

func (*KafkaChannel) SendAndRecvWithRetry

func (c *KafkaChannel) SendAndRecvWithRetry(topic string, partition int32, keys, bytes []byte,
	headers map[string]string) error

同步发送消息失败重试

func (*KafkaChannel) SendRecv

func (c *KafkaChannel) SendRecv(topic string, bytes []byte, timeout int, headers map[string]string) ([]byte, error)

nats methed interface

func (*KafkaChannel) SendWithRetry

func (c *KafkaChannel) SendWithRetry(topic string, partition int32, keys, bytes []byte,
	headers map[string]string) error

异步发送消息失败重试

func (*KafkaChannel) SetChan

func (c *KafkaChannel) SetChan(slot uint32, chanSize int)

func (*KafkaChannel) SetDir

func (c *KafkaChannel) SetDir(dir int)

func (*KafkaChannel) SetGroup

func (c *KafkaChannel) SetGroup(group string)

func (*KafkaChannel) SetHandler

func (c *KafkaChannel) SetHandler(handler core.IChannelConsumer)

func (*KafkaChannel) SetID

func (c *KafkaChannel) SetID(id string)

func (*KafkaChannel) SetTopic

func (c *KafkaChannel) SetTopic(topic string)

func (*KafkaChannel) Start

func (c *KafkaChannel) Start()

func (*KafkaChannel) Stop

func (c *KafkaChannel) Stop()

func (*KafkaChannel) SubscribeTopic

func (c *KafkaChannel) SubscribeTopic(topic string) error

type KafkaConsumerConf

type KafkaConsumerConf interface {
	EnableAutoCommit() *bool
	AutoCommitIntervalMS() *int
	TopicAutoOffsetReset() *string
	GoChannelEnable() *bool
}

type KafkaProducerConf

type KafkaProducerConf interface {
	LingerMsConf() *string
}

type NatsChannel

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

func (*NatsChannel) Close

func (c *NatsChannel) Close()

func (*NatsChannel) Commit

func (c *NatsChannel) Commit(rawMsg []interface{}) error

func (*NatsChannel) GetDir

func (c *NatsChannel) GetDir() int

func (*NatsChannel) GetID

func (c *NatsChannel) GetID() string

func (*NatsChannel) Init

func (c *NatsChannel) Init(logPorf bool)

func (*NatsChannel) PreStart

func (c *NatsChannel) PreStart(broker string, statsInterval int)

func (*NatsChannel) Send

func (c *NatsChannel) Send(topic string, partition int32, keys, bytes []byte, headers map[string]string) error

func (*NatsChannel) SendAndRecv

func (c *NatsChannel) SendAndRecv(topic string, partition int32, keys, bytes []byte, headers map[string]string) error

func (*NatsChannel) SendAndRecvWithRetry

func (c *NatsChannel) SendAndRecvWithRetry(topic string, partition int32, keys, bytes []byte, headers map[string]string) error

func (*NatsChannel) SendRecv

func (c *NatsChannel) SendRecv(topic string, bytes []byte, timeout int, headers map[string]string) ([]byte, error)

func (*NatsChannel) SendWithRetry

func (c *NatsChannel) SendWithRetry(topic string, partition int32, keys, bytes []byte, headers map[string]string) error

func (*NatsChannel) SetConn

func (c *NatsChannel) SetConn(conn *nats.Conn)

func (*NatsChannel) SetDir

func (c *NatsChannel) SetDir(dir int)

func (*NatsChannel) SetGroup

func (c *NatsChannel) SetGroup(group string)

func (*NatsChannel) SetHandler

func (c *NatsChannel) SetHandler(handler core.IChannelConsumer)

func (*NatsChannel) SetID

func (c *NatsChannel) SetID(id string)

func (*NatsChannel) SetTopic

func (c *NatsChannel) SetTopic(topic string)

func (*NatsChannel) Start

func (c *NatsChannel) Start()

func (*NatsChannel) Stop

func (c *NatsChannel) Stop()

Jump to

Keyboard shortcuts

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