history

package
v0.0.0-...-de9bd37 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultCapacity = 16

DefaultCapacity 默认容量

Variables

This section is empty.

Functions

This section is empty.

Types

type History

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

History 历史记录

func NewHistory

func NewHistory() *History

NewHistory 创建记录

func (*History) Back

func (r *History) Back() (*types.Update, error)

Back 最后元素

func (*History) Clear

func (r *History) Clear() *History

Clear 清空历史

func (*History) Empty

func (r *History) Empty() bool

Empty 是否为空

func (*History) Foreach

func (r *History) Foreach(callback func(int, *types.Update) bool)

Foreach 遍历数据

func (*History) LastCallbackQuery

func (r *History) LastCallbackQuery() (*types.CallbackQuery, error)

LastCallbackQuery 最后的查询回调

func (*History) Pop

func (r *History) Pop() *History

Pop 擦除数据

func (*History) Push

func (r *History) Push(update *types.Update) *History

Push 插入数据

type Manager

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

Manager 记录管理器

func NewManager

func NewManager(bucketNum uint32) (*Manager, error)

NewManager 创建记录管理器

func (*Manager) Del

func (m *Manager) Del(userID uint32)

Del 删除记录

func (*Manager) Get

func (m *Manager) Get(userID uint32) (*History, error)

Get 获取记录

Jump to

Keyboard shortcuts

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