filesystem

package
v0.0.0-...-5bca223 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_FILE_PERMISSIONS = 0644

Variables

View Source
var (
	ErrIsDir  = errors.New("is a directory")
	ErrIsFile = errors.New("is a file")
)

Functions

This section is empty.

Types

type File

type File struct {
	Content  string
	Metadata Metadata
	FileInfo os.FileInfo
}

type Filesystem

type Filesystem struct {
	Filesystem         billy.Filesystem
	Error              error
	FilePermissionMode os.FileMode
	ChrootDirectory    string
}

func New

func New(options ...Option) *Filesystem

func (*Filesystem) Get

func (fs *Filesystem) Get(path string) (*File, error)

func (*Filesystem) Has

func (fs *Filesystem) Has(path string) (bool, error)

func (*Filesystem) List

func (fs *Filesystem) List(path string) ([]os.FileInfo, error)

func (*Filesystem) Save

func (fs *Filesystem) Save(path string, file File) error

func (*Filesystem) Stat

func (fs *Filesystem) Stat(path string) (os.FileInfo, error)

type Metadata

type Metadata struct {
	Permissions map[string][]string `json:"permissions"`
}

type Option

type Option func(*Filesystem) error

func WithChroot

func WithChroot(chrootDir string) Option

Jump to

Keyboard shortcuts

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