file

package
v0.0.0-...-3976360 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File interface {
	io.Reader
	io.Writer
	io.Seeker
	io.Closer
	io.ReaderAt
	Truncate(size int64) error
	Sync() error
}

type FileSystem

type FileSystem interface {
	// Open opens a file using specified flag.
	Open(name string, flag int) (File, error)

	// Lock locks a file for exclusive usage. If the file is locked by
	// someone else, failed with an error instead of blocking.
	Lock(name string) (io.Closer, error)

	// Exists returns true if the named file exists.
	Exists(name string) bool

	// MkdirAll creates a directory and all necessary parents.
	MkdirAll(path string) error

	// Lists returns all contents of the directory.
	List(dir string) ([]string, error)

	// Remove removes named file or directory.
	Remove(filename string) error

	// Rename renames(moves) oldpath to newpath. If newpath already exists,
	// Rename replaces it.
	Rename(oldpath, newpath string) error
}

FileSystem defines methods for hierarchical file storage.

var DefaultFileSystem FileSystem = osFileSystem{}

type ReadCloser

type ReadCloser interface {
	Reader
	io.Closer
}

type Reader

type Reader interface {
	io.Reader
	io.ReaderAt
	io.Seeker
}

type WriteCloser

type WriteCloser interface {
	Writer
	io.Closer
}

type Writer

type Writer interface {
	io.Writer
	io.Seeker
	Truncate(size int64) error
	Sync() error
}

Jump to

Keyboard shortcuts

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