bus

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pub added in v0.4.0

func Pub(e *event.Event) error

Pub bus为全局对象

func SetPublisher

func SetPublisher(p Publisher)

SetPublisher 设置pub

func SetSubscriber

func SetSubscriber(s Subscriber)

SetSubscriber 设置sub

func Sub added in v0.4.0

func Sub(t event.Type, h EventHandler) error

Sub bus为全局对象

Types

type EventHandler added in v0.3.4

type EventHandler func(topic string, e *event.Event) error

EventHandler is used to process messages via a subscription of a topic.

type Manager added in v0.3.4

type Manager interface {
	Connect() error
	Disconnect() error
}

Manager 管理端

type Publisher

type Publisher interface {
	// 发送事件
	Pub(topic string, e *event.Event) error
}

Publisher 发送事件

type Subscriber

type Subscriber interface {
	Sub(topic string, h EventHandler) error
}

Subscriber 订阅事件

Directories

Path Synopsis
broker
kafka
Package kafka https://github.com/Shopify/sarama/blob/master/examples/sasl_scram_client/scram_client.go
Package kafka https://github.com/Shopify/sarama/blob/master/examples/sasl_scram_client/scram_client.go

Jump to

Keyboard shortcuts

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