zio

package
v0.0.0-...-9840c0c Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package zio implements some I/O utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangedFrom

func ChangedFrom(file, base string) bool

Newer reports if the file's mtime is more recent than base.

func DumpReader

func DumpReader(b io.ReadCloser) (r1, r2 io.ReadCloser, err error)

DumpReader reads all of b to memory and then returns two equivalent ReadClosers which will yield the same bytes.

This is useful if you want to read data from an io.Reader more than once.

It returns an error if the initial reading of all bytes fails. It does not attempt to make the returned ReadClosers have identical error-matching behavior.

This is based on httputil.DumpRequest, see zio.DumpBody() for an example usage.

Copyright 2009 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file: https://golang.org/LICENSE

func Exists

func Exists(path string) bool

Exists reports if a path exists.

func NopCloser

func NopCloser(r io.Writer) io.WriteCloser

NopCloser returns a WriteCloser with a no-op Close method.

Types

type NopWriter

type NopWriter struct{}

NopWriter is an io.Writer that does nothing.

func (*NopWriter) Write

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

Write is a stub.

Jump to

Keyboard shortcuts

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