gidgen

package
v2021.513.1742+incompa... Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

ID生成器. 内部采用了通道+缓冲池来实现高效的ID递增生成, 非常适合高并发下使用

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gen

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

ID生成器管理对象

func New

func New(bufsize int) *Gen

创建一个ID生成器,并给定ID池大小

func (*Gen) Int

func (g *Gen) Int() int

从池中获取一个ID返回(int)

func (*Gen) Uint

func (g *Gen) Uint() uint

从池中获取一个ID返回(uint)

Jump to

Keyboard shortcuts

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