core

package
v0.0.0-...-204825d Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirectoryHasNoParentError

func DirectoryHasNoParentError() error

Types

type AbstractFsObject

type AbstractFsObject struct {
	Name   string
	Parent *AbstractFsObject
	Type   FsObjectType
}

func (*AbstractFsObject) GetName

func (o *AbstractFsObject) GetName() string

func (*AbstractFsObject) GetParent

func (o *AbstractFsObject) GetParent() (FsObject, error)

func (*AbstractFsObject) GetType

func (o *AbstractFsObject) GetType() FsObjectType

type Console

type Console interface {
	Read(message string) (string, error)
	Println(message string)
}

type Directory

type Directory struct {
	AbstractFsObject *AbstractFsObject
	Children         []*AbstractFsObject
}

func DirectoryFromAbstractFsObject

func DirectoryFromAbstractFsObject(origin *AbstractFsObject) *Directory

func NewDirectory

func NewDirectory(name string, parent *Directory) *Directory

func (*Directory) AddChild

func (d *Directory) AddChild(child *AbstractFsObject)

func (*Directory) GetAbstractFsObject

func (d *Directory) GetAbstractFsObject() *AbstractFsObject

func (*Directory) GetChildDirectory

func (d *Directory) GetChildDirectory(name string) *Directory

func (*Directory) GetChildren

func (d *Directory) GetChildren() []*AbstractFsObject

func (*Directory) GetName

func (d *Directory) GetName() string

func (*Directory) GetParent

func (d *Directory) GetParent() (FsObject, error)

func (*Directory) GetType

func (d *Directory) GetType() FsObjectType

type FsObject

type FsObject interface {
	GetName() string
	GetParent() (FsObject, error)
	GetType() FsObjectType
}

type FsObjectType

type FsObjectType int64
const (
	FILE      FsObjectType = 0
	DIRECTORY FsObjectType = 1
)

Jump to

Keyboard shortcuts

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