etag

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 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 HashReader

type HashReader struct {
	io.Reader
	// contains filtered or unexported fields
}

HashReader implements the etag.Reader interface by reading from an io.Reader and calculating the ETag with a hash.Hash.

func NewHashReader

func NewHashReader(r io.Reader, h hash.Hash) *HashReader

NewHashReader returns a new HashReader reading from r and calculating the ETag with h.

func (*HashReader) CurrentETag

func (r *HashReader) CurrentETag() []byte

CurrentETag returns the ETag for the content that has already been read from the reader.

func (*HashReader) Read

func (r *HashReader) Read(b []byte) (n int, err error)

type Reader

type Reader interface {
	io.Reader
	CurrentETag() []byte
}

Reader that calculates ETag from content.

CurrentETag returns the ETag calculated from the content that is already read.

Jump to

Keyboard shortcuts

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