iterator

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 2 Imported by: 1

README

iterator

Go语言序号生成器

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Func

type Func func() int64

func Get

func Get() Func

Get 获取一个迭代器

type Iter

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

func New

func New() *Iter

func (*Iter) Offset

func (it *Iter) Offset(x int64) Iterator

func (*Iter) Start

func (it *Iter) Start(x int64) Iterator

func (*Iter) Step

func (it *Iter) Step(x int64) Iterator

func (*Iter) Value

func (it *Iter) Value() int64

type Iterator

type Iterator interface {
	Start(x int64) Iterator  // 起始位置
	Step(x int64) Iterator   // 单次累增长度
	Offset(x int64) Iterator // 设置偏移量
	Value() int64            // 获取当前最新分配值
}

Jump to

Keyboard shortcuts

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