ticketbox

package
v0.0.0-...-693abe4 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(key string, max int64, interval int64) (int64, error)

Get 获取一张 key 的票根,参数 max 和 interval 指定了最多为该 key 在 interval 时间内发出 max 个票根。 如果超出了返回 error, 如果未超出则返回非负数的票号

Types

type Box

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

Box 表示一个票箱

func NewBox

func NewBox(max, interval int64) *Box

NewBox 创建一个新的票箱

func (*Box) Get

func (box *Box) Get() (int64, error)

Get a ticket from box

Jump to

Keyboard shortcuts

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