Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultFlowPeriodSecond = 30 DefaultFlowPermit = 10 PulsarAddrCN = "pulsar://mqe.tuyacn.com:7285" PulsarAddrEU = "pulsar://mqe.tuyaeu.com:7285" PulsarAddrUS = "pulsar://mqe.tuyaus.com:7285" )
Variables ¶
This section is empty.
Functions ¶
func NewAuthProvider ¶
func NewAuthProvider(accessID, accessKey string) *authProvider
func SetInternalLogLevel ¶
func TopicForAccessID ¶
Types ¶
type AuthProvider ¶
type Client ¶
type Client interface {
NewConsumer(config ConsumerConfig) (Consumer, error)
}
func NewClient ¶
func NewClient(cfg ClientConfig) Client
type ClientConfig ¶
type ClientConfig struct {
PulsarAddr string
}
type Consumer ¶
type Consumer interface { ReceiveAndHandle(ctx context.Context, handler PayloadHandler) Stop() }
type ConsumerConfig ¶
type ConsumerConfig struct { Topic string Auth AuthProvider }
type ConsumerList ¶
type ConsumerList struct { FlowPeriodSecond int FlowPermit uint32 Topic string Stopped chan struct{} // contains filtered or unexported fields }
func (*ConsumerList) CronFlow ¶
func (l *ConsumerList) CronFlow()
func (*ConsumerList) ReceiveAndHandle ¶
func (l *ConsumerList) ReceiveAndHandle(ctx context.Context, handler PayloadHandler)
func (*ConsumerList) Stop ¶
func (l *ConsumerList) Stop()
Click to show internal directories.
Click to hide internal directories.