filestream

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: Apache-2.0 Imports: 7 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReadCloser

type ReadCloser interface {
	Read(p []byte) (int, error)
	MustClose()
}

ReadCloser is a standard interface for filestream Reader.

type Reader

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

Reader implements buffered file reader.

func Open

func Open(path string, nocache bool) (*Reader, error)

Open opens the file from the given path in nocache mode.

If nocache is set, then the reader doesn't pollute OS page cache.

func (*Reader) MustClose

func (r *Reader) MustClose()

MustClose closes the underlying file passed to Open.

func (*Reader) Read

func (r *Reader) Read(p []byte) (int, error)

Read reads file contents to p.

type WriteCloser

type WriteCloser interface {
	Write(p []byte) (int, error)
	MustClose()
}

WriteCloser is a standard interface for filestream Writer.

type Writer

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

Writer implements buffered file writer.

func Create

func Create(path string, nocache bool) (*Writer, error)

Create creates the file for the given path in nocache mode.

If nocache is set, the writer doesn't pollute OS page cache.

func (*Writer) MustClose

func (w *Writer) MustClose()

MustClose syncs the underlying file to storage and then closes it.

func (*Writer) Write

func (w *Writer) Write(p []byte) (int, error)

Write writes p to the underlying file.

Jump to

Keyboard shortcuts

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