Documentation ¶
Overview ¶
Package platform encapsulates platform-specific behavior. Only put generic code in this file, per-platform code should go in the appropriately named per-platform files in this directory.
Index ¶
- Constants
- func AllMounts() ([]string, error)
- func DirSize(path string) (int64, error)
- func MountFor(path string) (string, error)
- func SetUmask(newUmask int) int
- func SpaceAvailForPath(path string) (uint64, error)
- func SysProcAttrWithCred(uid uint32, gid uint32) *syscall.SysProcAttr
- func SystemMemoryKB() (int, error)
Constants ¶
const DefaultDirPerms = 0700
DefaultDirPerms is our default creation mode for directories. By default we only allow the user to operate on the directory.
const DefaultFilePerms = 0600
DefaultFilePerms is our default creation mode for files. By default we only allow the user to operate on a file.
const HabDefaultDataDirPerms = 0770
HabDefaultDataDirPerms is the mode used by habitat for data directories. We're using it when precreating them.
Variables ¶
This section is empty.
Functions ¶
func AllMounts ¶
AllMounts returns a slice of the mounted paths (strings) on the machine. It parse /proc/mounts, currently extracting the "mntonname" only.
func SpaceAvailForPath ¶
SpaceAvailForPath returns the space in KB available for the given path.
func SysProcAttrWithCred ¶
func SysProcAttrWithCred(uid uint32, gid uint32) *syscall.SysProcAttr
SysProcAttrWithCred returns a SysProcAttr with the credentials set to the given uid and gid
func SystemMemoryKB ¶
SystemMemoryKB returns the total system memory in KB
Types ¶
This section is empty.