recorder

package
v0.0.0-...-422bbaa Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Recorder

type Recorder interface {
	Save(data uint64)      //Save id to recorder.		保存id到记录器
	Load() (uint64, error) //Load id from recorder.		从记录器加载id
	IsClose() bool         //Get closed status.			获取关闭状态
	Close()                //Turn off the recorder.		关闭记录器
}

Recorder 记录器接口

type RedisRecorder

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

RedisRecorder Use redis to record id. 使用redis记录id

func NewRedisRecorder

func NewRedisRecorder(client *redis.Client, key string, auto2save time.Duration) *RedisRecorder

NewRedisRecorder Get the recorder. 获取记录器

func (*RedisRecorder) Close

func (this *RedisRecorder) Close()

Turn off the recorder. 关闭记录器

func (*RedisRecorder) IsClose

func (this *RedisRecorder) IsClose() bool

Get closed status. 获取关闭状态

func (*RedisRecorder) Load

func (this *RedisRecorder) Load() (uint64, error)

Load id from recorder. 从记录器加载id

func (*RedisRecorder) Save

func (this *RedisRecorder) Save(data uint64)

Save id to recorder. 保存id到记录器

Jump to

Keyboard shortcuts

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