mnt_node.go 820 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package amntfs
  2. import (
  3. "fmt"
  4. "git.swzry.com/ProjectNagae/FsUtils/mountree"
  5. "github.com/spf13/afero"
  6. )
  7. var _ mountree.PayloadType = (*MountNode)(nil)
  8. type MountNode struct {
  9. mountId int64
  10. mountPoint string
  11. filesystemType string
  12. filesystem afero.Fs
  13. }
  14. func (m MountNode) MountId() int64 {
  15. return m.mountId
  16. }
  17. func (m MountNode) MountPoint() string {
  18. return m.mountPoint
  19. }
  20. func (m MountNode) FsType() string {
  21. return m.filesystemType
  22. }
  23. func (m MountNode) Name() string {
  24. return fmt.Sprintf("%08X", m.mountId)
  25. }
  26. func (m MountNode) Description() string {
  27. return fmt.Sprintf("%s[MID=%08X]@'%s'", m.filesystemType, m.mountId, m.mountPoint)
  28. }
  29. func (m MountNode) GetFs() afero.Fs {
  30. return m.filesystem
  31. }
  32. type MountInfoEntity struct {
  33. MountId int64
  34. MountPoint string
  35. FsType string
  36. }