io

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 2 Imported by: 1

README

Package io v1.1.1

This package aims at proposing a customizable io.Copy method. It introduces the Copier struct.

Usage

Constructor:

NewCopier(...CopierOpt)

List of Options:

  • WithBufferSize(int64)
  • WithNoDiskCacheRead
  • WithNoDiskCacheWrite
  • WithNoDiskCache (helper wrapping the two above)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithNoDiskCache

func WithNoDiskCache(c *Copier)

func WithNoDiskCacheRead

func WithNoDiskCacheRead(c *Copier)

func WithNoDiskCacheWrite

func WithNoDiskCacheWrite(c *Copier)

Types

type Copier

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

func NewCopier

func NewCopier(opts ...CopierOpt) Copier

func (Copier) Copy

func (c Copier) Copy(dst io.Writer, src io.Reader) (int64, error)

copyContent is highly inspired from io.Copy, but calls to fadvise have been added to prevent caching the whole content of the files during the process, impacting the whole OS disk cache

type CopierOpt

type CopierOpt func(c *Copier)

func WithBufferSize

func WithBufferSize(s int64) CopierOpt

type Fder

type Fder interface {
	Fd() uintptr
}

Jump to

Keyboard shortcuts

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