mqc

package
v0.13.5 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetMetric

func SetMetric(set ISetMetric, cnf conf.IServerConf) (enable bool, err error)

SetMetric 设置metric

func SetQueues

func SetQueues(engine servers.IRegistryEngine, set IQueues, cnf conf.IServerConf, ext map[string]interface{}) (enable bool, err error)

SetQueues 设置queue

Types

type IQueues

type IQueues interface {
	SetQueues(string, string, []*conf.Queue) error
}

IQueues 设置queue

type ISetMetric

type ISetMetric interface {
	SetMetric(*conf.Metric) error
}

type MqcResponsiveServer

type MqcResponsiveServer struct {
	*logger.Logger
	// contains filtered or unexported fields
}

MqcResponsiveServer rpc 响应式服务器

func NewMqcResponsiveServer

func NewMqcResponsiveServer(registryAddr string, cnf conf.IServerConf, logger *logger.Logger) (h *MqcResponsiveServer, err error)

NewMqcResponsiveServer 创建mqc服务器

func (*MqcResponsiveServer) GetAddress

func (w *MqcResponsiveServer) GetAddress() string

GetAddress 获取服务器地址

func (*MqcResponsiveServer) GetServices

func (w *MqcResponsiveServer) GetServices() map[string][]string

GetServices 获取服务列表

func (*MqcResponsiveServer) GetStatus

func (w *MqcResponsiveServer) GetStatus() string

GetStatus 获取当前服务器状态

func (*MqcResponsiveServer) NeedRestart

func (w *MqcResponsiveServer) NeedRestart(cnf conf.IServerConf) (bool, error)

NeedRestart 检查配置判断是否需要重启服务器

func (*MqcResponsiveServer) Notify

func (w *MqcResponsiveServer) Notify(nConf conf.IServerConf) error

Notify 服务器配置变更通知

func (*MqcResponsiveServer) Restart

func (w *MqcResponsiveServer) Restart(cnf conf.IServerConf) (err error)

Restart 重启服务器

func (*MqcResponsiveServer) Restarted

func (w *MqcResponsiveServer) Restarted() bool

Restarted 服务器是否已重启

func (*MqcResponsiveServer) SetConf

func (w *MqcResponsiveServer) SetConf(restart bool, conf conf.IServerConf) (err error)

SetConf 设置配置参数

func (*MqcResponsiveServer) Shutdown

func (w *MqcResponsiveServer) Shutdown()

Shutdown 关闭服务器

func (*MqcResponsiveServer) Start

func (w *MqcResponsiveServer) Start() (err error)

Start 启用服务

type MqcServer

type MqcServer struct {
	*Processor
	// contains filtered or unexported fields
}

MqcServer mqc服务器

func NewMqcServer

func NewMqcServer(name string, proto string, config string, queues []*conf.Queue, opts ...Option) (t *MqcServer, err error)

NewMqcServer 创建mqc服务器

func (*MqcServer) AddRouters

func (s *MqcServer) AddRouters(p *Processor)

func (*MqcServer) Dynamic

func (s *MqcServer) Dynamic(engine servers.IRegistryEngine, c chan *conf.Queue)

Dynamic 动态注册或撤销消息队列

func (*MqcServer) GetAddress

func (s *MqcServer) GetAddress() string

GetAddress 获取当前服务地址

func (*MqcServer) GetStatus

func (s *MqcServer) GetStatus() string

GetStatus 获取当前服务器状态

func (*MqcServer) Pause

func (s *MqcServer) Pause(timeout time.Duration)

Pause 暂停服务器

func (*MqcServer) Run

func (s *MqcServer) Run() error

Run the http server

func (*MqcServer) SetMetric

func (s *MqcServer) SetMetric(metric *conf.Metric) error

SetMetric 重置metric

func (*MqcServer) SetQueues

func (s *MqcServer) SetQueues(proto string, raw string, queues []*conf.Queue) (err error)

SetQueues 设置监听队列

func (*MqcServer) SetTrace

func (s *MqcServer) SetTrace(b bool)

SetTrace 显示跟踪信息

func (*MqcServer) Shutdown

func (s *MqcServer) Shutdown(timeout time.Duration)

Shutdown 关闭服务器

func (*MqcServer) StopMetric

func (s *MqcServer) StopMetric() error

StopMetric stop metric

type Option

type Option func(*option)

Option 配置选项

func WithIP

func WithIP(ip string) Option

WithIP 设置ip地址

func WithLogger

func WithLogger(logger *logger.Logger) Option

WithLogger 设置日志记录组件

func WithMetric

func WithMetric(host string, dataBase string, userName string, password string, cron string) Option

WithMetric 设置基于influxdb的系统监控组件

func WithName

func WithName(platName string, systemName string, clusterName string, serverType string) Option

func WithShowTrace

func WithShowTrace(b bool) Option

WithShowTrace 显示跟踪信息

type Processor

type Processor struct {
	*dispatcher.Dispatcher
	mq.MQConsumer
	// contains filtered or unexported fields
}

func NewProcessor

func NewProcessor(address, raw string, queues []*conf.Queue) (p *Processor, err error)

NewProcessor 创建processor

func (*Processor) Close

func (s *Processor) Close()

func (*Processor) Consume

func (s *Processor) Consume(r *conf.Queue) error

Consume 浪费指定的队列数据

func (*Processor) Consumes

func (s *Processor) Consumes() (err error)

Jump to

Keyboard shortcuts

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