groupdb3

package
v0.0.0-...-060dca9 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Still subject to breaking changes.

Index

Constants

This section is empty.

Variables

View Source
var EMissingTable = errors.New("Missing Table")
View Source
var EUnimplemented = errors.New("EUnimplemented")

Functions

func TKComparator

func TKComparator(a, b interface{}) int

Types

type DB

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

func NewDB

func NewDB(b *bolt.DB, name []byte) *DB

func (*DB) ArticleGroupMove

func (db *DB) ArticleGroupMove(group []byte, i int64, backward bool, id_buf []byte) (ni int64, id []byte, ok bool)

func (*DB) ArticleGroupStat

func (db *DB) ArticleGroupStat(group []byte, num int64, id_buf []byte) (id []byte, ok bool)

func (*DB) AssignArticleToGroup

func (db *DB) AssignArticleToGroup(group []byte, num, exp uint64, id []byte) error

Newly introduced.

func (*DB) AssignArticleToGroups

func (db *DB) AssignArticleToGroups(groups [][]byte, nums []int64, exp uint64, id []byte) error

func (*DB) GroupHeadInsert

func (db *DB) GroupHeadInsert(groups [][]byte, buf []int64) (nums []int64, err error)

func (*DB) GroupHeadRevert

func (db *DB) GroupHeadRevert(groups [][]byte, nums []int64) error

func (*DB) GroupRealtimeQuery

func (db *DB) GroupRealtimeQuery(group []byte) (number int64, low int64, high int64, ok bool)

func (*DB) ListArticleGroupRaw

func (db *DB) ListArticleGroupRaw(group []byte, first, last int64, targ func(int64, []byte))

type GroupStats

type GroupStats struct {
	Count, Low, High int64
}

type ListGroupStats

type ListGroupStats []GroupStats

func (ListGroupStats) Cuts

func (l ListGroupStats) Cuts(begin, end int64) bool

type LogDB

type LogDB struct {
	DB
	// contains filtered or unexported fields
}

func OpenLogDB

func OpenLogDB(path string) (*LogDB, error)

func (*LogDB) AssignArticleToGroup

func (l *LogDB) AssignArticleToGroup(group []byte, num, exp uint64, id []byte) error

func (*LogDB) AssignArticleToGroups

func (l *LogDB) AssignArticleToGroups(groups [][]byte, nums []int64, exp uint64, id []byte) error

func (*LogDB) FlushLog

func (l *LogDB) FlushLog() error

func (*LogDB) Worker

func (l *LogDB) Worker(treshold int64)

type TableKey

type TableKey struct {
	Group  []byte
	Number uint64
	// contains filtered or unexported fields
}

type TableRow

type TableRow struct {
	TableKey
	Expires   uint64
	MessageId []byte
	// contains filtered or unexported fields
}

type Tx

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

func MakeTx

func MakeTx(bkt *bolt.Bucket) *Tx

func (Tx) ArticleGroupMove

func (t Tx) ArticleGroupMove(group []byte, i int64, backward bool, id_buf []byte) (ni int64, id []byte, ok bool)

func (Tx) ArticleGroupStat

func (t Tx) ArticleGroupStat(group []byte, num int64, id_buf []byte) ([]byte, bool)

func (Tx) AssignArticleToGroup

func (t Tx) AssignArticleToGroup(group []byte, num, exp uint64, id []byte) error

func (Tx) AssignArticleToGroups

func (t Tx) AssignArticleToGroups(groups [][]byte, nums []int64, exp uint64, id []byte) error

func (Tx) GroupHeadInsert

func (t Tx) GroupHeadInsert(groups [][]byte, buf []int64) ([]int64, error)

func (Tx) GroupHeadRevert

func (t Tx) GroupHeadRevert(groups [][]byte, nums []int64) error

func (Tx) GroupRealtimeQuery

func (t Tx) GroupRealtimeQuery(group []byte) (number int64, low int64, high int64, ok bool)

func (Tx) ListArticleGroupRaw

func (t Tx) ListArticleGroupRaw(group []byte, first, last int64, targ func(int64, []byte))

Jump to

Keyboard shortcuts

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