kubernetes: k8s.io/kubernetes/pkg/kubelet/util/ioutils Index | Files

package ioutils

import "k8s.io/kubernetes/pkg/kubelet/util/ioutils"


Package Files


func LimitWriter Uses

func LimitWriter(w io.Writer, n int64) io.Writer

LimitWriter is a copy of the standard library ioutils.LimitReader, applied to the writer interface. LimitWriter returns a Writer that writes to w but stops with EOF after n bytes. The underlying implementation is a *LimitedWriter.

func WriteCloserWrapper Uses

func WriteCloserWrapper(w io.Writer) io.WriteCloser

WriteCloserWrapper returns a writeCloserWrapper.

type LimitedWriter Uses

type LimitedWriter struct {
    W   io.Writer // underlying writer
    N   int64     // max bytes remaining

A LimitedWriter writes to W but limits the amount of data returned to just N bytes. Each call to Write updates N to reflect the new amount remaining. Write returns EOF when N <= 0 or when the underlying W returns EOF.

func (*LimitedWriter) Write Uses

func (l *LimitedWriter) Write(p []byte) (n int, err error)

Package ioutils imports 1 packages (graph) and is imported by 184 packages. Updated 2019-09-15. Refresh now. Tools for package owners.