kouchio

package
v0.0.0-...-1bf7cb7 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package kouchio provides basic I/O primitives meant to suppliment the standard library's io package. kouchio should have no dependencies other than the Go standard library, to avoid import loops.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseWriter

func CloseWriter(w io.Writer) error

CloseWriter closes w if it is an io.WriteCloser; else it does nothing

func Underlying

func Underlying(w io.Writer) io.Writer

Underlying returns the unwrapped io.Writer, or the original if it was not wrapped.

Types

type OutputMode

type OutputMode interface {
	// AddFlags adds flags for the passed command, at start-up
	AddFlags(*pflag.FlagSet)
	// New takes flags, after command line options have been parsed, and returns
	// a new output processor.
	New(context.Context, io.Writer) (io.Writer, error)
}

OutputMode is the common interface for all output modes.

type WrappedWriter

type WrappedWriter interface {
	// Underlying returns the original, unwrapped, io.WriteCloser.
	Underlying() io.Writer
}

WrappedWriter represents an io.Writerr wrapped by some logic.

Jump to

Keyboard shortcuts

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