sysinfo.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package sysinfo
  2. // SysInfo stores information about which features a kernel supports.
  3. // TODO Windows: Factor out platform specific capabilities.
  4. type SysInfo struct {
  5. // Whether the kernel supports AppArmor or not
  6. AppArmor bool
  7. cgroupMemInfo
  8. cgroupCPUInfo
  9. cgroupBlkioInfo
  10. cgroupCpusetInfo
  11. // Whether IPv4 forwarding is supported or not, if this was disabled, networking will not work
  12. IPv4ForwardingDisabled bool
  13. // Whether bridge-nf-call-iptables is supported or not
  14. BridgeNfCallIptablesDisabled bool
  15. // Whether bridge-nf-call-ip6tables is supported or not
  16. BridgeNfCallIP6tablesDisabled bool
  17. // Whether the cgroup has the mountpoint of "devices" or not
  18. CgroupDevicesEnabled bool
  19. }
  20. type cgroupMemInfo struct {
  21. // Whether memory limit is supported or not
  22. MemoryLimit bool
  23. // Whether swap limit is supported or not
  24. SwapLimit bool
  25. // Whether OOM killer disalbe is supported or not
  26. OomKillDisable bool
  27. // Whether memory swappiness is supported or not
  28. MemorySwappiness bool
  29. }
  30. type cgroupCPUInfo struct {
  31. // Whether CPU shares is supported or not
  32. CPUShares bool
  33. // Whether CPU CFS(Completely Fair Scheduler) period is supported or not
  34. CPUCfsPeriod bool
  35. // Whether CPU CFS(Completely Fair Scheduler) quota is supported or not
  36. CPUCfsQuota bool
  37. }
  38. type cgroupBlkioInfo struct {
  39. // Whether Block IO weight is supported or not
  40. BlkioWeight bool
  41. }
  42. type cgroupCpusetInfo struct {
  43. // Whether Cpuset is supported or not
  44. Cpuset bool
  45. }