intervals

package
v0.0.0-...-39cdb81 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Intervals

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

间隔存储间隔列表。其目的是提供 方法添加新间隔并检索 需要添加。 它可以用于流数据的同步以保持 已检索到会话之间的数据范围。

func NewIntervals

func NewIntervals(start uint64) *Intervals

新建创建间隔的新实例。 start参数限制间隔的下限。 添加方法或将不添加以下开始绑定的范围 由下一个方法返回。此限制可用于 跟踪“实时”同步,其中同步会话 从特定值开始,如果“实时”同步间隔 需要与历史相结合,才能安全地完成。

func (*Intervals) Add

func (i *Intervals) Add(start, end uint64)

添加将新范围添加到间隔。范围开始和结束都是值 都是包容性的。

func (*Intervals) Last

func (i *Intervals) Last() (end uint64)

Last返回最后一个间隔结束时的值。

func (*Intervals) MarshalBinary

func (i *Intervals) MarshalBinary() (data []byte, err error)

marshalbinary将间隔参数编码为分号分隔列表。 列表中的第一个元素是base36编码的起始值。以下 元素是由逗号分隔的两个base36编码值范围。

func (*Intervals) Merge

func (i *Intervals) Merge(m *Intervals)

合并将m间隔中的所有间隔添加到当前间隔。

func (*Intervals) Next

func (i *Intervals) Next() (start, end uint64)

Next返回未完成的第一个范围间隔。返回 起始值和结束值都包含在内,这意味着整个范围 包括开始和结束需要增加,以填补差距 每隔一段时间。 如果下一个间隔在整数之后,则end的返回值为0 以间隔存储的范围。零结束值表示无限制 在下一个间隔长度。

func (*Intervals) String

func (i *Intervals) String() string

字符串返回范围间隔的描述性表示形式 以[]表示法,作为两个元素向量的列表。

func (*Intervals) UnmarshalBinary

func (i *Intervals) UnmarshalBinary(data []byte) (err error)

unmarshalbinary根据interval.marshalbinary格式解码数据。

Jump to

Keyboard shortcuts

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