Documentation ¶
Index ¶
- Constants
- func ReadLine() (r []string)
- func Split(path string) []string
- type Anchor
- type Explorer
- type File
- func (f *File) Load() ([]byte, error)
- func (f *File) MustLoad() []byte
- func (f *File) MustRead() string
- func (f *File) MustRemove()
- func (f *File) MustStore(data []byte)
- func (f *File) MustWrite(data string)
- func (f *File) Path(file ...string) string
- func (f *File) Read() (string, error)
- func (f *File) Remove() error
- func (f *File) Store(data []byte) error
- func (f *File) String() string
- func (f *File) Write(data string) error
- type Folder
- func (f *Folder) CD(path string) *Folder
- func (f *Folder) Child(path string) *Folder
- func (f *Folder) Create(dirs []string) (size int64, isDir bool)
- func (f *Folder) Delete(c interface{ ... })
- func (f *Folder) Find(name string) *File
- func (f *Folder) JumpTo(path string) *Folder
- func (f *Folder) List() Chan.Chan[fmt.Stringer]
- func (f *Folder) MakeTo(path string) Explorer
- func (f *Folder) Mkdir(path string) (*Folder, bool)
- func (f *Folder) MkdirAll()
- func (f *Folder) RemoveAll()
- func (f *Folder) Replace(path string) string
- func (f *Folder) String() string
- func (f *Folder) Touch(name string, size int64) (*File, bool)
- func (f *Folder) Transport(path string, names ...string) *Anchor
- func (f *Folder) Walk() int64
- type Resource
- type Size
Constants ¶
View Source
const ( Byte = "{Byte}" KB = "{KB}" MB = "{MB}" GB = "{GB}" TB = "{TB}" )
View Source
const SEP = string(os.PathSeparator)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Anchor ¶
type Anchor struct {
// contains filtered or unexported fields
}
type File ¶
type File struct { Name string `cmps:"1" json:"name"` Back *Folder `json:"-"` Size Size `json:"size"` // contains filtered or unexported fields }
func (*File) MustRemove ¶ added in v0.3.0
func (f *File) MustRemove()
type Folder ¶
type Folder struct { File `cmps:"1"` Files cmps.SafeSlice[*File] `json:"files"` Folders cmps.SafeSlice[*Folder] `json:"folders"` }
func (*Folder) CD ¶
Warning: if you want to check the returning Explorer whether nil.
You need to use:
f.CD("xxx") == (*Folder)(nil)
Instead of:
f.CD("xxx") == nil
type Resource ¶
type Size ¶
type Size struct {
// contains filtered or unexported fields
}
func (*Size) MarshalJSON ¶ added in v0.3.2
Click to show internal directories.
Click to hide internal directories.