slicer

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxSize = 0
View Source
const DefaultMinSize = 0
View Source
const DefaultMinimumSize = (DefaultSlices + 2) * DefaultSliceSize
View Source
const DefaultSliceSize = 8 * 1024
View Source
const DefaultSlices = 4
View Source
const DefaultThreshold = 100 * 1024
View Source
const MaxReadBytes = 1024
View Source
const MaxSlices = 128

Variables

This section is empty.

Functions

This section is empty.

Types

type MetaSlice

type MetaSlice struct {
	Size uint64
}

type Options added in v0.0.7

type Options struct {
	MinSize         uint64
	MaxSize         uint64
	DisableSlicing  bool
	DisableMeta     bool
	DisableAutoText bool
}

type Slicer

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

func New

func New(algorithm algorithms.Algorithm) Slicer

func NewConfigured

func NewConfigured(algorithm algorithms.Algorithm, slices int, size, threshold uint64) Slicer

func (*Slicer) Slice

func (slicer *Slicer) Slice(sr *io.SectionReader, options *Options, stats *SlicerStats) error

func (*Slicer) SliceFS

func (slicer *Slicer) SliceFS(fileSystem fs.FS, name string, options *Options) (SlicerStats, error)

type SlicerStats

type SlicerStats struct {
	SliceOffsets   map[int]int64
	Filename       string
	Hash           []byte
	ReaderSize     int64
	SliceOffset    int64
	MidSize        uint64
	SliceSize      uint64
	FileSize       uint64
	Slices         int
	EmptyFile      bool
	IgnoredFile    bool
	HashedFullFile bool
}

Jump to

Keyboard shortcuts

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