internal

package
v1.13.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Putter added in v0.2.0

type Putter interface {
	Put(context.Context, swarm.Chunk) ([]bool, error)
}

type SimpleSplitterJob

type SimpleSplitterJob struct {
	// contains filtered or unexported fields
}

SimpleSplitterJob encapsulated a single splitter operation, accepting blockwise writes of data whose length is defined in advance.

After the job is constructed, Write must be called with up to ChunkSize byte slices until the full data length has been written. The Sum should be called which will return the SwarmHash of the data.

Called Sum before the last Write, or Write after Sum has been called, may result in error and will may result in undefined result.

func NewSimpleSplitterJob

func NewSimpleSplitterJob(ctx context.Context, putter Putter, spanLength int64, toEncrypt bool) *SimpleSplitterJob

NewSimpleSplitterJob creates a new SimpleSplitterJob.

The spanLength is the length of the data that will be written.

func (*SimpleSplitterJob) Sum

func (j *SimpleSplitterJob) Sum(b []byte) []byte

Sum returns the Swarm hash of the data.

func (*SimpleSplitterJob) Write

func (j *SimpleSplitterJob) Write(b []byte) (int, error)

Write adds data to the file splitter.

Jump to

Keyboard shortcuts

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