file

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2019 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 FileAccess

type FileAccess interface {
	Read(path string) ([]byte, error)
	ReadAndTag(path string) (*TaggedBytes, error)
	Write(path string, content []byte, perms os.FileMode) error
	TempDir(dir string, prefix string) (string, error)
	RemoveAll(dir string) error
	ResolveRelativeTo(targetFile string, sourceFile string) (string, error)
	ResolveRelativeFrom(targetFile string, sourceFile string) (string, error)
	ResolveRelativeFromWD(targetFile string) (string, error)
	GetWorkingDirectory() (string, error)
	IsDir(path string) (bool, error)
	Walk(path string, callback func(path string, info os.FileInfo, err error) error) error
	MkDir(path string) error
}

type FileIO

type FileIO struct{}

func (*FileIO) GetWorkingDirectory added in v1.0.3

func (f *FileIO) GetWorkingDirectory() (string, error)

func (*FileIO) IsDir added in v1.0.4

func (f *FileIO) IsDir(path string) (bool, error)

func (*FileIO) MkDir added in v1.0.7

func (f *FileIO) MkDir(path string) error

func (*FileIO) Read

func (f *FileIO) Read(path string) ([]byte, error)

func (*FileIO) ReadAndTag added in v1.0.2

func (f *FileIO) ReadAndTag(path string) (*TaggedBytes, error)

func (*FileIO) RemoveAll

func (f *FileIO) RemoveAll(dir string) error

func (*FileIO) ResolveRelativeFrom added in v1.0.3

func (f *FileIO) ResolveRelativeFrom(targetFile string, sourceFile string) (string, error)

func (*FileIO) ResolveRelativeFromWD added in v1.0.3

func (f *FileIO) ResolveRelativeFromWD(targetFile string) (string, error)

func (*FileIO) ResolveRelativeTo

func (f *FileIO) ResolveRelativeTo(targetFile string, sourceFile string) (string, error)

func (*FileIO) TempDir

func (f *FileIO) TempDir(dir string, prefix string) (string, error)

func (*FileIO) Walk added in v1.0.4

func (f *FileIO) Walk(path string, callback func(path string, info os.FileInfo, err error) error) error

func (*FileIO) Write

func (f *FileIO) Write(path string, content []byte, perms os.FileMode) error

type TaggedBytes added in v1.0.2

type TaggedBytes struct {
	Bytes []byte
	Tag   string
}

Jump to

Keyboard shortcuts

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