drip

package
v0.0.0-...-189a019 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ValidateFunc

type ValidateFunc func(data []byte) error

type Writer

type Writer struct {
	Buffer   []byte
	Writer   io.Writer
	Validate ValidateFunc
	// contains filtered or unexported fields
}

A Writer accepts Write()s of any size, buffers them, and relays only Writes of len(Buffer) to the underlying writer, calling Validate first if it's non-nil. The last Write might be < len(Buffer). The Writer must be closed, otherwise the last <= len(Buffer) bytes will be lost.

func (*Writer) Close

func (dw *Writer) Close() (err error)

Close acts as Flush + Close the underlying Writer, if it implements io.Closer

func (*Writer) Write

func (dw *Writer) Write(data []byte) (int, error)

Jump to

Keyboard shortcuts

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