上一页 1 ··· 44 45 46 47 48 49 50 51 52 ··· 167 下一页
摘要: default.go models.go service.go service1.go service2.go 阅读全文
posted @ 2018-01-28 13:03 无天666 阅读(546) 评论(0) 推荐(0)
摘要: Go 只读/只写channel Go中channel可以是只读、只写、同时可读写的。 //定义只读的channel read_only := make (<-chan int) //定义只写的channel write_only := make (chan<- int) //可同时读写 read_w 阅读全文
posted @ 2018-01-27 15:59 无天666 阅读(375) 评论(0) 推荐(0)
摘要: 不是这样的。 Collection 的单个 doc 有大小上限,现在是 16MB,这就使得你不可能把所有东西都揉到一个 collection 里。而且如果 collection 结构过于复杂,既会影响查询、更新效率,也会造成维护困难和操作风险。你有尝试过手一抖就把一个 doc 不小心存成 null 阅读全文
posted @ 2018-01-26 17:28 无天666 阅读(742) 评论(0) 推荐(0)
摘要: (1)int转string ? 1 2 s := strconv.Itoa(i) 等价于s := strconv.FormatInt(int64(i), 10) ? 1 2 s := strconv.Itoa(i) 等价于s := strconv.FormatInt(int64(i), 10) ? 阅读全文
posted @ 2018-01-25 22:07 无天666 阅读(39718) 评论(0) 推荐(1)
摘要: 把Mongodb Server 设置为系统,方便启动与停止 今天一时兴起在本地安装了下Mongodb服务,安装完后,创建了配置文件为数据库服务指明在哪里存储数据库原始文件,随即就启动了mongo server,然后就发现一个不顺意的事情,启动server的exe程序执行完会遗留一个cmd窗口,这个真 阅读全文
posted @ 2018-01-25 09:49 无天666 阅读(447) 评论(0) 推荐(1)
摘要: http://blog.csdn.net/xiaohu50/article/details/51606349 阅读全文
posted @ 2018-01-23 15:44 无天666 阅读(316) 评论(0) 推荐(0)
摘要: // 函数 // 判断在 b(s、r)中能否找到 pattern 所匹配的字符串 func Match(pattern string, b []byte) (matched bool, err error) func MatchString(pattern string, s string) (matched bool, err error) func MatchReader(pattern s... 阅读全文
posted @ 2018-01-23 13:28 无天666 阅读(581) 评论(0) 推荐(0)
摘要: Master-Slave: 读写分离,save复制master的数据。同步复制:保证了强一致性但是会影响高可用性,因为写入的时候要保证slave都写入了才能返回告诉生产者数据写入成功,如果slave过多就是时间过长。异步复制:数据写入master之后不要求所有的slave都写入就返回生产者写入成功,然后由slave异步的同步,同步过程既可以是master去推也可以是slave去拉,master不... 阅读全文
posted @ 2018-01-21 16:05 无天666 阅读(801) 评论(0) 推荐(0)
摘要: golang中os/signal包的使用 chenbaoke · 2015-06-17 20:03:59 · 2748 次点击 · 预计阅读时间 1 分钟 · 不到1分钟之前 开始浏览 golang中os/signal包的使用 这是一个创建于 2015-06-17 20:03:59 的文章,其中的信 阅读全文
posted @ 2018-01-20 17:32 无天666 阅读(873) 评论(0) 推荐(0)
摘要: kafka消费者 以下博客是通过生产者创建、发送消息至kafka 博客链接 现在我们站在消费者的角度,来进行收取消息 接下来我们测试上面的消费者示例代码,在进行测试前我们需要如下的准备工作 1、启动zookeeper 2、启动kafka 3、创立生产者topic .\bin\windows\kafk 阅读全文
posted @ 2018-01-20 15:15 无天666 阅读(2223) 评论(0) 推荐(0)
上一页 1 ··· 44 45 46 47 48 49 50 51 52 ··· 167 下一页