mq

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AppName       string              `json:"app_name"`
	Host          string              `json:"host"`
	Port          string              `json:"port"`
	Debug         bool                `json:"debug"`
	DashboardHost string              `json:"dashboard_host"`
	DashboardPort string              `json:"dashboard_port"`
	MaxOpenConn   int                 `json:"max_open_conn"` // 允许的最大连接数, 即 生产者+消费者最多有 MaxOpenConn 个
	BufferSize    int                 `json:"buffer_size"`   // 生产者消息历史记录最大数量
	Crypto        proto.Crypto        `json:"-"`             // 加密器
	Token         string              `json:"-"`             // 注册认证密钥
	EventHandler  engine.EventHandler // 事件触发器
}

func DefaultConf

func DefaultConf() Config

type MQ

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

func New

func New(cs ...Config) *MQ

func (*MQ) Ctx added in v0.3.1

func (m *MQ) Ctx() context.Context

func (*MQ) Logger added in v0.3.1

func (m *MQ) Logger() logger.Iface

func (*MQ) Serve added in v0.3.1

func (m *MQ) Serve()

Serve 阻塞启动

func (*MQ) SetLogger added in v0.3.1

func (m *MQ) SetLogger(logger logger.Iface) *MQ

func (*MQ) Stop

func (m *MQ) Stop()

Jump to

Keyboard shortcuts

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