pipeline

package
v0.6.10 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package pipeline provides functionality for hashing pipelines needed to create different flavors of merkelised representations

of arbitrary data. The interface exposes an io.Writer and Sum method, for components to use as a black box. Within a pipeline, writers are chainable. It is up for the implementer to decide whether a writer calls the next writer. Implementers should always implement the Sum method and call the next writer's Sum method (in case there is one), returning its result to the calling context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainWriter

type ChainWriter interface {
	ChainWrite(*PipeWriteArgs) error
	Sum() ([]byte, error)
}

ChainWriter is a writer in a pipeline. It is up to the implementer to decide whether a writer calls the next writer or not. Implementers should call the Sum method of the subsequent writer in case there exists one.

type Interface

type Interface interface {
	io.Writer
	Sum() ([]byte, error)
}

Interface exposes an `io.Writer` and `Sum` method, for components to use as a black box. Within a pipeline, writers are chainable. It is up for the implementer to decide whether a writer calls the next writer. Implementers should always implement the `Sum` method and call the next writer's `Sum` method (in case there is one), returning its result to the calling context.

type PipeWriteArgs

type PipeWriteArgs struct {
	Ref  []byte // reference, generated by bmt
	Key  []byte // encryption key
	Span []byte // always unecrypted span uint64
	Data []byte // data includes the span too, but it may be encrypted when the pipeline is encrypted
}

PipeWriteArgs are passed between different ChainWriters.

type PipelineFunc

type PipelineFunc func() ChainWriter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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