counter

package
v0.0.0-...-4d2ef29 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter interface {
	Destroy() error

	Pops(int) (value.Array, error) // 根据计数弹出值

	Set(value.Value) error // 如果不存在则设为1, 存在则什么也不错
	Del(value.Value) error
	Get(value.Value) (int, error)

	Inc(value.Value) error              // 如果不存在则设为1,存在则加1
	Dec(value.Value) (bool, error)      // 如果存在则减1并返回true,不存在则返回false
	IncAndGet(value.Value) (int, error) // +1并且返回原值
	DecAndGet(value.Value) (int, error) // -1并且返回原值
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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