fs

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2016 License: MIT Imports: 4 Imported by: 309

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS interface {
	Stat(path string) (os.FileInfo, error)
	Open(path string) (ReadSeekCloser, error)
	ReadDir(path string) ([]os.FileInfo, error)
	Join(elem ...string) string
}

FS interface represent an abstracted filesystem, so you can use NewRepositoryFromFS from any medium.

func NewOS

func NewOS() FS

NewOS returns a new OS.

type OS

type OS struct{}

OS is a simple FS implementation for the current host filesystem.

func (*OS) Join

func (o *OS) Join(elem ...string) string

Join joins the specified elements using the filesystem separator.

func (*OS) Open

func (o *OS) Open(path string) (ReadSeekCloser, error)

Open returns a ReadSeekCloser for the specified path.

func (*OS) ReadDir

func (o *OS) ReadDir(path string) ([]os.FileInfo, error)

ReadDir returns the filesystem info for all the archives under the specified path.

func (*OS) Stat

func (o *OS) Stat(path string) (os.FileInfo, error)

Stat returns the filesystem info for a path.

type ReadSeekCloser

type ReadSeekCloser interface {
	io.ReadCloser
	io.Seeker
}

ReadSeekCloser is a Reader, Seeker and Closer.

Jump to

Keyboard shortcuts

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