zpub

package
v0.0.0-...-e38cb6b Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClient

func GetClient() client.Client

func InitDefault

func InitDefault(conf *config.Broker)

InitDefault 初始化

func Publish

func Publish(ctx context.Context, header *brokerpb.Header, msg interface{}) error

Publish 发布消息

header 消息topic等相关信息

msg 消息体(struct)

func ReloadDefault

func ReloadDefault(conf *config.Broker) (err error)

ReloadDefault 重载

Types

type Manager

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

func NewManager

func NewManager(mc *ManagerConfig) (m *Manager, err error)

func (*Manager) Publish

func (m *Manager) Publish(ctx context.Context, targetInstance string, header *broker.Header, msg interface{}) (err error)

Publish 发布消息

targetInstance 目标数据源

header 消息topic等相关信息

msg 消息体(struct)

func (*Manager) Release

func (m *Manager) Release() (err error)

Release 释放broker连接资源

type ManagerConfig

type ManagerConfig struct {
	Conf        map[string]*PubConfig
	JSONCodecFn func(io.ReadWriteCloser) codec.Codec
}

type PubConfig

type PubConfig struct {
	BrokerConf *config.Broker
}

Jump to

Keyboard shortcuts

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