handlers

package
v3.23.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleFile

func HandleFile(ctx context.Context, file io.Reader, chunkSkel *sources.Chunk, chunksChan chan (*sources.Chunk)) bool

Types

type Archive

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

Archive is a handler for extracting and decompressing archives.

func (*Archive) FromFile

func (d *Archive) FromFile(data io.Reader) chan ([]byte)

FromFile extracts the files from an archive.

func (*Archive) IsFiletype

func (d *Archive) IsFiletype(reader io.Reader) (io.Reader, bool)

IsFiletype returns true if the provided reader is an archive.

func (*Archive) New

func (d *Archive) New()

New sets a default maximum size and current size counter.

func (*Archive) ReadToMax

func (d *Archive) ReadToMax(reader io.Reader) (data []byte, err error)

ReadToMax reads up to the max size.

type Handler

type Handler interface {
	FromFile(io.Reader) chan ([]byte)
	IsFiletype(io.Reader) (io.Reader, bool)
	New()
}

func DefaultHandlers

func DefaultHandlers() []Handler

Jump to

Keyboard shortcuts

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