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 ¶
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