会员
周边
众包
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
张伯雨
Powered by
博客园
博客园
|
首页
|
新随笔
|
联系
|
订阅
|
管理
2017年8月31日
server.go 源码阅读
摘要: package pingoimport ( "bufio" "bytes" "flag" "fmt" "io" "math/rand" "net" "net/rpc" "os" "path" "path/filepath" "reflect" "strings" "time")// Register a new o..
阅读全文
posted @ 2017-08-31 11:39 张伯雨
阅读(388)
评论(0)
推荐(0)
编辑
pingo--util.go 源码阅读
摘要: package pingoimport ( "fmt" "math/rand" "strings")type meta string //定义 自定义数据类型//输出包含自身在内的参数字符串func (h meta) output(key, val string) { fmt.Printf("%s: %s: %s\n", string(h), key, val)}fun...
阅读全文
posted @ 2017-08-31 11:38 张伯雨
阅读(192)
评论(0)
推荐(0)
编辑
error.go源码笔记
摘要: package pingoimport ( "errors" "strings")const ( errorCodeConnFailed = "err-connection-failed" errorCodeHttpServe = "err-http-serve")// Error reported when connection to the external plug...
阅读全文
posted @ 2017-08-31 11:38 张伯雨
阅读(273)
评论(0)
推荐(0)
编辑
req_params.go
摘要: package http_apiimport ( "fmt" "log" "net" "net/http" "strings" "github.com/nsqio/nsq/internal/app")type logWriter struct { app.Logger}func (l logWriter) Write(p []byte) (int, err...
阅读全文
posted @ 2017-08-31 11:37 张伯雨
阅读(256)
评论(0)
推荐(0)
编辑
top_channel_args.go
摘要: package http_apiimport ( "fmt" "log" "net" "net/http" "strings" "github.com/nsqio/nsq/internal/app")type logWriter struct { app.Logger}func (l logWriter) Write(p []byte) (int, err...
阅读全文
posted @ 2017-08-31 11:37 张伯雨
阅读(142)
评论(0)
推荐(0)
编辑
authorizations.go
摘要: package authimport ( "errors" "fmt" "log" "net/url" "regexp" "time" "github.com/nsqio/nsq/internal/http_api")type Authorization struct { Topic string `json:"topic"` ...
阅读全文
posted @ 2017-08-31 11:37 张伯雨
阅读(309)
评论(0)
推荐(0)
编辑
http_server.go
摘要: package http_apiimport ( "fmt" "log" "net" "net/http" "strings" "github.com/nsqio/nsq/internal/app")type logWriter struct { app.Logger}func (l logWriter) Write(p []byte) (int, err...
阅读全文
posted @ 2017-08-31 11:34 张伯雨
阅读(203)
评论(0)
推荐(0)
编辑
compress.go
摘要: // Copyright 2013 The Gorilla Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.// copied from https://github.com/goril...
阅读全文
posted @ 2017-08-31 11:33 张伯雨
阅读(203)
评论(0)
推荐(0)
编辑
api_response.go
摘要: package http_apiimport ( "encoding/json" "fmt" "io" "net/http" "time" "github.com/julienschmidt/httprouter" "github.com/nsqio/nsq/internal/app")type Decorator func(APIHandler) API...
阅读全文
posted @ 2017-08-31 11:28 张伯雨
阅读(327)
评论(0)
推荐(0)
编辑
api_request.go
摘要: package http_apiimport ( "crypto/tls" "encoding/json" "fmt" "io/ioutil" "net" "net/http" "net/url" "strconv" "strings" "time")type deadlinedConn struct { Timeout time....
阅读全文
posted @ 2017-08-31 11:27 张伯雨
阅读(289)
评论(0)
推荐(0)
编辑
logger.go
摘要: package app//日志接口type Logger interface { Output(maxdepth int, s string) error}
阅读全文
posted @ 2017-08-31 11:26 张伯雨
阅读(130)
评论(0)
推荐(0)
编辑
string_array.go
摘要: package appimport ( "strings")type StringArray []stringfunc (a *StringArray) Set(s string) error { *a = append(*a, s) return nil}func (a *StringArray) String() string { return strings.Join...
阅读全文
posted @ 2017-08-31 11:26 张伯雨
阅读(189)
评论(0)
推荐(0)
编辑
float_array.go
摘要: package appimport ( "fmt" "log" "sort" "strconv" "strings")//这个文件相关的代码不需要解释了吧!!!type FloatArray []float64func (a *FloatArray) Set(param string) error { for _, s := range strings.Spli...
阅读全文
posted @ 2017-08-31 11:25 张伯雨
阅读(187)
评论(0)
推荐(0)
编辑
types.go
摘要: package clusterinfoimport ( "encoding/json" "fmt" "sort" "strings" "time" "github.com/blang/semver" "github.com/nsqio/nsq/internal/quantile")type ProducerTopic struct { Topic ...
阅读全文
posted @ 2017-08-31 11:24 张伯雨
阅读(277)
评论(0)
推荐(0)
编辑
data.go
摘要: package clusterinfoimport ( "fmt" "net" "net/url" "sort" "strconv" "strings" "sync" "github.com/blang/semver" "github.com/nsqio/nsq/internal/http_api" "github.com/nsqio/n...
阅读全文
posted @ 2017-08-31 11:23 张伯雨
阅读(248)
评论(0)
推荐(0)
编辑
dirlock_windows.go
摘要: package dirlocktype DirLock struct { dir string}func New(dir string) *DirLock { return &DirLock{ dir: dir, }}func (l *DirLock) Lock() error { return nil}func (l *DirLock) Unlock() e...
阅读全文
posted @ 2017-08-31 11:22 张伯雨
阅读(207)
评论(0)
推荐(0)
编辑
tcp.go
摘要: package nsqdimport ( "io" "net" "github.com/nsqio/nsq/internal/protocol")type tcpServer struct { ctx *context}func (p *tcpServer) Handle(clientConn net.Conn) { p.ctx.nsqd.logf("TCP: new...
阅读全文
posted @ 2017-08-31 11:21 张伯雨
阅读(193)
评论(0)
推荐(0)
编辑
dirlock.go
摘要: // +build !windowspackage dirlockimport ( "fmt" "os" "syscall")type DirLock struct { dir string f *os.File}func New(dir string) *DirLock { return &DirLock{ dir: dir, }}fu...
阅读全文
posted @ 2017-08-31 11:21 张伯雨
阅读(140)
评论(0)
推荐(0)
编辑
statsd.go
摘要: package nsqdimport ( "fmt" "math" "runtime" "sort" "time" "github.com/nsqio/nsq/internal/statsd")type Uint64Slice []uint64func (s Uint64Slice) Len() int { return len(s)}func (s Ui...
阅读全文
posted @ 2017-08-31 11:20 张伯雨
阅读(435)
评论(0)
推荐(0)
编辑
stats.go
摘要: package nsqdimport ( "sort" "sync/atomic" "github.com/nsqio/nsq/internal/quantile")type TopicStats struct { TopicName string `json:"topic_name"` Channels []ChannelStats `...
阅读全文
posted @ 2017-08-31 11:19 张伯雨
阅读(256)
评论(0)
推荐(0)
编辑