service

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateFileTree

func GenerateFileTree(root string, organize bool) (interface{}, error)

GenerateFileTree recursively generates a file tree for the given directory

Types

type FileNode

type FileNode struct {
	Name         string      `json:"name"`
	Size         int64       `json:"size,omitempty"`
	FileType     string      `json:"fileType,omitempty"`
	Path         string      `json:"path"`
	CreatedDate  int64       `json:"createdDate,omitempty"`
	LastModified int64       `json:"lastModified,omitempty"`
	IsDir        bool        `json:"isDir"`
	Children     []*FileNode `json:"children,omitempty"`
}

type OrganizedTree

type OrganizedTree struct {
	Dirs  []*FileNode `json:"dirs"`
	Files []*FileNode `json:"files"`
}

func OrganizeFileTree

func OrganizeFileTree(node *FileNode) OrganizedTree

Organizes the file tree into a flat list

Jump to

Keyboard shortcuts

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