index

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: May 14, 2025 License: Unlicense Imports: 4 Imported by: 0

Documentation

Overview

Package index implements the single byte prefix of the database keys. This means a limit of 256 tables but is plenty for a single purpose nostr event store.

Index

Constants

View Source
const Len = 1

Variables

This section is empty.

Functions

func GetAsBytes

func GetAsBytes(prf ...P) (b [][]byte)

GetAsBytes todo wat is dis?

Types

type P

type P byte

func (P) B

func (p P) B() byte

B returns the index.P as a byte.

func (P) I

func (p P) I() int

I returns the index.P as an int (for use with the KeySizes.

func (P) Key

func (p P) Key(element ...keys.Element) (b []byte)

Key writes a key with the P prefix byte and an arbitrary list of keys.Element.

type T

type T struct {
	Val []byte
}

func Empty

func Empty() (p *T)

func New

func New[V byte | P | int](code ...V) (p *T)

func (*T) Len

func (p *T) Len() int

func (*T) Read

func (p *T) Read(buf io.Reader) (el keys.Element)

func (*T) Write

func (p *T) Write(buf io.Writer)

Jump to

Keyboard shortcuts

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