keys

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Unlicense Imports: 3 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 by, elems ...Element)

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

func Write

func Write(elems ...Element) by

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() no
}

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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