# README
lib4go
对常用功能进行封装提供友好的公共库代码,供其它golang程序调用
基本库
- 线程安全的map
- 编码处理(gbk,utf-8编码转换,base64,hex)
- 加解密(md5,des,rsa,sha1等)
- 图片库(绘制图片,文字)
- 系统资源(获取CPU,内存,硬盘使用情况)
组件封装
- 日志记录(文件,MQ)
- 数据库操作(oralce,sqlite)
- influxdb操作(存,取)
- MQ操作(发布,订阅等)
- scheduler(基于cron的任务处理)
- LUA脚本引擎
- HTTP请求(支持证书,cookie等)
- HTTP Server
# Packages
Package archiver makes it super easy to create and open .zip, .tar.gz, and .tar.bz2 files.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Extensions to the standard "os" package.
No description provided by the author
Package ps provides an API for finding and listing processes in a platform-agnostic way.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
各种情况下遇到的触发状态:
网络状态 函数 触发状态
{Type:EventSession State:StateConnecting Path: Err:<nil> Server:192.168.0.159:2181} true,
开始连接 eventWatch {Type:EventSession State:StateConnected Path: Err:<nil> Server:192.168.0.159:2181} true,
{Type:EventSession State:StateHasSession Path: Err:<nil> Server:192.168.0.159:2181} true,
eventWatch {Type:EventSession State:StateDisconnected Path: Err:<nil> Server:192.168.0.159:2181} true,
{Type:EventSession State:StateConnecting Path: Err:<nil> Server:192.168.0.159:2181} true,
网络断开 BindWatchValue 无
BindWatchChildren 无
eventWatch {Type:EventSession State:StateConnecting Path: Err:<nil> Server:192.168.0.159:2181} true,
网络重连 BindWatchValue -
BindWatchChildren -
{Type:EventSession State:StateExpired Path: Err:<nil> Server:192.168.0.159:2181} true【网络断开时间过短不会出现】,
{Type:EventSession State:StateDisconnected Path: Err:<nil> Server:192.168.0.159:2181} true,
网络恢复之后 eventWatch {Type:EventSession State:StateConnecting Path: Err:<nil> Server:192.168.0.159:2181} true,
{Type:EventSession State:StateConnected Path: Err:<nil> Server:192.168.0.159:2181} true,
{Type:EventSession State:StateHasSession Path: Err:<nil> Server:192.168.0.159:2181} true,
eventWatch {Type:EventSession State:StateDisconnected Path: Err:<nil> Server:192.168.0.159:2181} true,
连接断开 {Type:Unknown State:StateDisconnected Path: Err:<nil> Server:} false,
BindWatchValue {Type:EventNotWatching State:StateDisconnected Path:/zk_test/123 Err:zk: zookeeper is closing Server:} true【如果当前线程不是马上关闭会触发】
BindWatchChildren {Type:EventNotWatching State:StateDisconnected Path:/zk_test Err:zk: zookeeper is closing Server:} true【如果当前线程不是马上关闭会触发】
修改节点的值(网络正常) eventWatch {Type:EventNodeDataChanged State:Unknown Path:/zk_test/123 Err:<nil> Server:} true
BindWatchValue {Type:EventNodeDataChanged State:Unknown Path:/zk_test/123 Err:<nil> Server:} true
修改节点的值(网络断开) eventWatch 同网络连接断开
BindWatchValue 无
修改节点的值(网络恢复正常) eventWatch 同网络恢复之后
BindWatchValue {Type:EventNotWatching State:StateDisconnected Path:/zk_test/123 Err:zk: session has been expired by the server Server:} true【如果断开时间过短不会触发】
修改节点的值(网络恢复正常之后修改) eventWatch {Type:EventNodeDataChanged State:Unknown Path:/zk_test/123 Err:<nil> Server:} true
BindWatchValue {Type:EventNodeDataChanged State:Unknown Path:/zk_test/123 Err:<nil> Server:} true
修改子节点(网络正常) eventWatch {Type:EventNodeChildrenChanged State:Unknown Path:/zk_test Err:<nil> Server:} true
BindWatchChildren {Type:EventNodeChildrenChanged State:Unknown Path:/zk_test Err:<nil> Server:} true
修改子节点(网络断开) eventWatch 同网络连接断开
BindWatchChildren 无
修改子节点(网络恢复正常) eventWatch 同网络恢复之后
BindWatchChildren {Type:EventNotWatching State:StateDisconnected Path:/zk_test Err:zk: session has been expired by the server Server:} true【断开时间过短不会触发】
修改节点的值(网络恢复正常之后修改) eventWatch {Type:EventNodeChildrenChanged State:Unknown Path:/zk_test Err:<nil> Server:} true
BindWatchChildren {Type:EventNodeChildrenChanged State:Unknown Path:/zk_test Err:<nil> Server:} true
*/.