api

package
v0.0.0-...-cf97775 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Overview

Package api contains the "public" API/artifacts of the serverless log.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TileNodeKey

func TileNodeKey(level uint, index uint64) uint

TileNodeKey generates keys used in Tile.Nodes array.

Types

type Tile

type Tile struct {
	// NumLeaves is the number of entries at level 0 of this tile.
	NumLeaves uint

	// Nodes stores the log tree nodes.
	// Nodes are stored linearised using in-order traversal - this isn't completely optimal
	// in terms of storage for partial tiles, but index calculation is relatively
	// straight-forward.
	// Note that only non-ephemeral nodes are stored.
	Nodes [][]byte
}

Tile represents a subtree tile, containing inner nodes of a log tree.

func (Tile) MarshalText

func (t Tile) MarshalText() ([]byte, error)

MarshalText implements encoding/TextMarshaller and writes out a Tile instance in the following format:

<hash size in decimal>\n <num tile leaves in decimal>\n <Nodes[0] base64 encoded>\n ... <Nodes[n] base64 encoded>\n

func (*Tile) UnmarshalText

func (t *Tile) UnmarshalText(raw []byte) error

UnmarshalText implements encoding/TextUnmarshaler and reads tiles which were written by the MarshalText method above.

Directories

Path Synopsis
Package layout contains routines for specifying the on-disk layout of the stored log.
Package layout contains routines for specifying the on-disk layout of the stored log.

Jump to

Keyboard shortcuts

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