keys

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: CC0-1.0 Imports: 2 Imported by: 0

Documentation

Overview

Package keys is a composable framework for constructing badger keys from fields of events.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(b []byte, elems ...Element)

Read the contents of a byte slice into the provided list of Element types.

func Write

func Write(elems ...Element) []byte

Write the contents of each Element to a byte slice.

Types

type B

type B = []byte

type E

type E = error

type Element

type Element interface {
	// Write the binary form of the field into the given bytes.Buffer.
	Write(buf *bytes.Buffer)
	// Read accepts a bytes.Buffer and decodes a field from it.
	Read(buf *bytes.Buffer) Element
	// Len gives the length of the bytes output by the type.
	Len() int
}

Element is an enveloper for a type that can Read and Write its binary form.

func Make

func Make(elems ...Element) []Element

Make is a convenience method to wrap a list of Element into a slice.

type N added in v0.0.14

type N = int

type S

type S = string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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