mimedropreader

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 3 Imported by: 0

README

MIME Drop reader

Reader, which returns error, if read content does not match one of allowed MIME types.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMIMENotAllowed = errors.New("MIME not allowed")

Functions

This section is empty.

Types

type ReadCloser

type ReadCloser struct {
	*Reader
}

func NewReadCloser

func NewReadCloser(r io.Reader, mime1 string, mimeN ...string) *ReadCloser

func (*ReadCloser) Close

func (rc *ReadCloser) Close() error

type Reader

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

func New

func New(r io.Reader, mime1 string, mimeN ...string) *Reader

func (*Reader) MIME

func (r *Reader) MIME() *mimetype.MIME

func (*Reader) Read

func (r *Reader) Read(p []byte) (int, error)

func (*Reader) Unwrap

func (r *Reader) Unwrap() io.Reader

Jump to

Keyboard shortcuts

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