logc

package
v0.0.0-...-8871cbf Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OffsetInvalid = klevdb.OffsetInvalid
	OffsetOldest  = klevdb.OffsetOldest
	OffsetNewest  = klevdb.OffsetNewest
)

Variables

View Source
var ErrNotFound = klevdb.ErrNotFound

Functions

This section is empty.

Types

type KV

type KV[K comparable, V any] interface {
	Put(k K, v V) error
	Del(k K) error

	Get(k K) (V, error)
	GetOrDefault(k K, v V) (V, error)
	GetOrInit(k K, fn func(K) (V, error)) (V, error)

	Consume(ctx context.Context, offset int64) ([]Message[K, V], int64, error)
	Snapshot() ([]Message[K, V], int64, error) // TODO this could possible return too much data

	Close() error
}

func NewKV

func NewKV[K comparable, V any](dir string) (KV[K, V], error)

type Message

type Message[K comparable, V any] struct {
	Offset int64
	Key    K
	Value  V
	Delete bool
}

Jump to

Keyboard shortcuts

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