cacheCount

package
v2.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Count

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

func NewCount added in v2.1.0

func NewCount(key string, c *redis.Client, expireTime time.Duration) *Count

func (*Count) Add

func (p *Count) Add() (int64, error)

add

func (*Count) Destroy

func (p *Count) Destroy()

del

func (*Count) Get

func (p *Count) Get() (int, error)

get

func (*Count) GetExpireTime

func (p *Count) GetExpireTime() time.Duration

get

func (*Count) Set

func (p *Count) Set(s int) error

set

type Counter added in v2.1.0

type Counter struct {
	*Count
	// contains filtered or unexported fields
}

Counter

func NewCounter added in v2.1.0

func NewCounter(max int, count *Count) *Counter

func (*Counter) AddCount added in v2.1.0

func (c *Counter) AddCount() bool

增加一个次数,并且返回增加次数后是否频繁

func (*Counter) Destroy added in v2.1.0

func (c *Counter) Destroy()

删除

func (*Counter) IsBusy added in v2.1.0

func (c *Counter) IsBusy() bool

是否频繁

Jump to

Keyboard shortcuts

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