badger

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT, Unlicense Imports: 19 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Path     string
	MaxLimit int
	*badger.DB
	// contains filtered or unexported fields
}

func (*Backend) Close

func (b *Backend) Close()

func (*Backend) CountEvents

func (b *Backend) CountEvents(c context.T, f *filter.T) (int64, error)

func (*Backend) DeleteEvent

func (b *Backend) DeleteEvent(c context.T, evt *event.T) (err error)

func (*Backend) Init

func (b *Backend) Init(inf *relayinfo.T, params ...string) (err error)

func (*Backend) QueryEvents

func (b *Backend) QueryEvents(c context.T, ch chan *event.T, f *filter.T) error

func (*Backend) SaveEvent

func (b *Backend) SaveEvent(c context.T, evt *event.T) (err error)

func (*Backend) Serial

func (b *Backend) Serial() []byte

type PriorityQueue

type PriorityQueue struct {
	Queries
}

func NewPriorityQueue

func NewPriorityQueue(l int) *PriorityQueue

func (*PriorityQueue) Len

func (pq *PriorityQueue) Len() int

func (*PriorityQueue) Less

func (pq *PriorityQueue) Less(i, j int) bool

Less returns whether event i is newer (greater) than event j, reverse chronological order, the first result will be the newest.

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() any

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(x any)

func (*PriorityQueue) Swap

func (pq *PriorityQueue) Swap(i, j int)

type Queries

type Queries []*queryEvent

Jump to

Keyboard shortcuts

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