files

package
v0.0.0-...-f9467f3 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileDir

type FileDir interface {
	Describe() string
	DescribeSelf() string
	PlainName() string
	TabcompleteName() string
	TryCD() (error, *FilesystemDir)
	TryCat() (error, string)
	Path() string
}

type FilesystemConfig

type FilesystemConfig struct {
	Root *FilesystemDir `json:"root"`
}

func StrToFilesystem

func StrToFilesystem(cfg []byte) FilesystemConfig

func (*FilesystemConfig) ToString

func (cfg *FilesystemConfig) ToString() (string, error)

type FilesystemDir

type FilesystemDir struct {
	Name        string            `yaml:"name"`
	Permissions int               `yaml:"permissions"`
	Subdirs     []*FilesystemDir  `yaml:"subdirs"`
	Files       []*FilesystemFile `yaml:"files"`
	Parent      *FilesystemDir    `yaml:"-"`
}

func (FilesystemDir) Describe

func (d FilesystemDir) Describe() string

func (FilesystemDir) DescribeSelf

func (d FilesystemDir) DescribeSelf() string

func (*FilesystemDir) GetFile

func (d *FilesystemDir) GetFile(name string) (error, *FilesystemFile)

func (*FilesystemDir) GetFileOrDir

func (cwd *FilesystemDir) GetFileOrDir(root *FilesystemDir, path string) (error, FileDir)

func (*FilesystemDir) GetSubdir

func (d *FilesystemDir) GetSubdir(name string) (error, *FilesystemDir)

func (FilesystemDir) Path

func (d FilesystemDir) Path() string

func (*FilesystemDir) PathHelp

func (d *FilesystemDir) PathHelp(belowRoot bool) string

func (FilesystemDir) PlainName

func (d FilesystemDir) PlainName() string

func (FilesystemDir) TabcompleteName

func (d FilesystemDir) TabcompleteName() string

func (*FilesystemDir) TryCD

func (d *FilesystemDir) TryCD() (error, *FilesystemDir)

func (FilesystemDir) TryCat

func (d FilesystemDir) TryCat() (error, string)

type FilesystemFile

type FilesystemFile struct {
	Name    string         `yaml:"name"`
	Content string         `yaml:"content"`
	Parent  *FilesystemDir `yaml:"-"`
}

func (FilesystemFile) Describe

func (f FilesystemFile) Describe() string

func (FilesystemFile) DescribeSelf

func (f FilesystemFile) DescribeSelf() string

func (FilesystemFile) Path

func (f FilesystemFile) Path() string

func (FilesystemFile) PlainName

func (f FilesystemFile) PlainName() string

func (FilesystemFile) TabcompleteName

func (f FilesystemFile) TabcompleteName() string

func (FilesystemFile) TryCD

func (f FilesystemFile) TryCD() (error, *FilesystemDir)

func (FilesystemFile) TryCat

func (f FilesystemFile) TryCat() (error, string)

Jump to

Keyboard shortcuts

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