nsqadmin
nsqadmin 结构体定义
type Options struct {
LogLevel string `flag:"log-level"`
LogPrefix string `flag:"log-prefix"`
Verbose bool `flag:"verbose"` // for backwards compatibility
Logger Logger
logLevel lg.LogLevel // private, not really an option
HTTPAddress string `flag:"http-address"`
GraphiteURL string `flag:"graphite-url"`
ProxyGraphite bool `flag:"proxy-graphite"`
StatsdPrefix string `flag:"statsd-prefix"`
StatsdCounterFormat string `flag:"statsd-counter-format"`
StatsdGaugeFormat string `flag:"statsd-gauge-format"`
StatsdInterval time.Duration `flag:"statsd-interval"`
NSQLookupdHTTPAddresses []string `flag:"lookupd-http-address" cfg:"nsqlookupd_http_addresses"`
NSQDHTTPAddresses []string `flag:"nsqd-http-address" cfg:"nsqd_http_addresses"`
HTTPClientConnectTimeout time.Duration `flag:"http-client-connect-timeout"`
HTTPClientRequestTimeout time.Duration `flag:"http-client-request-timeout"`
HTTPClientTLSInsecureSkipVerify bool `flag:"http-client-tls-insecure-skip-verify"`
HTTPClientTLSRootCAFile string `flag:"http-client-tls-root-ca-file"`
HTTPClientTLSCert string `flag:"http-client-tls-cert"`
HTTPClientTLSKey string `flag:"http-client-tls-key"`
AllowConfigFromCIDR string `flag:"allow-config-from-cidr"`
NotificationHTTPEndpoint string `flag:"notification-http-endpoint"`
AclHttpHeader string `flag:"acl-http-header"`
AdminUsers []string `flag:"admin-user" cfg:"admin_users"`
}
Options 只有一个 New 方法, 就是创建一个 NSQAdmin 对象:
func New(opts *Options) *NSQAdmin {}
type NSQAdmin struct {
sync.RWMutex
opts atomic.Value // interface 类型,实际保存的是 *Options
httpListener net.Listener
waitGroup util.WaitGroupWrapper
notifications chan *AdminAction
graphiteURL *url.URL
httpClientTLSConfig *tls.Config
}
再看看 NSQAdmin 提供了哪些方法:
// 读取 ops 的值,这里用的 atomic 来保证同步操作
func (n *NSQAdmin) getOpts() *Options {}
// 存储 ops 的值
func (n *NSQAdmin) swapOpts(opts *Options) {}
// 返回服务器地址,即: net.Listener.Addr()
func (n *NSQAdmin) RealHTTPAddr() *net.TCPAddr {}
// 从 channel 中读取消息,转换成 json, 然后发送到 nsq 节点
func (n *NSQAdmin) handleAdminActions() {}
// 退出清理操作
// 关闭 http 监听, 关闭 channel
func (n *NSQAdmin) Exit() {}
// 监听端口
func (n *NSQAdmin) Main() {}
nsqadmin的更多相关文章
- go语言nsq源码解读二 nsqlookupd、nsqd与nsqadmin
nsqlookupd: 官方文档解释见:http://bitly.github.io/nsq/components/nsqlookupd.html 用官方话来讲是:nsqlookupd管理拓扑信息,客 ...
- Nginx reverse proxy NSQAdmin
以下配置只针对nsqadmin v1.1.0 (built w/go1.10.3)版本 ## The default server# server { listen 80 defau ...
- (转)go语言nsq源码解读二 nsqlookupd、nsqd与nsqadmin
转自:http://www.baiyuxiong.com/?p=886 ---------------------------------------------------------------- ...
- 深入NSQ 之旅[转载]
介绍 NSQ是一个实时的分布式消息平台.它的设计目标是为在多台计算机上运行的松散服务提供一个现代化的基础设施骨架.这篇文章介绍了 基于go语言的NSQ的内部架构,它能够为高吞吐量的网络服务器带来 性能 ...
- nsq
官网:http://nsq.io (1)描述 都是message broker,rabbitmq久经考验,nsq则是后起之秀.rabbitmq是erlang编写,nsq是golang. 安装:http ...
- 实时消息平台NSQ的特性
NSQ是GO语言开发的可用于大规模系统中的实时消息服务,但是和RabbitMQ等相比,它具有什么特色,什么场景下选择NSQ呢? NSQ的自身特色很明显,最主要的优势在如下三个方面: 1,性能.在多个著 ...
- nsq初探
一. 安装 参考:http://nsq.io/deployment/installing.htmlhttp://www.baiyuxiong.com/?p=873 (推荐.) 不推荐直接把官方的 ...
- Mac OS X 上的安装nsq并使用
安装: brew install nsq 使用: The following steps will run a small NSQ cluster on your local machine and ...
- NSQ部署
一. 简介 NSQ主要有三个主要程序和一个Web服务程序: nsqd:是守护进程,接收,缓存,并投递消息给客户端 nsqlookupd:是一个守护进程,为消费者提供运行时发现服务,来查找指定 ...
随机推荐
- box-shaw四边阴影详解
四边设置: /*设置四边不同颜色外阴影*/ .element{ box-shadow:-10px 0 10px red, /*左边阴影*/ 10px 0 10px yellow, /*右边阴影*/ 0 ...
- python基础之文件操作和函数
一.知识点 1.三元运算 a = 2 b = 3 val = 6 if a < b else 7 print(val) 2.文件读取 f = open(file='file.txt',mode= ...
- Elemant-UI日期范围的表单验证
Form 组件提供了表单验证的功能,只需要通过 rules 属性传入约定的验证规则,并将 Form-Item 的 prop 属性设置为需校验的字段名即可.但是官网的示例只有普通日期类型的验证,没有时间 ...
- Python Cookbook 数据结构和算法
1.查找最大或最小的N个元素 import heapq nums = [1, 8, 2, 23, 7, -4, 18, 23, 42, 37, 2] print(heapq.nlargest(3, n ...
- 关于this绑定的四种方式
一.前言 我们每天都在书写着有关于this的javascript代码,似懂非懂地在用着.前阵子在看了<你不知道的JavaScript上卷>之后,也算是被扫盲了一边关于this绑定的四种方式 ...
- Week_10 C
拓扑排序 Week_10 C 题意:输入n行数据a,b ,表示a的钱数大于b的钱数,最低的人分的的钱数为888,问最少需要多少钱可以分给员工 思路:标准的拓扑排序,不过这题需要逆向拓扑 注意点 ...
- 写一个python脚本监控在linux中的进程
在虚拟机中安装Linux中的CentOS7系统 https://baijiahao.baidu.com/s?id=1597320700700593557&wfr=spider&for= ...
- tensorflow调试tfdbg
tensorflow调试工具:tfdbg 使用教程:https://www.cnblogs.com/hellcat/articles/7812119.html 遇到的错误信息及解决方案 ModuleN ...
- 如何选择 Apache Tomcat 与 JDK 版本
Apache Tomcat Version
- linux线程 join/detach
linux中创建线程时,可以通过 __attr 指定线程的属性 extern int pthread_create (pthread_t *__thread, __const pthread_attr ...