io

package
v0.0.0-...-5860612 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader interface {
	// Read reads the given bytes and returns the number of bytes read.
	Read([]byte) (int, error)

	// SHA256Hash returns the SHA256 hash of what's read.
	SHA256Hash() hash.Hash

	// N is a record of the total number of bytes read so far.
	N() int64
}

Reader describes a reader with a record of the number of bytes and a sha256 hash of what's read.

func NewReader

func NewReader(r io.Reader) Reader

NewReader creates a new Reader

type ReaderWithContext

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

ReaderWithContext provides an implementation of Reader.

func (*ReaderWithContext) N

func (r *ReaderWithContext) N() int64

N returns the total number of bytes read.

func (*ReaderWithContext) Read

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

Read reads the given bytes

func (*ReaderWithContext) SHA256Hash

func (r *ReaderWithContext) SHA256Hash() hash.Hash

SHA256Hash returns the SHA256 hash of the bytes read.

Jump to

Keyboard shortcuts

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