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






张伯雨

学习使人快乐
 
 

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

2017年9月1日

dictionary.go
摘要: package segoimport "github.com/adamzy/cedar-go"// Dictionary结构体实现了一个字串前缀树,一个分词可能出现在叶子节点也有可能出现在非叶节点type Dictionary struct { trie *cedar.Cedar // Cedar 前缀树 maxTokenLength int //... 阅读全文
posted @ 2017-09-01 10:31 张伯雨 阅读(299) 评论(0) 推荐(0)
 
segment.go
摘要: package sego// 文本中的一个分词type Segment struct { // 分词在文本中的起始字节位置 start int // 分词在文本中的结束字节位置(不包括该位置) end int // 分词信息 token *Token}// 返回分词在文本中的起始字节位置func (s *Segment) Start() int { ret... 阅读全文
posted @ 2017-09-01 10:29 张伯雨 阅读(136) 评论(0) 推荐(0)
 
util.go
摘要: <wiz_tmp_tag id="wiz-table-range-border" contenteditable="false" style="display: none;"> 阅读全文
posted @ 2017-09-01 10:27 张伯雨 阅读(346) 评论(0) 推荐(0)
 
etcd_selector.go
摘要: package clientselectorimport ( "errors" "math/rand" "net" "net/rpc" "net/url" "strconv" "strings" "time" "golang.org/x/net/context" "github.com/coreos/etcd/client" "gi... 阅读全文
posted @ 2017-09-01 10:24 张伯雨 阅读(596) 评论(0) 推荐(0)
 
ratelimit.go
摘要: // The ratelimit package provides an efficient token bucket implementation// that can be used to limit the rate of arbitrary things.// See http://en.wikipedia.org/wiki/Token_bucket.package ratelimitim... 阅读全文
posted @ 2017-09-01 10:23 张伯雨 阅读(803) 评论(0) 推荐(0)
 
reader-write.go
摘要: package ratelimitimport "io"type reader struct { r io.Reader bucket *Bucket}// Reader returns a reader that is rate limited by// the given token bucket. Each token in the bucket// represent... 阅读全文
posted @ 2017-09-01 10:23 张伯雨 阅读(343) 评论(0) 推荐(0)
 
profile.go
摘要: // Package profile provides a simple way to manage runtime/pprof// profiling of your Go application.package profileimport ( "io/ioutil" "log" "os" "os/signal" "path/filepath" "runtim... 阅读全文
posted @ 2017-09-01 10:22 张伯雨 阅读(443) 评论(0) 推荐(0)
 
man.go 阅读笔记
摘要: import ( "flag" "fmt" "github.com/Sirupsen/logrus" "log" "os" "os/signal" "syscall")var ( pConfig ProxyConfig pLog *logrus.Logger configFile = flag.String("c", "... 阅读全文
posted @ 2017-09-01 10:21 张伯雨 阅读(296) 评论(0) 推荐(0)
 
proxy.go 源码阅读
摘要: package mainimport ( "net" "time")func initProxy() { pLog.Infof("Proxying %s -> %s\n", pConfig.Bind, pConfig.Backend) //输出服务地址 后端服务地址列表 server, err := net.Listen("tcp", pConfig.Bind) ... 阅读全文
posted @ 2017-09-01 10:20 张伯雨 阅读(369) 评论(0) 推荐(0)
 
balance.go 源码阅读
摘要: import ( //"fmt" "math/rand" "net" "stathat.com/c/consistent" "time")// BackendSvr Typetype BackendSvr struct { svrStr string isUp bool // is Up or Down failTimes int}v... 阅读全文
posted @ 2017-09-01 10:20 张伯雨 阅读(280) 评论(0) 推荐(0)
 
上一页 1 2 3 4 5 6 7 8 9 ··· 37 下一页