replicator

package module
v0.0.0-...-9017e2e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 33 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

dts

背景

dts(data transfer service),是我们自主研发的一块数据传输系统,旨在通过增量或全量+增量的方式,同步某个数据源的数据到下游的其它数据源。 目前支持MySQL到MySQL,以及MySQL到Kafka,支持增量和全量+增量两种方式。后续会在此基础上支持更多的数据源。

使用场景

dts目前可用于TP和AP两种场景。 其中AP类场景,我们通过增量抽取MySQL binlog,并批量回放到Kafka中,再由数据中台研发将Kafka数据回放到hive、flink中,实现MySQL数据到下游AP类存储数据库的数据传输。 AP类场景对数据延迟要求没有那么苛刻,我们在数据抽取和回放的时候做了多级缓冲,通过批量的方式实现数据传输的高吞吐。 AP类场景比较类似Maxwell和Canal Otter。

对于TP类场景,目前主要运用于在线的MySQL到MySQL的数据全量+增量传输,比如同机房单集群的数据同步,以及双活环境。 TP类场景dts还可与dbproxy配合实现在线的数据分片平滑扩容。 后续TP类场景会全量替换阿里云dts。

Install

Dependency

Go version >= 1.13 Use go mod for dependency management

Build

make

Output: bin/dts

Start DTS Service

Launch Dependencies
  • Launch etcd...
  • Launch MySQL to save metadata for dts
Start dts

bin/dts -config etc/replicator.ini

Config

DTS config

etc/replicator.ini

use the example and change the dependency addr

MySQL config (for data source)

/etc/my.cnf

[mysqld]
gtid_mode=on
enforce_gtid_consistency=on

log_bin=ON
binlog_format=row
log-slave-updates=1

功能介绍

基础功能
通用功能
  • 支持通过SQL语句指定数据抽取时的filter过滤器
  • 支持数字型字段,字符串字段仅支持UTF-8编码
  • gh-ost online DDL
  • 一个任务涵盖多个MySQL库,多个数据表
  • 普通在线DDL
OLTP
  • MySQL到MySQL数据实时增量同步
  • MySQL到MySQL数据全量+增量同步
  • MySQL分片平滑扩容(需要配合dbproxy)
  • 基于GTID的双向数据同步
OLAP
  • MySQL到Kafka的增量数据同步
  • 指定Kafka Topic,table形式或database形式
  • 指定Kafka分片方式,table方式或Columns方式,可指定多个Column
  • 可指定写入Kafka时需要过滤的Columns
高级功能
  • 集群高可用:http服务无状态横向扩容,worker服务可在线迁移任务
  • 任务分配负载均衡:根据每个进程的任务数(后续可支持服务器资源)
  • 数据断点续传:每传输一定量的binlog events,会记录当前的GTID,后续在此基础上继续传输
  • 服务graceful shutdown:通过先停止抽取线程,再停止回放线程,并完成任务状态记录,之后再关闭服务。

横向对比

dts vs Canal vs Maxwell
  • Canal1.1.*版本之前不支持数据到kafka.只能通过手动开发完成
  • Maxwell只支持json格式,而canal的格式比较自由
  • Maxwell部署非常方便,服务端客户端一体化。Canal则有adapter,serer需要分开部署。Canal相对更丰满一些
  • Canal支持HA,Maxwell支持断点还原
  • Maxwell支持bootstrap,对于数据初始化来说,Canal还不支持
  • Maxwell支持全量增量同步到kafka.Canal全量暂时只能通过接口形式调用
  • Canal依靠binlog的位点记录位置,Maxwell自己记录了position
dts Canal Maxwell
公司 自研 阿里 zendesk
开发语言 Go Java Java
社区活跃度 暂无社区 活跃 活跃
高可用(HA) 支持 支持 支持
数据去向(Sink) Kafka/MySQL Kafka等 Kafka/Redis等
分区 支持 支持 支持
分区模式-库/表 支持 不支持 支持
数据格式 JSON 任意格式 JSON
自研dts vs 阿里云dts
自研dts 阿里云dts
多表到单表同步 ✓ ×
全量+增量数据同步 ✓ ✓
增量数据同步 ✓ ✓
多库数据库同步 ✓ ✓
多表数据同步 ✓ ✓
双向同步 ✓ ✓
fixed格式的binlog ✓ ×
基于GTID的binlog events ✓ ✓
基于file pos的binlog events × ✓
普通ddl ✓ ✓
gh-ost在线ddl ✓ ✓
基于column的filter,支持数字类型 ✓ ✓
基于column的filter,支持UTF-8字符串类型 ✓ ✓

Roadmap

  • DTS + dbproxy实现在线扩容
  • 优化update,只更新变化字段
  • 接入日志中心
  • AP场景支持全量+增量同步

沟通交流

服务群

对已接入dts的业务提供在线技术支持服务

Documentation

Index

Constants

View Source
const (
	BlplQuery       = "Query"
	BlplTransaction = "Transaction"

	ReplicationInit    = "Init"
	ReplicationCopying = "Copying"
	BlpStopped         = "Stopped"
	BlpRunning         = "Running"
	BlpError           = "Error"
)
View Source
const (
	PartitionModeColumn     = "column"
	PartitionModeTable      = "table"
	PartitionModePrimaryKey = "primary_key"
)
View Source
const (
	ProducerPartitionByFallbackTable      = "table"
	ProducerPartitionByFallbackPrimaryKey = "primary_key"

	DefaultProducerPartitionByFallbackTable = ProducerPartitionByFallbackTable
)
View Source
const (
	DestTypeMysql = "mysql"
	DestTypeKafka = "kafka"

	SbmPhaseReplay = "replay"
	SbmPhaseStream = "stream"

	EventTypeGTID     = "gtid"
	EventTypeXID      = "xid"
	EventTypeQuery    = "query"
	EventTypeTableMap = "tablemap"
	EventTypeRows     = "rows"
)
View Source
const (
	// Equal is used to filter an integer column on a specific value
	Equal = Opcode(iota)
)
View Source
const ExcludeStr = "exclude"

ExcludeStr is the filter value for excluding tables that match a rule. TODO(sougou): support this on vstreamer side also.

Variables

View Source
var BatchPacketSize = flag.Int("rowstream_packet_size", 250000, "Suggested packet size for Copy Table streamer. This is used only as a recommendation. The actual packet size may be more or less than this amount.")
View Source
var HeartbeatTime = 900 * time.Millisecond

HeartbeatTime is set to slightly below 1s, compared to idleTimeout set by player at slightly above 1s. This minimizes conflicts between the two timeouts.

View Source
var PacketSize = flag.Int("stream_packet_size", 25, "Suggested packet size for Replication streamer. This is used only as a recommendation. The actual packet size may be more or less than this amount.")

NOTE 经测试,一个包约为250 Bytes左右,kafka类型的可调大,mysql类型的应尽可能调小 FIXME 当前先调小PacketSize,后续增加ap类业务的commit event

Functions

func GenerateUpdatePos

func GenerateUpdatePos(uid int, pos mysql.Position, timeUpdated int64, txTimestamp int64) string

func GenerateUpdateTime

func GenerateUpdateTime(uid int, timeUpdated int64) (string, error)

func MessageTruncate

func MessageTruncate(msg string) string

Types

type Applier

type Applier interface {
	ApplyRawGtid(context.Context, string) error

	ApplyGtid() error

	ApplyBegin() error

	ApplyCommit() error

	ApplyField() error

	ApplyStmt() error

	ApplyRow() error

	ApplyOther() error

	ApplyDDL() error

	ApplyHeartbeat() error
}

type ApplierKafka

type ApplierKafka struct {
	// contains filtered or unexported fields
}

func (*ApplierKafka) ApplyBegin

func (k *ApplierKafka) ApplyBegin() error

func (*ApplierKafka) ApplyCommit

func (k *ApplierKafka) ApplyCommit() error

func (*ApplierKafka) ApplyDDL

func (k *ApplierKafka) ApplyDDL() error

func (*ApplierKafka) ApplyField

func (k *ApplierKafka) ApplyField() error

func (*ApplierKafka) ApplyGtid

func (k *ApplierKafka) ApplyGtid() error

func (*ApplierKafka) ApplyHeartbeat

func (k *ApplierKafka) ApplyHeartbeat() error

func (*ApplierKafka) ApplyOther

func (k *ApplierKafka) ApplyOther() error

func (*ApplierKafka) ApplyRawGtid

func (k *ApplierKafka) ApplyRawGtid(ctx context.Context, gtid string) error

func (*ApplierKafka) ApplyRow

func (k *ApplierKafka) ApplyRow() error

func (*ApplierKafka) ApplyStmt

func (k *ApplierKafka) ApplyStmt() error

type ApplierMysql

type ApplierMysql struct {
	// contains filtered or unexported fields
}

func (*ApplierMysql) ApplyBegin

func (m *ApplierMysql) ApplyBegin() error

func (*ApplierMysql) ApplyCommit

func (m *ApplierMysql) ApplyCommit() error

func (*ApplierMysql) ApplyDDL

func (m *ApplierMysql) ApplyDDL() error

func (*ApplierMysql) ApplyField

func (m *ApplierMysql) ApplyField() error

func (*ApplierMysql) ApplyGtid

func (m *ApplierMysql) ApplyGtid() error

func (*ApplierMysql) ApplyHeartbeat

func (m *ApplierMysql) ApplyHeartbeat() error

func (*ApplierMysql) ApplyOther

func (m *ApplierMysql) ApplyOther() error

func (*ApplierMysql) ApplyRawGtid

func (m *ApplierMysql) ApplyRawGtid(ctx context.Context, gtid string) error

func (*ApplierMysql) ApplyRow

func (m *ApplierMysql) ApplyRow() error

func (*ApplierMysql) ApplyStmt

func (m *ApplierMysql) ApplyStmt() error

type BinlogConnection

type BinlogConnection struct {
	*mysql.Conn
	// contains filtered or unexported fields
}

func NewBinlogConnection

func NewBinlogConnection(cp *mysql.ConnParams) (*BinlogConnection, error)

func (*BinlogConnection) Close

func (bc *BinlogConnection) Close()

func (*BinlogConnection) StartBinlogDumpFromCurrent

func (bc *BinlogConnection) StartBinlogDumpFromCurrent(ctx context.Context) (mysql.Position, <-chan mysql.BinlogEvent, <-chan error, error)

func (*BinlogConnection) StartBinlogDumpFromPosition

func (bc *BinlogConnection) StartBinlogDumpFromPosition(ctx context.Context, startPos mysql.Position) (<-chan mysql.BinlogEvent, <-chan error, error)

func (*BinlogConnection) SwitchOffMasterArg

func (bc *BinlogConnection) SwitchOffMasterArg() error

type ColExpr

type ColExpr struct {
	// ColNum specifies the source column value.
	ColNum int

	Field *proto.Field

	FixedValue sqltypes.Value
}

ColExpr represents a column expression.

type DBClient

type DBClient struct {
	InTransaction bool
	// contains filtered or unexported fields
}

DBClient is a wrapper on DBClient. It allows us to retry a failed transactions on lock errors.

func NewDBClient

func NewDBClient(params *mysql.ConnParams, stats *Stats) *DBClient

func (*DBClient) Begin

func (c *DBClient) Begin() error

func (*DBClient) Close

func (c *DBClient) Close()

func (*DBClient) Commit

func (c *DBClient) Commit() error

func (*DBClient) Connect

func (c *DBClient) Connect() error

func (*DBClient) CreateState

func (c *DBClient) CreateState(source *mysql.ConnParams, dest *mysql.ConnParams, kafkaParams *KafkaParams, filter *proto.Filter, serviceAddr string, rl *vo.RateLimit) (int, error)

func (*DBClient) DBName

func (c *DBClient) DBName() string

func (*DBClient) DeleteTask

func (c *DBClient) DeleteTask(ctx context.Context, id int) error

func (*DBClient) EndDDL

func (c *DBClient) EndDDL()

func (*DBClient) Execute

func (c *DBClient) Execute(query string) (*sqltypes.Result, error)

Execute is ExecuteFetch without the maxrows.

func (*DBClient) ExecuteFetch

func (c *DBClient) ExecuteFetch(query string, maxrows int) (*sqltypes.Result, error)

func (*DBClient) ExecuteWithRetry

func (c *DBClient) ExecuteWithRetry(ctx context.Context, query string) (*sqltypes.Result, error)

func (*DBClient) GetTask

func (c *DBClient) GetTask(ctx context.Context, id int) (*sqltypes.Result, error)

func (*DBClient) ListLocalTaskIds

func (c *DBClient) ListLocalTaskIds(addr string) (*sqltypes.Result, error)

func (*DBClient) ListLocalTasks

func (c *DBClient) ListLocalTasks(ctx context.Context, addr string) (*sqltypes.Result, error)

func (*DBClient) ListTasks

func (c *DBClient) ListTasks(ctx context.Context, perPage, page int) (*sqltypes.Result, error)

func (*DBClient) ReadCopyStats

func (c *DBClient) ReadCopyStats(uid int) (int64, error)

func (*DBClient) ReadStats

func (c *DBClient) ReadStats(uid int) (mysql.Position, string, bool, error)

func (*DBClient) Retry

func (c *DBClient) Retry() (*sqltypes.Result, error)

func (*DBClient) Rollback

func (c *DBClient) Rollback() error

func (*DBClient) SetMessage

func (c *DBClient) SetMessage(id int, message string) error

func (*DBClient) SetNextGtid

func (c *DBClient) SetNextGtid(ctx context.Context, gtid string) error

func (*DBClient) SetState

func (c *DBClient) SetState(id int, state, message string) error

type Filter

type Filter struct {
	Opcode Opcode
	ColNum int
	Value  sqltypes.Value
}

Filter contains opcodes for filtering.

type IDPool

type IDPool struct {
	sync.Mutex
	// contains filtered or unexported fields
}

IDPool is used to ensure that the set of IDs in use concurrently never contains any duplicates. The IDs start at 1 and increase without bound, but will never be larger than the peak number of concurrent uses.

IDPool's Get() and Put() methods can be used concurrently.

func NewIDPool

func NewIDPool(initValue uint32) *IDPool

NewIDPool creates and initializes an IDPool.

func (*IDPool) Get

func (pool *IDPool) Get() (id uint32)

Get returns an ID that is unique among currently active users of this pool.

func (*IDPool) Put

func (pool *IDPool) Put(id uint32)

Put recycles an ID back into the pool for others to use. Putting back a value or 0, or a value that is not currently "checked out", will result in a panic because that should never happen except in the case of a programming error.

type KafkaMessage

type KafkaMessage struct {
	Table       string                   `json:"table"`
	Database    string                   `json:"database"`
	Gtid        string                   `json:"gtid,omitempty"`
	ExecuteTime int64                    `json:"es"`
	Ts          int64                    `json:"ts"`
	PkNames     []string                 `json:"pkNames"`
	Sql         string                   `json:"sql"`
	IsDDL       bool                     `json:"isDdl"`
	Type        string                   `json:"type"`
	Data        []map[string]interface{} `json:"data"`
	Old         []map[string]interface{} `json:"old,omitempty"`
}

type KafkaMessageMaxwell

type KafkaMessageMaxwell struct {
	Table    string                 `json:"table"`
	Database string                 `json:"database"`
	Gtid     string                 `json:"gtid,omitempty"`
	Ts       int64                  `json:"ts"`
	Type     string                 `json:"type"`
	Data     map[string]interface{} `json:"data"`
	Old      map[string]interface{} `json:"old,omitempty"`
}

type KafkaParams

type KafkaParams struct {
	Addr                        string
	Topic                       string
	FlatFormat                  bool
	MaxwellFormat               bool
	TopicMode                   TopicMode
	PartitionMode               string
	PartitionColumns            []string
	ExcludeColumns              []string
	WithGtid                    bool
	ProducerPartitionByFallback string
}

type Opcode

type Opcode int

Opcode enumerates the operators supported in a where clause

type Plan

type Plan struct {
	Table *Table

	// ColExprs is the list of column expressions to be sent
	// in the stream.
	ColExprs []ColExpr

	// Filters is the list of filters to be applied to the columns
	// of the table.
	Filters []Filter
}

Plan represents the plan for a table.

type PrimaryKeyInfo

type PrimaryKeyInfo struct {
	Index      int64 // base 1
	Name       string
	CharSet    string
	Collation  string
	DataType   string
	ColumnType string
}

PrimaryKeyInfo is used to store charset and collation for primary keys where applicable

type Replicator

type Replicator struct {
	Id      int
	State   string
	Message string
	// contains filtered or unexported fields
}

Replicator provides the core logic to start vreplication streams

func LoadFromDB

func LoadFromDB(id int, stats *Stats, serviceAddr string) (*Replicator, error)

func NewReplicator

func NewReplicator(source *mysql.ConnParams, dest *mysql.ConnParams, kafkaParams *KafkaParams, filter *proto.Filter, rl *vo.RateLimit, stats *Stats, incrementalMode bool, serviceAddr string) (*Replicator, error)

newReplicator creates a new Replicator. The valid fields from the source are: Keyspce, Shard, Filter, ExternalMySql. The Filter consists of Rules. Each Rule has a Match and an (inner) Filter field. The Match can be a table name or, if it begins with a "/", a wildcard. The Filter can be empty: get all rows and columns. The Filter can be a keyrange, like "-80": get all rows that are within the keyrange. The Filter can be a select expression. Examples.

"select * from t", same as an empty Filter,
"select * from t where in_keyrange('-80')", same as "-80",
"select * from t where in_keyrange(col1, 'hash', '-80')",
"select col1, col2 from t where...",
"select col1, keyspace_id() as ksid from t where...",
"select id, count(*), sum(price) from t group by id".
Only "in_keyrange" expressions are supported in the where clause.
The select expressions can be any valid non-aggregate expressions,
or count(*), or sum(col).
If the target column name does not match the source expression, an
alias like "a+b as targetcol" must be used.
More advanced constructs can be used. Please see the table plan builder
documentation for more info.

func (*Replicator) Done

func (r *Replicator) Done() chan struct{}

func (*Replicator) Replicate

func (r *Replicator) Replicate(ctx context.Context) error

Replicate starts a replication stream. It can be in one of three phases: 1. Init: If a request is issued with no starting position, we assume that the contents of the tables must be copied first. During this phase, the list of tables to be copied is inserted into the copy_state table. A successful insert gets us out of this phase. 2. Copy: If the copy_state table has rows, then we are in this phase. During this phase, we repeatedly invoke copyNext until all the tables are copied. After each table is successfully copied, it's removed from the copy_state table. We exit this phase when there are no rows left in copy_state. 3. Replicate: In this phase, we replicate binlog events indefinitely, unless a stop position was requested. This phase differs from the Init phase because there is a replication position. If a request had a starting position, then we go directly into phase 3. During these phases, the state of replication is reported as 'Init', 'Copying', or 'Running'. They all mean the same thing. The difference in the phases depends on the criteria defined above. The different states reported are mainly informational. The 'Stopped' state is, however, honored. All phases share the same plan building framework. We leverage the fact the row representation of a read (during copy) and a binlog event are identical. However, there are some subtle differences, explained in the plan builder code.

type ReplicatorMode

type ReplicatorMode uint8
const (
	ModeOLAP ReplicatorMode = iota
	ModeOLTP
	ModeBoth
)

type ReplicatorPlan

type ReplicatorPlan struct {
	VStreamFilter *proto.Filter
	TargetTables  map[string]map[string]*TablePlan
	TablePlans    map[string]map[string]*TablePlan
	PKInfoMap     map[string]map[string][]*PrimaryKeyInfo
}

ReplicatorPlan is the execution plan for the replicator. It contains plans for all the tables it's replicating. Every phase of vreplication builds its own instance of the ReplicatorPlan. This is because the plan depends on copyState, which changes on every iteration. The table plans within ReplicatorPlan will not be fully populated because all the information is not available initially. For simplicity, the ReplicatorPlan is immutable. Once we get the field info for a table from the stream response, we'll have all the necessary info to build the final plan. At that time, buildExecutionPlan is invoked, which will make a copy of the TablePlan from ReplicatorPlan, and fill the rest of the members, leaving the original plan unchanged. The constructor is buildReplicatorPlan in table_plan_builder.go

func (*ReplicatorPlan) MarshalJSON

func (rp *ReplicatorPlan) MarshalJSON() ([]byte, error)

MarshalJSON performs a custom JSON Marshalling.

type Stats

type Stats struct {
	// Stats about the player, keys used are BlplQuery and BlplTransaction
	Timings *stats.MultiTimings

	SecondsBehindMaster *stats.GaugesWithSingleLabel
	History             *history.History

	State sync2.AtomicString

	PhaseTimings   *stats.Timings
	QueryTimings   *stats.MultiTimings
	StreamRowCount *stats.Counter
	CopyRowCount   *stats.Counter
	CopyLoopCount  *stats.Counter
	ErrorCounts    *stats.CountersWithMultiLabels
	RelayLogLength *stats.Gauge
	EventsCount    *stats.CountersWithSingleLabel
	// contains filtered or unexported fields
}

func NewStats

func NewStats() *Stats

NewStats creates a new Stats structure.

func (*Stats) Heartbeat

func (bps *Stats) Heartbeat() int64

Heartbeat gets the time the last heartbeat from vstreamer was seen

func (*Stats) LastPosition

func (bps *Stats) LastPosition() mysql.Position

LastPosition gets the last replication position.

func (*Stats) MessageHistory

func (bps *Stats) MessageHistory() []string

MessageHistory gets all the messages, we store 3 at a time

func (*Stats) RecordHeartbeat

func (bps *Stats) RecordHeartbeat(tm int64)

RecordHeartbeat updates the time the last heartbeat from vstreamer was seen

func (*Stats) SetLastPosition

func (bps *Stats) SetLastPosition(pos mysql.Position)

SetLastPosition sets the last replication position.

type StatsHistoryRecord

type StatsHistoryRecord struct {
	Time    time.Time
	Message string
}

type Table

type Table struct {
	Name   string
	Fields []*proto.Field
}

Table contains the metadata for a table.

type TablePlan

type TablePlan struct {
	// Dbname, TargetName, SendRule will always be initialized.
	Dbname       string
	TargetName   string
	TargetDbname string

	DbTopic string
	TbTopic string

	PartitionColumnIndex []int
	ExcludeColumnMap     map[string]struct{}

	SendRule *proto.Rule
	// Lastpk will be initialized if it was specified, and
	// will be used for building the final plan after field info
	// is received.
	Lastpk *sqltypes.Result
	// BulkInsertFront, BulkInsertValues and BulkInsertOnDup are used
	// by vcopier. These three parts are combined to build bulk insert
	// statements. This is functionally equivalent to generating
	// multiple statements using the "Insert" construct, but much more
	// efficient for the copy phase.
	BulkInsertFront  *sqlparser.ParsedQuery
	BulkInsertValues *sqlparser.ParsedQuery
	BulkInsertOnDup  *sqlparser.ParsedQuery
	// Insert, Update and Delete are used by vplayer.
	// If the plan is an insertIgnore type, then Insert
	// and Update contain 'insert ignore' statements and
	// Delete is nil.
	Insert *sqlparser.ParsedQuery
	Update *sqlparser.ParsedQuery
	Delete *sqlparser.ParsedQuery
	Fields []*proto.Field
	// PKReferences is used to check if an event changed
	// a primary key column (row move).
	PKReferences []string
}

TablePlan is the execution plan for a table within a replicator. If the column names are not known at the time of plan building (like select *), then only TargetName, SendRule and Lastpk are initialized. When the stream returns the field info, those are used as column names to build the final plan. Lastpk comes from copyState. If it's set, then the generated plans are significantly different because any events that fall beyond Lastpk must be excluded. If column names were known upfront, then all fields of TablePlan are built except for Fields. This member is populated only after the field info is received from the stream. The ParsedQuery objects assume that a map of before and after values will be built based on the streaming rows. Before image values will be prefixed with a "b_", and after image values will be prefixed with a "a_". The TablePlan structure is used during all the phases of vreplication: catchup, copy, fastforward, or regular replication.

func (*TablePlan) MarshalJSON

func (tp *TablePlan) MarshalJSON() ([]byte, error)

MarshalJSON performs a custom JSON Marshalling.

type TopicMode

type TopicMode uint8
const (
	TopicModeDB TopicMode = iota
	TopicModeTb
)

Directories

Path Synopsis
cmd
dts command
vo
log
Package sqltypes implements interfaces and types that represent SQL values.
Package sqltypes implements interfaces and types that represent SQL values.
Package stats is a wrapper for expvar.
Package stats is a wrapper for expvar.
Package util ResourcePool provides functionality to manage and reuse resources like connections.
Package util ResourcePool provides functionality to manage and reuse resources like connections.
history
Package history implements a circular buffer with adjacent-item deduplication.
Package history implements a circular buffer with adjacent-item deduplication.
sync2
Package sync2 provides extra functionality along the same lines as sync.
Package sync2 provides extra functionality along the same lines as sync.
timer
Package timer provides various enhanced timer functions.
Package timer provides various enhanced timer functions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址