• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






张伯雨

学习使人快乐
 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理
上一页 1 2 3 4 5 6 7 8 9 10 ··· 37 下一页

2017年9月1日

log.go 源码阅读
摘要: package mainimport ( "github.com/Sirupsen/logrus" "os" "path/filepath")func initLogger() error { dirPath, _ := filepath.Abs(filepath.Dir(pConfig.Log.Path)) //获取日志文件目录 if _, err := os.S... 阅读全文
posted @ 2017-09-01 10:19 张伯雨 阅读(246) 评论(0) 推荐(0)
 
monitor.go 源码阅读
摘要: package mainimport ( "fmt" "net/http")// 查询监控信息的接口func statsHandler(w http.ResponseWriter, r *http.Request) { _str := "" for _, v := range pBackendSvrs { _str += fmt.Sprintf("Server... 阅读全文
posted @ 2017-09-01 10:19 张伯雨 阅读(327) 评论(0) 推荐(0)
 
config.go 源码阅读
摘要: package mainimport ( "io/ioutil" "launchpad.net/goyaml")// ProxyConfig Typetype ProxyConfig struct { Bind string `yaml:"bind"` //代理服务监听端口 WaitQueueLen int `yaml:"wait_que... 阅读全文
posted @ 2017-09-01 10:18 张伯雨 阅读(237) 评论(0) 推荐(0)
 
objectid.go源码阅读
摘要: /*具体实现理论参见 mongodb官方 objectid生成策略http://docs.mongodb.org/manual/reference/object-id/ObjectId 是一个由12字节组成的bson数据,按照字节顺序,一次代表:ObjectId is a 12-byte BSON type, constructed using:4个字节代表1970年元月一日到现在毫秒数 UN... 阅读全文
posted @ 2017-09-01 10:16 张伯雨 阅读(445) 评论(0) 推荐(0)
 
forwardPort.go
摘要: <wiz_tmp_tag id="wiz-table-range-border" contenteditable="false" style="display: none;"> 阅读全文
posted @ 2017-09-01 10:15 张伯雨 阅读(311) 评论(0) 推荐(0)
 
Docker 新手入门
摘要: 简介如果您是 Docker 新手请您花大约三十分钟的时间来了解 Docker 相关的知识和内容。 Docker 与 Linux 息息相关,因此在阅读本文档之前请您确保以下条件:对 Linux 的命令行操作有一定了解,并且懂得一些基础命令。对 Linux 服务管理有一定的了解。当阅读完本文之后您可以了解什么是 Docker、使用它有什么好处、以及 Docker 具体的使用方法。为什么选择 Docke... 阅读全文
posted @ 2017-09-01 10:14 张伯雨 阅读(352) 评论(0) 推荐(0)
 
consistent.go 源码阅读
摘要: import ( "errors" "hash/crc32" "sort" "strconv" "sync")type uints []uint32 //实现 sort接口// Len returns the length of the uints array.func (x uints) Len() int { return len(x) }// Less re... 阅读全文
posted @ 2017-09-01 09:37 张伯雨 阅读(273) 评论(0) 推荐(0)
 
indexer.go
摘要: package coreimport ( "log" "math" "sort" "sync" "github.com/huichen/wukong/types" "github.com/huichen/wukong/utils")// 索引器type Indexer struct { // 从搜索键到文档列表的反向索引 // 加了读写锁以保证读写安... 阅读全文
posted @ 2017-09-01 09:36 张伯雨 阅读(266) 评论(0) 推荐(0)
 
ranker.go
摘要: package coreimport ( "github.com/huichen/wukong/types" "github.com/huichen/wukong/utils" "log" "sort" "sync")type Ranker struct { lock struct { sync.RWMutex fields map[... 阅读全文
posted @ 2017-09-01 09:36 张伯雨 阅读(375) 评论(0) 推荐(0)
 
stop_token.go
摘要: package engineimport ( "bufio" "log" "os")type StopTokens struct { stopTokens map[string]bool}// 从stopTokenFile中读入停用词,一个词一行// 文档索引建立时会跳过这些停用词func (st *StopTokens) Init(stopTokenFile string... 阅读全文
posted @ 2017-09-01 09:35 张伯雨 阅读(319) 评论(0) 推荐(0)
 
上一页 1 2 3 4 5 6 7 8 9 10 ··· 37 下一页