Documentation
¶
Index ¶
- Variables
- type ListEntry
- type VirtualFS
- func (v *VirtualFS) ChangeDir(path string, player *entity.Player) error
- func (v *VirtualFS) Chmod(path string, mode os.FileMode, player *entity.Player) error
- func (v *VirtualFS) Copy(src, dst string, player *entity.Player) error
- func (v *VirtualFS) CreateFile(path string, content string, player *entity.Player) error
- func (v *VirtualFS) Exists(path string) bool
- func (v *VirtualFS) GetCurrentPath() string
- func (v *VirtualFS) GetFile(path string) (*entity.File, error)
- func (v *VirtualFS) GetFolder(path string) (*entity.Folder, error)
- func (v *VirtualFS) IsDir(path string) bool
- func (v *VirtualFS) ListDir(path string, showHidden bool, longFormat bool, player *entity.Player) ([]ListEntry, error)
- func (v *VirtualFS) MkDir(path string, player *entity.Player) error
- func (v *VirtualFS) Move(src, dst string, player *entity.Player) error
- func (v *VirtualFS) ReadFile(path string, player *entity.Player) (string, error)
- func (v *VirtualFS) RemoveDir(path string, recursive bool, player *entity.Player) error
- func (v *VirtualFS) RemoveFile(path string, player *entity.Player) error
- func (v *VirtualFS) SetupGameFile(path, content, owner string, fileType entity.FileType, perms os.FileMode) error
- func (v *VirtualFS) SetupGameFolder(path, owner string, locked bool, requiredKey string) error
- func (v *VirtualFS) Touch(path string, player *entity.Player) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("no such file or directory") ErrPermissionDenied = errors.New("permission denied") ErrIsDirectory = errors.New("is a directory") ErrNotDirectory = errors.New("not a directory") ErrNotEmpty = errors.New("directory not empty") ErrAlreadyExists = errors.New("file exists") )
Functions ¶
This section is empty.
Types ¶
type ListEntry ¶
type ListEntry struct {
Name string
IsDir bool
Permissions string
Owner string
Group string
Size int64
ModTime time.Time
FileType entity.FileType
}
ListEntry representa una entrada en el listado de directorio
type VirtualFS ¶
type VirtualFS struct {
// contains filtered or unexported fields
}
VirtualFS representa el sistema de archivos virtual del juego
func NewVirtualFS ¶
func NewVirtualFS() *VirtualFS
NewVirtualFS crea un nuevo sistema de archivos virtual en memoria
func (*VirtualFS) CreateFile ¶
CreateFile crea un nuevo archivo
func (*VirtualFS) GetCurrentPath ¶
GetCurrentPath devuelve el path actual
func (*VirtualFS) ListDir ¶
func (v *VirtualFS) ListDir(path string, showHidden bool, longFormat bool, player *entity.Player) ([]ListEntry, error)
ListDir lista el contenido de un directorio
func (*VirtualFS) RemoveFile ¶
RemoveFile elimina un archivo
func (*VirtualFS) SetupGameFile ¶
func (v *VirtualFS) SetupGameFile(path, content, owner string, fileType entity.FileType, perms os.FileMode) error
SetupGameFile crea un archivo con metadatos de juego
func (*VirtualFS) SetupGameFolder ¶
SetupGameFolder crea un directorio con metadatos de juego
Click to show internal directories.
Click to hide internal directories.