spywrite

package
v0.1.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package spywrite provides various I/O implementations with known errors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FailWriter

type FailWriter struct{}

FailWriter is an io.Writer that always returns an error.

func (FailWriter) Write

func (w FailWriter) Write(b []byte) (int, error)

Write implements io.Writer.

type Flusher

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

A Flusher is a spy for the Flush portion of zap.WriteFlusher.

func (*Flusher) Called

func (f *Flusher) Called() bool

Called reports whether the Flush method was called.

func (*Flusher) Flush

func (f *Flusher) Flush() error

Flush records that it was called, then returns the user-supplied error (if any).

func (*Flusher) SetError

func (f *Flusher) SetError(err error)

SetError sets the error that the Flush method will return.

type ShortWriter

type ShortWriter struct{}

ShortWriter is an io.Writer that never returns an error, but doesn't write the last byte of the input.

func (ShortWriter) Write

func (w ShortWriter) Write(b []byte) (int, error)

Write implements io.Writer.

type Syncer

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

A Syncer is a spy for the Sync portion of zap.WriteSyncer.

func (*Syncer) Called

func (s *Syncer) Called() bool

Called reports whether the Sync method was called.

func (*Syncer) SetError

func (s *Syncer) SetError(err error)

SetError sets the error that the Sync method will return.

func (*Syncer) Sync

func (s *Syncer) Sync() error

Sync records that it was called, then returns the user-supplied error (if any).

type WriteFlushSyncer

type WriteFlushSyncer struct {
	io.Writer
	Syncer
	Flusher
}

A WriteFlushSyncer implements both zap.WriteFlusher and zap.WriteSyncer.

type WriteFlusher

type WriteFlusher struct {
	io.Writer
	Flusher
}

WriteFlusher is a concrete type that implements zap.WriteFlusher.

type WriteSyncer

type WriteSyncer struct {
	io.Writer
	Syncer
}

WriteSyncer is a concrete type that implements zap.WriteSyncer.

Jump to

Keyboard shortcuts

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