filenode

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WalkOnFsPath

func WalkOnFsPath(root *FileNode, absolutePath connector.Path, wg *sync.WaitGroup, ch chan connector.Path)

Types

type DateType

type DateType int
const (
	MILLI DateType = iota
	NANO
)

type ExtraPayload

type ExtraPayload struct {
	UUID       string
	IsDir      bool
	Sum        string
	Size       int64
	CreatedAt  int64
	Permission string
}

type FileNode

type FileNode struct {
	Subs       []*FileNode `json:"subs"`
	Name       string      `json:"name"`
	UUID       string      `json:"uuid"`
	ParentUUID string      `json:"parent_uuid"`
	Meta       MetaData    `json:"meta"`
}

func (*FileNode) Create

func (fn *FileNode) Create(fromPath connector.Path, absolutePath connector.Path, ch ...chan connector.Path) (*FileNode, error)

func (*FileNode) Move

func (fn *FileNode) Move(fromPath connector.Path, toPath connector.Path) (*FileNode, error)

func (*FileNode) Remove

func (fn *FileNode) Remove(fromPath connector.Path) (deletedNode *FileNode, err error)

func (*FileNode) RemoveByUUID

func (fn *FileNode) RemoveByUUID(uuid string, parentUUID string) (*FileNode, error)

func (*FileNode) Rename

func (fn *FileNode) Rename(fromPath connector.Path, toPath connector.Path) (*FileNode, error)

func (*FileNode) Search

func (fn *FileNode) Search(path string) *FileNode

func (*FileNode) SearchByUUID

func (fn *FileNode) SearchByUUID(uuid string) *FileNode

func (*FileNode) SumUpdate

func (fn *FileNode) SumUpdate(absolutePath connector.Path) error

func (*FileNode) Update

func (fn *FileNode) Update(fromPath connector.Path, absolutePath connector.Path) (*FileNode, error)

func (*FileNode) UpdateWithExtra

func (fn *FileNode) UpdateWithExtra(extra ExtraPayload)

type MetaData

type MetaData struct {
	IsDir      bool   `json:"is_dir"`
	Sum        string `json:"sum"`
	Size       int64  `json:"size"`
	CreatedAt  int64  `json:"created_at"`
	Permission string `json:"permission"`
}

func (MetaData) CreatedDate

func (m MetaData) CreatedDate(t DateType) time.Time

Jump to

Keyboard shortcuts

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