keys

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: GPL-2.0, MIT Imports: 1 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 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 interface 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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